Wednesday, April 5, 2017

How to Add Google Analytics to WordPress

Adding Google Analytics to WordPress is a painless process. There are numerous ways to do it. Today, we will follow some simple steps to get it added.

There is a plugin in the WordPress Plugin Repository that allows us to not only add the Google Analytics code, but load it in such a way that passes the Google PageSpeed Insights test.

By default, the Google Analytic’s script has a low 2 hour cache time set, which ironically triggers a flag in Google PageSpeed Insights.

The aforementioned plugin will let you add your Tracking ID, load the tracking code in the footer, and also load the script locally.

Loading the script locally bypasses the 2 hour cache limitation, removing the flag set by Google’s Page Speed test.

There is one caveat however, and that is that Google doesn’t support the local storage of the script.

The reason Google does not prefer the local serving of the script, is because it can quickly become out of date when upgrades occur.

However, the plugin that stores it, also leverages WP Cron to auto-update the script, so that concern becomes moot.

In this tutorial, you will learn:

  • How to add your site to Google Analytics.
  • How to connect Google Analytics with Google Search Console (assuming you have already added your site to Google Search Console).
  • How to add Google Analytics to WordPress.

Resources mentioned in the tutorial:

Before you move on:

  • Make sure that you have a Google Account. Having a Gmail email address or YouTube account qualifies.
  • Make sure that you have already added your web site to Google’s Search Console. This process is covered in the video, but not below in the written instructions.

How to add your site to Google Analytics.

  1. Point your web browser to: google.com/analytics
  2. Click Sign In at the top right, then click Analytics. If prompted, login with your main Google Account.
  3. Click the Sign Up button.
  4. Type in an Account Name similar to the name of your web site.
  5. Type in your Website Name.
  6. Choose the protocol for your web site: http or https
  7. Paste in your Website URL.
  8. Choose an Industry Category that best matches what your site is about.
  9. Change the Reporting Time Zone to match your local time.
  10. Specify any Data Sharing Settings you are interested in. Read about them to see if they matter to you.
  11. Click the Get Tracking ID button.
  12. When prompted to accept the Terms of Service, choose your country, read the Terms, and if you accept, click the I Accept button.
  13. Copy your Tracking ID for later use.

Assuming you have already setup your web site within the Google Search Console, let’s move on to the next steps.

How to connect Google Analytics with Google Search Console.

  1. Click on Property Settings on the left side.
  2. Scroll down, and click the Adjust Search Console button, then scroll back up.
  3. Click the Edit link.
  4. Choose the preferred version of your site (with or without https, with or without www), then click the Save button.
  5. You will now land in the Search Console. You can close that window to go back to Analytics.
  6. Click the Done button. Refreshing the page will show the connection between Analytics and Search Console.

Now, with your Analytics Tracking ID handy, let’s go back to your WordPress Dashboard.

If you haven’t yet copied the Tracking ID, you can click the Tracking Info, then Tracking Code link in the Analytics Dashboard to get it.

How to add Google Analytics to WordPress.

  1. From within your WordPress Dashboard, click Plugins, then Add New.
  2. Do a search for: Complete Analytics Optimization Suite
  3. Click Install Now, then Activate.
  4. Click Settings, then Optimize Analytics.
  5. Paste in your Tracking ID in the top box.
  6. Choose Footer for the location, unless you have a specific reason to choose Header.
  7. Select Anonymize IP if applicable.
  8. Click the Save Changes button.

To test placement, you can either:

  • Wait for Google Analytics to start reporting data. Visit your Google Analytics Dashboard to see. You can also have GA send test traffic.
  • Or, enable the ‘Track logged in Administrators’ feature in the Complete Analytics Optimization Suite, then visit your site, right-click and View Source, then do a Find for your Tracking ID.


How to Add Google Analytics to WordPress shared from Tipsandtricks-HQ


How to Add Google Analytics to WordPress syndicated from Aileen Batts Blog




from Leslies Tumblr http://lesliesrubin.tumblr.com/post/159222307287

No comments:

Post a Comment