Installing Google Analytics Tracking Code on WordPress

Did you ever wonder how some people in this world always seem to know all the details on who their client are, and how popular their website or online marketing effort has been? Well having a Google Analytics tracking code installed on your website is the way to go. Google Analytics is a really great tool from Google to know exactly what’s going on.

Knowing your numbers in your business or venture is critical. Knowing what your people like and don’t like on your site, could allow you or your business win that group of perfect clients that you have been aiming for. Business or Projects that succeed, know what is going on and are quick to take action. Hope you are starting to see the importance of Google Analytics. Let’s dive in and get you setup.

Google Analytics Step by Step Setup Guide

This is in two sections. Signing up for Google Analytics and then adding the Google Analytics tracking code to your website. The second part might very, it all depends on what type of website you are using. I highly recommend WordPress Self-hosted version. Please note, I am taking it that this is your first time using Google Analytics.  Apologies to those of you that use Analytics a lot.

Signing up with Google Analytics

You can go to the Google Analytics Website by following the below link:

https://analytics.google.com

This is normally a Gmail email address, but you can also have Google Suit and it may be linked to your domain. Check with your host to confirm if you are unsure.
This will hold all the items you would like to monitor.

Google Analytics Account Name

For example: Paul Hutchinson website.

Google Analytics Website Name

Next, you need to select HTTP or HTTPS.  If you don’t have a security certificate for your website or better known as SSL certificate, then select HTTP under Website URL.

Google Analytics website protocol

Now you need to fill in the rest of your website address that appears after the HTTP:// or HTTPS://. For example: www.paulhutchinson.co.za or paulhutchinson.co.za

Google Analytics website URL

Select the closest industry to the industry you are currently in, under Industry Category. This is to compare your statistics to others in your industry.

Google Analytics Industry Category

Under Reporting Time Zone. This is to provide you with reports in your time zone.

Google Analytics Reporting Time Zone

I would recommend ticking the below tick box’s

Google Analytics Data Sharing Settings

Next, Google will give you their Terms & Conditions pop up window. Here is what to do.

Select the country that you are are in, then read through the Terms and Conditions.

Google Analytics Terms Conditions

Google Analytics select country

If you accept, then click the “I Accept” button.

Google Analytics accept terms and conditions

After that, you will be forwarded to a new page with the tracking code on it. It will look like the below code. Copy your Google Analytics tracking code to a safe place we are going to need it later.

Google Analytics tracking code page

Scroll down the page until you see the Google Analytics Tracking Code.

[code language=”javascript”] (function(i,s,o,g,r,a,m){i[‘GoogleAnalyticsObject’]=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,’script’,’https://www.google-analytics.com/analytics.js’,’ga’);

ga(‘create’, ‘UA-94104831-1’, ‘auto’);
ga(‘send’, ‘pageview’);[/code]

The above code is just an example.

Google Analytics tracking code

That basically finishes the first step.  While some you have a Google Analytics Property up and running, there is more you can setup. We will cover that in another section. What’s more important is to add this Google Analytics tracking code to your website so that you can start tracking your numbers.

Installing Google Analytics Tracking Code into WordPress Theme.

There are many ways we can add the Analytics tracking code. Some are safer and easier than others.

Your Tracking code needs to be in the code of your website that loads before the page that you and I see. What’s more, it needs to be on every page. With WordPress, it is easier than others but at least you know where we are going to put this code.

Now some of you have a Premium WordPress Theme and you can simply add this code into your theme options. This varies from theme to theme.

If all else fails, here is a harder method.

Found on the menu on the left.

WordPress Appearance Menu

In the menu under Appearance, click on Editor

WordPress Appearance Menu Editor

Once that has opened, look for header.php on the right, then click on it.

WordPress Theme Editor - Header.php

Please note, if you do not see the header.PHP, then you might be using a child-theme. In this case, you just need to ask your hosting provider to copy your header.php into your child theme, so you can see it. Your hosting provider should know what to do.

Once you have opened your header.php, it will display all the code in the middle. Look for end of the head, normally displayed as /head with greater and smaller symbols around it.

WordPress editor header code

Above /head code paste your Google Analytics Tracking Code ID. Make sure you don’t overwrite the other code that is there.

WordPress header code with tracking

Then click update on the bottom of the page.

WordPress Update header file

This should complete everything. Check back in a day or two and see if there is data showing in your Google Analytics.

Simple way to check and test

You can log into your Google Analytics and click on Real-Time on the right.  Then click on overview.

Google Analytics real time overview

Go to your website in a new tab, then check if you can see some on your website. If you see something then it’s working. WELL DONE.

Google Analytics real time page

Google Analytics Tracking Code Conclusion

Well done!  If you have completed all the steps as described above, then you should start getting some information in Google Analytics within 24 hours.

If all the above has confused you or you just don’t have the time, I totally understand.  You can just order a gig on Fiver and I will assist you and to just get this setup for you.

Allow me to complete the above by simply ordering my services:
https://www.fiverr.com/s2/7e2abc97cc

Install Google Analytics Tracking Code for me

So what are the Next Steps?

Next, I would highly recommend setting up Google Seach Console. This will allow you to get informed if Google picks up an issue with your website, like it’s running too slow or even hacked.

SEO Company

By | 2017-08-05T10:01:50+00:00 February 12th, 2017|Google Analytics|2 Comments

About the Author:

Thanks for taking the time out and reading my post, I really hope it's been helpful in some way. I would love to know what you thought. I have owned many different businesses, and learnt many ways to market and build business and teams to support clients all over the world. My website is all about giving back and at the same time a way to meet people that love making an impact and leaving a legacy.

2 Comments

  1. Martha-Anne 21st July 2017 at 9:43 am - Reply

    Before reading this article on Google Analytics I was pretty much clueless as to how to set up an account, never mind the tracking part of it!
    It was extremely helpful and I would recommend any and everyone needing some assistance to follow these guidelines.
    They simple, easy to understand and follow and definitely effective in helping you take the right steps.
    Thank you, Paul!

    • Paul Hutchinson 22nd July 2017 at 11:48 am - Reply

      Your Welcome Martha-Anne, I am glad my content is helping others.

Leave A Comment