How To Add Google Analytics Tracking Code Into Your WordPress Blog

When starting a new blog with WordPress one of the first things you want to do is add the Google Analytics tracking code into your blog.

If you’ve just arrived at this page and don’t know what Google Analytics is, here’s the quick lowdown.

Google Analytics is a powerful tool created by Google that allows webmasters to track and analyze detailed statistics about their website’s traffic, traffic sources and measures conversions and sales.

It is installed on more than 10 million websites around the globe, it is easily the favorite website traffic behavior monitoring tool on the web by far.

From a complete newbie’s perspective installing the GA code into your blog will help you to analyze and track your own website’s traffic and behavior, and also help you to create better goals for increasing ROI as well as helping you decide what blog post to write next.

So this post assumes you’re completely new and want to install the GA tracking code into your site.  Below you will find four simple steps that will help you achieve this successfully using a simple plugin.

4 Steps To Installing Google Analytics Tracking Code Into WordPress

1. Download the plugin

The first step is to download the Google Analytics by Yoast plugin from the plugin repository, or you can access it here >> Download Plugin.  Alternatively you can search for the plugin from the plugins folder within your blog’s admin panel.  Simply go to plugins >> add new and type the name of the plugin in the search box.

2. Install the plugin

Now install the plugin and click the activate link, it couldn’t be easier.

3. Grab the GA code

Next you’ll then need to log into your Google Analytics account to generate a new (UA) tracking code.  To do this you’ll need to go to Admin and then select which account you want to create a new code for and then hit Create New Account.

How to Add Google Analytics Tracking Code Into Your WordPress Blog

Fill in the necessary fields and generate your UA code…

4. Embed code…

Copy only the profile code generated which will look something like UA-XXXXXX, then go to your WordPress dashboard under settings >> Google Analytics.

Paste this code straight into the analytics profile box located at the top of your Google Analytics settings page in WordPress, then select where you want the code to be executed, the header is the best choice. If you don’t want to enter the code in manually, un-tick the box titled ‘Manually enter your UA code’ and select account and profile to authenticate with Google.

GA 2

Hit update Google Analytics settings and you’re all done. If you have any questions or problems, leave me a comment below.  In addition to this written tutorial, you might also want to check out the video below for more detailed instruction and an overview of Google Analytics created by Tyler Moore :)

Image credit

  • Frank Steiner

    You can also install Google analytics by putting the code directly into your theme files. However, it is better for newbies to have a plugin as you suggested.