Google Analytics for MyListing Websites

Build Better MyListing Websites. One Guide at a Time.

Table of Contents

Overview

Guide Updated: 10/13/2021

The Google Analytics for MyListing Websites guide will show you how to easily track your website customers and visitors. 

Google Analytics (GA) is a free service that provides valuable insights to help website owners shape a successful strategy for their business. It’s important to know what content is driving engagement, where visitors are coming from, and what devices they are using to view the content.

We highly recommend having analytics set up the day you launch your website, even if you’re not going to look at the data right away.

Google Analytics Account Setup

The steps in this section should be followed if all you need to track is simple website traffic. If you need to track additional entities such as Ads, please refer to the Google Tag Manager section.

  1. Sign into the Google Account you will use to manage your Google Analytics.
  2. Visit the Google Analytics website and Sign up.
  3. Enter an Account NameWebsite Name, and Website URL.
  4. Choose the Industry Category for your website, the Reporting Time Zone for your location, and uncheck all Data Sharing options.
  5. Click Get Tracking ID.
  6. Accept the terms.
  7. Take note of the entire script from the Global Site Tag (gtag.js) box.

Integrate Google Analytics with WordPress

Option 1 - Add Your Tracking Info Without a Plugin

Note: If you are not comfortable editing theme files, please consult with a website professional. Also, be sure you are using the MyListing Child Theme so that future theme updates do not overwrite any edits you make to the theme files.

Theme header.php

  1. Using a plugin or FTP, copy the header.php file from the MyListing Parent Theme to the same location in the MyListing Child Theme.
  2. From your WordPress dashboard, go to Appearance > Theme Editor.
  3. Ensure the Child Theme is active/selected, and edit the header.php file.
  4. Copy the entire script from Step 7 above and paste it in, just above the closing head tag (< /head>).
  5. Save changes.

Theme functions.php

  1. From your WordPress dashboard, go to Appearance > Theme Editor.
  2. Ensure the Child Theme is active/selected, and edit the functions.php file.
  3. Paste the script below, at the bottom of the file, inputting your tracking code where indicated.
  4. Save changes.
				
					//// INSTRUCTIONS: 
//// Copy and paste the code snippet below into the child theme's functions.php file.
//// You can edit the functions.php file from your WordPress dashboard (Appearance > Theme Editor) or via FTP.

//// NOTES:
//// Be sure to replace the Tracking ID (UA-xxxxxxxxx) with your own ID.

--------------------------- CODE SNIPPET IS BELOW THIS LINE --------------------------- 

function ns_google_analytics() { ?&gt;
  <script async src="https://www.googletagmanager.com/gtag/js?id=UA-xxxxxxxxx"></script>
  <script>
    window.dataLayer = window.dataLayer || [];
    function gtag(){dataLayer.push(arguments);}
    gtag('js', new Date());
    gtag('config', 'UA-xxxxxxxxx');
  </script>
  &lt;?php
  }
  
add_action( 'wp_head', 'ns_google_analytics', 10 );
				
			

Option 2 - Add Your Tracking Info Using a Plugin

If you prefer to use a plugin, here are some that you may be using on your MyListing website already.

SEOPress

  1. From your WordPress dashboard, go to SEO > Analytics > General.
  2. Enable Google Analytics Tracking > Check the box.
  3. Enter Your Tracking ID > Copy your Tracking ID from Step 7 above and paste it here.
  4. Exclude User Roles > Check the boxes for all user roles except Subscribers and Customers, to avoid diluting your statistics.
  5. Go to SEO > Analytics > Tracking.
  6. Enable IP Anonymization > Enable, especially if you need to comply with GDPR, but this is generally a good practice for privacy.

Perfmatters

  1. From your WordPress dashboard, go to Settings > Perfmatters > Google Analytics.
  2. Enable Local Analytics > Toggle on.
  3. Tracking ID > Copy your ID from Step 7 above and paste it here.
  4. Tracking Code Position > Footer.
  5. Anonymize IP > Toggle on, especially if you need to comply with GDPR, but this is generally a good practice for privacy.
  6. Tracked Logged In Admins > Toggle off. 
  7. Adjusted Bounce Rate > Set to 30.
  8. Use MonsterInsights > Toggle on, if you’re using this plugin along with Perfmatters. (Note: MonsterInsights will do most of the heavy lifting, but Perfmatters will add the optimization of loading the scripts locally.).

Verify Tracking

  1. Within Google Analytics, click on the Home icon, and find the Active Users right now box
  2. Open a different browser (ex. Chrome Incognito) where you are not logged into the website, and browse around the website

At this point, if things are set up correctly, you should see the Active Users right now change from 0 users to 1 user.

Google Analytics Filters

