Google Analytics – Part 2

Welcome to Part 2 of Google Analytics!

In our previous post we talked about What is Google Analytics, Creating your Google Analytics Account, and adding your first property (web site) to your Google Analytics account.

In Part 2, we are going to take you through the process of Adding the Google Analytics Tracking Code to your WordPress website.

If you have not read Part 1 of this article, then we recommend you go back and read that post. Follow thru on the steps we outlined and you should be at the point where you can easily complete the information that follows.

Google Analytics Tracking Code

To pick up where we left off. Let’s first log into Google Analytics, and go back to the page that provides us with our Google Analytics Tracking Code and information.

Logged Into Google

You will see your profile picture here.

Open your web browser and go to Look in the Top Right Hand corner of this page and check to ensure you are already logged into your Google account.

If you are logged in, you will see your Profile picture (if you added one) along with the normal set of Google Icons like the sample image to the right.

If you are not logged in, you will see a Sign In button. Click the button to log into Google now.

Once you have verified that you are logged into Google, click on this link to take you to Google Analytics. Google Analytics will open up and you will be presented with the Audience Overview page.

At this point, since we have not installed the Google Analytics Tracking Code on your website, your page will show all zeros for the Audience Overview metrics. Don’t worry about the data on this page yet, let’s get your website setup so that Google Analytics can begin collecting statistics from your web pages.

Click on the ADMIN menu option (as shown below);

Google Analytics Admin Menu

The ADMIN menu option in Google Analytics.

This will take you into the Admin Section for your Google Analytics Account which will look something like this (see image below);

Google Analytics Tracking Info

Tracking Info Section


In the the Admin Section under the Property column, click on the Tracking Info link (as shown in above image).

This will open up a drop down list of available Tracking Info options (see image below);

Google Analytics Tracking Info

Locate the Tracking Code information for this property here.


In the list of Tracking Info options, click on the Tracking Code option (as shown above). This will take you to your Tracking Code Information page (shown below);

Google Analytics Tracking Code Info

Your tracking code is displayed on this page.

Besides providing you with your Google Analytics Tracking ID, this page provides you with a lot of additional information, as well as the status of your web site traffic and how your tracking code is working. For now, just leave this page open, because we will need access to this data in the following steps.

Installing Google Analytics Tracking Code on your WordPress website

Remember, the purpose of installing the Tracking Code, onto every page of your website, is to allow Google Analytics to gather statistics about your website and it’s visitors.

Once Google Analytics has statistics about your website, it aggregates them into valuable information that you can then report on. You’ll soon have access to valuable metrics about your website.

Metrics like Bounce Rate, Visitor Engagement, Pages per Visitor, Total Visitors, and more, can be determined using the statistics that Google Analytics will capture once the Tracking Code is installed. We’ll talk more about these metrics, as well as the reports available to you, via Google Analytics, in Part 3 of our review of Google Analytics.

There are several different methods that you can use to install the Google Analytics Tracking Code onto your website. The method you choose to use is strictly a matter of choice, as each method works equally as well.

Method 1 – Theme Install Option

Depending on your theme, this option may or may not be available to you.

I use Studio Press for my website themes. I love Studio Press because their themes are beautifully designed and are SEO friendly. In addition, the Studio Press theme provides an option, where I can add code to the HEADER or FOOTER of every page, by simply inputting the script information into the theme settings page.

Because my theme supports it, this is the method that I chose to use for adding my Google Analytics Tracking Code.

Check your theme setting and see if it has a similar option as what Studio Press provides (See the below screen image);

StudioPress Footer Script Area

Footer Script area in StudioPress Theme.

As you can see, in my theme settings, I have a Header Script and Footer Script option. Any scripts added to these sections appear in each and every page of the theme.

I recommend adding the Google Analytics Tracking Code to the Footer Script area. The Footer Script will get executed after the page has loaded, therefore, the Google Analytics code will not impact the load speed of you web page.

To add the script, go back to your Google Analytics Tracking Info Page and find the Website Tracking Section. The code inside the script tags <script></script> is what you want to copy into your website Footer Script area (see yellow highlighted script in image below);

