How to add Google Analytics to your WordPress website

Google Analytics is a free tool provided by, you guessed it, Google that allows you to analyse all the activity that occurs on your website. If you have a WordPress website that you want to drive traffic to, now is the time to start using Google Analytics.

Every time you open up the Google homepage and type in a search query, you are triggering a battle between hundreds of websites as they all compete to be at the top of your search results page. And what is the most prized weapon in the Battle of the Websites? Google Analytics! What a sword is to a knight, Google Analytics is to the online business.

If you have a WordPress website that you want to drive traffic to, now is the time to start using Google Analytics. But before we get into the details of how to add Google Analytics to your website, let’s clear up what exactly Google Analytics is…


What is Google Analytics?

Google Analytics is a free tool provided by, you guessed it, Google that allows you to analyse all the activity that occurs on your website. With visual dashboards, Google Analytics gives you the information you need to compare data across time through the lens of a variety of different metrics.

Examples of the kind of insights you can gain from Google Analytics would be:

  • How many visitors come to my website?
  • What is the average age of my visitors?
  • Where do my visitors come from?
  • What pages of my website do visitors land on?
  • What is the average length of time visitors stay on my website?
  • What is the average number of pages visitors view while on my website?
  • What type of device do my visitors use?
  • How many visitors make a conversion?
  • Is my website traffic better or worse than the same time last year?
  • What search queries bring visitors to my website?

As you can see, a lot of valuable insights about your business can be gained from Google Analytics and that is only the tip of the iceberg! Considering that Google is one of the world’s most popular search engines, it makes sense to use the analytics tool they provide to optimise your website.

The one drawback is that Google Analytics only starts gathering your data from the day you add it to your website. Therefore, the sooner you set it up the better!


How to set-up Google Analytics on your WordPress website

Step 1: create an account

To add Google Analytics to your website you need to access a piece of code from Google, which you’ll recognise as a line of numbers beginning with the letters UA. To get your hands on this code, you will first need to sign up for a Google Analytics account, which you can do here: Google Analytics. You will need to use a Gmail address to do this, so, if you haven’t already got one, you should set that up first.

Step 2: log into your account and link it to your website

You can access your Google Analytics account here – Google Analytics Sign-in. From there, you will have the option to Start Using Google Analytics. Click on this and you’ll be asked a series of questions about the website you would like to track, such as the name, URL and the time zone you want your reports to be relative to.

Step 3: get your Tracking ID

Once you have filled out all the requested information from the last step, you will be provided with a button which says Get Tracking ID. By clicking this, you will be provided with the code we were referring to earlier. This snippet of code needs to appear on every single page of your website that you want to be tracked.

Step 4: decide how you will add the code to your website

There are a few different ways of adding the code to your website. At MadBit, we manually add the code during development. For web developers, this is a very straightforward process and it avoids the need to use a plugin, which can slow down the overall performance of your website if you end up needing to use a few. However, if you are not a web developer, we would recommend not messing around with the code of your website!

So, if you don’t know how to code, you have two main options:

a) Many premium WordPress themes come with configurable options and there is often a dedicated field for you to paste your Analytics code into. The theme then automatically inserts this into the code of every page.

b) You can use a plugin. There are a number of plugins available to do the job, such as the Google Analytics for WordPress by MonsterInsights plugin or Google Analytics Dashboard for WP by ExactMetrics.

Step 5: if you chose to use a plugin…

Different plugins have different ways of getting you set up with their service. Here are the two primary routes you will come across:

1. Go to the Admin area of your WordPress website, click on the Plugins tab in the sidebar and select the Add new option from the pop-out menu. From there you can search for the plugin by its name and once you have located it, you can click the Activate button. This will cause a new tab to appear on your sidebar from which you can navigate the plugin. From here, you can authenticate access between the plugin and Google Analytics and then insert the Tracking ID code.

2. To use the Google Analytics for WordPress by MonsterInsights plugin, you will need to set up an account with MonsterInsights. Once you have done that, you can download the plugin file directly from their website.

With the zip file downloaded locally, you then go to the Admin section of your WordPress website and select the Plugin tab from the sidebar. From there you can click Upload Plugin and select the zip file from your computer.

A new tab will appear in your sidebar and it will be called Insights. You don’t need to use the Google Analytics Tracking ID code with MonsterInsights, but you do need to authorise access between the plugin and Google Analytics. Click on Insights and the big button that says Authenticate with your Google account will show you what you need to do.

However, if you would still rather enter the Tracking ID code in manually with MonsterInsights, you can do this by selecting on the Click here to authenticate manually link which can be found under the Authenticate with your Google account button.

Rather leave your website in the hands of professional web developers? At MadBit, we design lead generating websites that our customers love. Get in contact today, and we’ll show you how much more your website can do for you!