• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

Tips and Tricks HQ

  • Home
  • Blog
  • Projects
    • All Projects
    • Simple WP Shopping Cart
    • WP Express Checkout Plugin
    • WP Download Monitor
    • WP Security and Firewall Plugin
    • WP eStore Plugin
    • WP Affiliate Platform
    • WP eMember
    • WP Lightbox Ultimate
    • WP Photo Seller
  • Products
    • All Products
    • Checkout
  • Support
    • Support Portal
    • Customer Only Forum
    • WP eStore Documentation
    • WP Affiliate Software Documentation
    • WP eMember Documentation
  • Contact

How to Add Google Analytics to WordPress

You are here: Home / Web Development / Blog Setup / How to Add Google Analytics to WordPress

Last updated: April 5, 2017 by Keith Lock





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:

  • Google Analytics
  • Google Search Console
  • Complete Analytics Optimization Suite Plugin

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.

Related Posts

  • How to Add Your Site to Google Search Console
  • How to Add AdSense to WordPress
  • Adding an Author Image and Bio Box in WordPress, and Linking to a Google+ Profile
  • How to Include Recipes in WordPress Posts

Blog Setup,  Video Tutorial,  Wordpress Analytics,  Blogging Tips,  Google,  google webmaster tools,  how to,  WordPress tutorial

Reader Interactions

Leave a Reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Featured & Popular Articles

Video Answers to Top WordPress QuestionsWordPress Optimization Tips and Tricks for Better Performance and SpeedEssential WordPress Security Tips - Is Your Blog Protected?WordPress Simple PayPal Shopping Cart PluginTop 15 Search Engine Optimization (SEO) Techniques I Forget to DoList of the Best and Must Use WordPress PluginsHow do I Start a Blog and Make Money Online?Good Domain Name Picking Tips for Your Blog SetupFind Out Which WordPress Web Hosting Company Offers the Cheapest and Reliable Web Hosting Solution

Featured WordPress Plugins

wordpress estore plugin
wordpress membership plugin
WP Express Checkout Plugin
WordPress Lightbox Ultimate Plugin
WordPress photo seller plugin
wordpress affiliate plugin

Recent Posts

  • Accept Donations via PayPal from Your WordPress Site Easil [...]
  • Buy Now Button Graphics for eCommerce Websites [...]
  • Subscription Button Graphics for eCommerce Websites [...]
  • Adding PayPal Payment Buttons to Your WordPress Sidebar Ea [...]
  • PayPal QR Codes [...]

Comment & Socialize

  • @Rodrigo Souza, Thank you f ...
    - admin
  • The example for 'slm_add_ed ...
    - Rodrigo Souza
  • @Ron, All the valid transac ...
    - admin
  • Hello, when people have sel ...
    - Ron
  • We have hte following featu ...
    - admin

Check out our solutions

View our WordPress plugin collection and start using them on your site.

Our WordPress Solutions

Footer

Company

  • About
  • Privacy Policy
  • Terms and Conditions
  • Affiliate Login

Top WordPress Plugins

  • Simple Shopping Cart
  • PayPal Donations
  • WP Express Checkout
  • WP eStore
  • WP eMember

Blogging Tips

  • How to Start a Blog
  • Selecting a Good Domain
  • Cheap WP Hosting
  • WP Video Tutorials
  • Simple SEO Tips

Search


Keep In Touch

Copyright © 2023 | Tips and Tricks HQ