Tracking Code Script

Highlight, copy, & Paste this script to your theme footer script area.

Highlight this code, then copy and paste it, into the Footer Script area of your theme. Be sure you include the <script></script> tags too. Similar to what I have done below;

StudioPress Footer Script Area

Footer Script area in StudioPress Theme.

Once you have this script copied, be sure to save the theme settings…you are done!

If your theme includes similar script capabilities as StudioPress, and you followed the above method of installing the Google Analytics Tracking Code , you can skip to the Testing Google Analytics Tracking for Your Website section. Otherwise, continue on to Method 2 – PlugIn Options.

Method 2 – PlugIn Options

Plugins are nothing more than snippets of code used to enhance the features and functionality of WordPress. Out of the box, WordPress does not provide an easy method for adding the Google Analytics Tracking Code to your website. Fortunately, there are several good plugins that have enhanced WordPress and made this process much easier.

To get started, go to your WordPress Admin page and click on Plugins on the left hand side of your admin area, and then click on Add New (see image);

Add New Plugin

Once you are on the Add Plugins page, in the top right hand corner is a search box, type in Google Analytics, then press enter.

As you can see from the results, there are hundreds of plugins that provide the ability to add the Google Analytics Tracking Code to your website. Some of the plugins add additional features and functionality.

It’s your decision which plugin you use.

However, my recommendation is, stick with the basics. Use a plugin that is specifically meant to allow you the ability to add the Google Analytics Tracking Code to your WordPress Website.

It’s important to note – many of the SEO plugins, like All in One SEO, have built in support for Google Analytics. Therefore, check the plugins you already have installed and see if any of them give you what you need for Google Analytics Tracking.

Select the Google Analytics plugin that you wish to use, then follow their instructions for installing the plugin. Once installed, use their instructions for configuring their plugin to use your Google Analytics code.

Depending on the plugin, and how the developer created the plugin. You may not need to install the full script, as we did in Method 1 above. Instead, many plugins just require the Google Tracking ID to be installed. Again, check the plugin website for instructions on how to implement the Google Tracking Info for their respective plugin.

If you have chosen Method 3 for installing your Google Tracking code, then you are done… You can skip ahead to the Testing Google Analytics Tracking for your Website section.

Method 3 – Raw Scripting

Chances are, if you have made it to Method 3, then you are faced with the following two dilemmas;

  1. Your theme does not support Header or Footer Script properties
  2. You don’t want to install another plugin on your website

Never fear, there is one additional way that you can install the Google Tracking Code onto your website pages.

However, I must warn you – This is going to require getting into the WordPress code, cutting and pasting, the Google Tracking Script.

So before we begin, ensure you have a recent backup of your WordPress website. Even though this is a fairly simplistic process, things can go wrong, so you will want to ensure you have a way to restore your site in the event something doesn’t work as planned.

In this process, we are going to add the script for your Google Analytics Tracking Code (the code in the <script></script> area) to your themes FOOTER.PHP file.

The steps to perform this are outlined below;

  1. Go to your Google Analytics Info page, highlight the tracking code script (see image below), and copy the Tracking Code script to your clipboard (ctrl-c).
    Tracking Code Script

    Highlight, copy, & paste this script to your theme footer script area.


  2. Go back to your WordPress Admin page. On the left hand side of your admin page locate Appearance, highlight it, and then select the Editor option;

    Appearance Editor

    Edit your themes appearance and functionality.

  3. On the Edit Themes page, you need to select your “Active” theme. The active theme, is the theme that you are currently using for your WordPress website. To select the theme, in the Top Right Hand corner, in the drop down box, locate your active theme, then click select. This will load your themes files into the editor;

    Theme Editor

    Select the ACTIVE theme to edit the theme files.

  4. Now that you have your Active theme’s files loaded. We can continue to make the required modification to the FOOTER.PHP file for your theme. The modification we will make will just add the Google Analytics tracking Code to the footer section of each page on your website. On the right hand side of the Edit Themes page locate the Theme Footer (footer.php) file. (see below image);

    Theme Footer

    Click to load it into the editor window.

  5. Click on the Theme Footer (footer.php) file as shown in the above image. This will load your themes footer.php file in to the Theme Editor window, for editing;

    Theme Editor - footer.php

    The footer.php loaded in the theme editor.

  6. In the Editor Window, use the scroll bar and go to the bottom of the footer.php file. You should see the the footer.php file contents that will look similar to the following;

    Edit Themes - footer.php

    Locate </body> tag in page.

  7. Locate the </body> tag and place your cursor before this tag, insert a couple of blank lines by hitting [Enter] twice. Now, go to the first blank line that you inserted and paste your Google Tracking Code (ctrl-v) into the footer.php. (We copied this code to your clipboard in Step 1 above, so performing a (ctrl-v) should paste the code from your clipboard.)
    Modified Footer.php File

    The footer.php page with your google tracking code added.

    Your FOOTER.PHP should look similar to the above screen shot after adding your Google Tracking Code and completing this step.

  8. Now click on the Update File button at the bottom of the page. This will update your theme, with the Google Analytics Tracking Code installed in the footer of every page.