With Google Analytics now set up, we want to further configure some settings to fine-tune the tracking results.

Country Filter

For this example, we will configure a filter that will only show us traffic from a particular region, which in this case is a country (United States).

  1. With Google Analytics pulled up, click on the Admin icon from the main menu.
  2. In the far right column, choose Filters.
  3. Click Add Filter, and name the filter Include US Only.
  4. For the Filter Type, choose Custom, and click the Include radio button.
  5. For the Filter Field, choose Country.
  6. In the Filter Pattern box, enter United States.
  7. Click Save.

IP Address Filter

For this example, we will configure a filter to exclude the traffic that we ourselves generate by viewing our own websites.

  1. Click Add Filter, and name the filter Exclude Home IPs.
  2. For the Filter Type, choose Predefined.
  3. For  Select Filter Type choose Exclude.
  4. For Select source or destination choose traffic from the IP addresses.
  5. In the IP address box, enter the IP address for your home network. (Note: You can quickly find your IP address by visiting the IP Chicken website.).
  6. For Select Expression choose that are equal to.
  7. Click Save.
  8. Repeat the steps above for any location (network) that you’ll be viewing your website and has a more predictable IP address, such as corporate offices.

Exclude Known Bots and Spiders

  1. Go to the Admin area of your Google Analytics account.
  2. Under the All Web Site Data view (or any custom views you have created), click on View Settings.
  3. Under Bot Filtering, check the box to Exclude all hits from known bots and spiders.

Analytics-Based Optimization

Let’s say you discover that a large majority of your website visitors are using mobile devices. While you should be optimizing your website for mobile already, learning this information should light a fire under you to ensure your website is delivered quickly, and beautifully over mobile devices.

Check out our Optimize MyListing Websites for Outstanding Performance guide for ways to help with things like faster delivery on mobile devices.

Another example would be if you learn that certain posts/pages are not getting the views that you would have hoped or that people are quickly bouncing out of your content. This could mean that the value is just not there for these particular assets and the content either needs to be enhanced or possibly rolled into other existing content.

Implement Google Tag Manager with WordPress

If you would like to track multiple tag entities like Google Analytics and Facebook Pixel, please check out our Google Tag Manager for MyListing guide.

Set Up Google Analytics 4

At this point, you are currently using a Universal Analytics property, and to join the future of Analytics, we need to set up a Google Analytics 4 property.

The Universal Analytics property remains unchanged and will continue to collect data.

  1. While logged into Google Analytics, click on the Admin menu link (bottom left).
  2. Under the Property column, click GA4 Setup Assistant.
  3. Click the ‘Get Started’ button, within the ‘I want to create a new Google Analytics 4 property’ section.
  4. Click on the ‘Create Property’ button.

You should receive a ‘You have successfully connected your properties’ message.

  1. You will now want to jump over to our Google Tag Manager for MyListing Websites guide, to add your GA4 tag.

Grant Team Access

  1. While logged into Google Analytics, click on the Admin menu link (bottom left).
  2. Under the Account column, click User Management.
  3. Click the plus icon (upper right).
  4. Choose Add users.
  5. Enter the team member’s email address.
  6. Check the Notify new users by email box.
  7. Choose the desired level of permissions. (Note: You’ll typically want to grant Edit permissions here, especially when you need to allow management/maintenance, of your GA account.).
  8. Click Add.

WooCommerce Subscriptions Ready

The latest version of the WooCommerce Subscriptions plugin is included (unlicensed) and once you have a Starter Site in hand, you can easily put in your own pricing, package features, graphics, etc.

Should you not wish to use WooCommerce Subscriptions, you can simply turn the Listing Subscription packages into standard MyListing packages in just a few clicks and be on your way.

  • Custom WooCommerce Endpoint Design
  • WooCoommerce Subscriptions Setup
  • Listing Subscription Packages
  • Listing Subscription Switching
  • Stripe Payment Gateway Plugin
  •  and more…

Note: The latest version of the WooCommerce Subscriptions plugin is included, but you need to purchase your own license or sign up for a qualifying MyListing Website Care plan if you wish to receive future plugin updates and support.

Premium Assets

Get licensed, premium plugins, valued at over $600 in the first year alone, making a Starter Site investment a no-brainer.

You will get licensed copies of all the plugins listed below, with the exception of the WooCommerce Subscriptions and WooCommerce Product Vendors, and the licenses are yours to keep, for as long as the plugins remain on your website.

  • Admin 2020 ($39)
  • Crocoblock Suite ($130)
  • Elementor Pro ($49)
  • Perfmatters ($25)
  • Permalink Manager Pro ($45)
  • SEOPress Pro ($39)
  • WooCommerce Product Vendors ($79) 
  • WooCommerce Subscriptions ($199)
  • WP Rocket ($49)