How to Install Google Analytics Code on a WordPress Site - A beginner's Guide

By Rob Gravelle

How to Install Google Analytics Code on a WordPress Site - A beginner's Guide

By Rob Gravelle with Lisa Smith

What is Google Analytics?


Google Analytics is a website utility for web developers of all levels. Google Inc. developed this tool not only to eliminate the need for you to build a website analysis package from scratch but also to make it easy for you to track the activities on your site. By using Google Analytics, you will be able to see who visited your site, what they did, when they were on your site, the time they spent online, the source of traffic, and how they interacted with your content.

What's so unique about Google Analytics?

The truth is Google Analytics has been the talk among many, but it is almost always a topic that many beginners do not understand. Moreover, many developers are aware of its existence, but they often choose to set up their tools in the name of "I want to be unique". Regardless, the power of Google Analytics and its implementation is incomparable to many website analytics today, including the very tool you intend to create from scratch. Because Google Analytic is robust, simple to use and - for a part - free, it is highly unlikely that you are going to spend time thinking about how to create your model that emulates the same application.

Do I need this tool for my WordPress Blog?

There are many reasons why you should install Google Analytics on your WordPress blog. Even if you have the best WordPress Themes installed and you are sure that your landing page can draw visitors in, you cannot get an accurate estimate of the number of visitors to your site by judging from the face value. Besides, not even a single WordPress Templates comes with a pre-installed Analytics plug-in.

If you do not care about traffic, or are just blogging without the intention to make money, or don't care about visitor statistics you needn't bother with this tool. However, we know Google Analytics has many benefits, including but not limited to the following:

  1. Google Analytics helps you not only to understand the location of your audience but also it gives you a clear report of the device and the web browser they used.
  2. Google Analytics will help you to track the pages that visitors checked, the amount of time they spent on your website, and, more importantly, the bounce rate of the website, i.e., the number of visits in which a person leaves your website from the landing page without browsing any further.

How to Install the Solution on my WordPress Blog

Step #1: Get the Analytics' Tracking Code


  1. Click the Admin link; the link is at the top navigation section, immediately after the Customization Anchor text.
  2. Next, click the Tracking Info option, and a slide-down menu will appear.
  3. In the menu, click the Tracking Code anchor text; the link will open a new section and slide the property container to the left. The section has the code that we are looking for; you are going to add this code to your WordPress Blog.

Watch the Video Here - Find your Google Analytics Tracking Code

Step #2: Add the Tracking Code to Your WordPress Blog


  1. Log in to your WordPress website. Please note that this installation is not for blogs hosted on the official website of WordPress. We are talking about the WordPress website hosted on your paid hosting, registered with your unique domain name.
  2. Next, navigate using your username and password. From the Admin Panel on the left, click appearance, and then click the Editor link to open the editor of your WordPress Themes and Templates. Note that the editor will allow you to make changes to yourWordPress Themes and Templates.
  3. Place the Google Analytics' code on either the header file or the footer file. It is important to remember that placing the tracking code in the header section of the page will load Google Analytics immediately, even before the other sections of the page loads. In this case, you give more priority to the Google Analytics tracking code first. Putting the code in the footer file of your WordPress Themes and Templates will do just the opposite; your website's pages will load first and then the Google Analytics.

Watch Video Here - Add Google Analytics Tracking Code


When it comes to Google analytics, there is no equal. Most every web developer is highly satisfied with the stats. Though there are different plugins availble, the quality and breadth of features in Google analytics is unmatchable. Everyone can benefit by installing Google Analytics and make use of its features.

The need for installing Google analytics has already been mentioned in this write-up, yet a concluding note should remind you that other tools may be of great use, but when it comes to Google analytics for your WordPress site, nothing else even comes close.

Rob Gravelle

Rob Gravelle resides in Ottawa, Canada, and is the founder of GravelleWebDesign.com. Rob has built web applications for numerous businesses and has recently developed his own jquery-tables library.

Rob's alter-ego, "Blackjacques", is an accomplished guitar player, that has released several CDs. His band, Ivory Knight, was rated as one of Canada's top hard rock and metal groups by Brave Words magazine (issue #92) and reached the #1 spot in the National Heavy Metal charts on ReverbNation.com.

Lisa is a designer by profession and writer by choice, she writes for almost all topics but design and Fashion are her favorites. Apart from these she also Volunteers at few Animal rescue centers.

  • Web Development Newsletter Signup

    Invalid email
    You have successfuly registered to our newsletter.
Thanks for your registration, follow us on our social networks to keep up-to-date