You’re done… Now wasn’t that easy?


Testing Google Analytics Tracking for your Website

Let’s assume you have used one of the methods outlined above, to install and configure your website, so that the Google Analytics Tracking Code is included in every page. We want to make certain that the tracking code is working, as expected, and that Google Analytics begins capturing statistics from your website.

There are a couple of ways to perform this testing;

  • Option 1 – Wait 24 hours for Google to start showing data in your Google Analytics report pages
  • Option 2 – Check the status and Send Test Traffic to your site
  • Option 3 – Use the Real-Time analytics to check your statistics gathering

Unless you use the Real-Time Analysis reports within Google Analytics. Statistics on your website may take up to 48 hours to begin showing up in your reports. Therefore, you could wait 48 hours for Google Analytics to start showing data. But, I don’t recommend this approach, as you don’t want to miss capturing another day’s worth of usage on your website. Therefore, in my opinion, Option 1, is not an option.

You can go to your Tracking Info Page and review the Status of your tracking code. It shows up in the Tracking Code Info page next to your Tracking ID. (see image below)

Tracking Status

Use this to check the status of Google Tracking Code for your website.

However, the status as reported by Google, may also take up to 48 hours to reflect accurately.

Remember, Google captures your data immediately, but it may not aggregate that data and make it available in your dashboard for up to 48 hours. In my opinion, Option 2 is not a good option for checking your Google Analytics Code Installation.

I would recommend you use this status, once you know your Tracking Code is installed correctly. It’s a great way to check and ensure that nothing has caused the Tracking Code script to stop working.

Real-Time Analysis

Option 3 – As outlined above, is beyond a doubt, the best method for testing your tracking code installation.


Because it’s immediate!

To begin testing your Google Analytics Tracking Code Installation. Open two web browser windows, in one window go to your website, in the second window go to your Google Analytics Dashboard. Locate the Real-Time section, open it and select Overview (see screen shot below);

Real-Time Active Users

Displays actual users on site in Real-Time.


If you have installed your tracking code correctly, the number of Active Users on Site should be at least 1. This means that Google Analytics is accurately tracking your website statistics and capturing data for your analysis. In your web browser window for your website, feel free to browse around your site, visiting different pages and links.

See how Google Analytics captures your website visitor’s every movement!


In Part 2 of Google Analytics we have presented you with the various methods available to you for Installing Google Analytics on your WordPress website. We also outlined several options for testing your installation, and provided you with our opinion, on the best Google Analytics Code Installation Testing option, using Real-Time traffic monitoring.

This is the second part of a three part series. If you landed on this page and read this article, but missed Google Analytics – Part One then we encourage you to read that post too.

In our upcoming post, Part Three – Google Analytics, we will cover all of the metrics and analytics that Google Analytics will provide you, now that you have Google Analytics capturing your statistics.

As always, we encourage you to comment and provide feedback about this article series on Google Analytics.

The NetworkCEO






  1. […] In our next article, for this multi-part series, we will cover How to Install Google Analytics on your WordPress website. […]

Leave a Reply