where to put google analytics code in wordpress

Where should Google analytics tracking code be placed?

You have your Google analytics code but are not sure where should Google analytics tracking code be placed in your site. In my post, I show you where to put the tracking code on your website. I walk you through each step so that you get it right the first time. I use a free plugin called Monster Insights for my sites. It is so easy to use. The whole process takes just a few minutes.

Let’s begin.

Before we start

In order for you to be able to complete these steps, you must have admin access to your WordPress website and have a Google Analytics account set up for your website.

If you are not sure how to set up a Google Analytics account for your website. Let me know in the comments and I will do another post to show you how to do this.

Log into WordPress

Log in to the WordPress admin of the site you want to add Google Analytics tracking code.

Once you are logged in. Hover your mouse over the word ‘plugins’ in the menu on the left of your screen. A popup menu will appear.

Just like this.

Where to put Google analytics code in WordPress?

Within the new popup menu, you will see ‘Add New’ click on that.

Once you have clicked your screen will look like this.

Where to put Google analytics code in WordPress?

When you see this screen I want you to type ‘Monsterinsights’ into the ‘search plugin’ box on the top right-hand side of your screen.

Where to put Google analytics code in WordPress?

On the top left of this screen, you will see ‘Google Analytics Dashboard Plugin for WordPress by Monsterinsights’. On your screen, it could be in another place but this is the one you need.

To the right of the description, you can see a little box with the words ‘install now’, click on that box once.

After you have clicked your screen will look like this.

Where to put Google analytics code in WordPress?

Now you can see the ‘install now’ has changed to ‘Activate’. Click on ‘Activate’ once.

After you have clicked ‘Activate’ your screen will look like this.

How to activate the Monsterinsights plugin

If you look closely at the menu on the left-hand side of your screen you will now see an Insights option.

Configure the Monster Insights plugin

Put your mouse pointer over the word ‘Insights’ and a small popup menu will appear.

How to configure the Monsterinsights plugin

When you see this popup menu I want you to click on ‘settings’.

After you click on settings you will come to this page.

Where to put Google analytics code in WordPress?

Log into your Google Analytics account

Before we move on to the next step. You need to make sure you are logged into your Google Analytics account.

Open a new window and sign in if you have not done so already.

Once you have signed into your Google Analytics account you can return to the above screen.

On the above screen, you need to click on the blue link that says ‘Authenticate with your Google account’.

Once you have done that you will have a screen tell you that you are being connected and to wait a few seconds.

After a short wait, you will come to this screen.

Choosing an account

Here you need to click on the account that is connected to your Google Analytics account.

The next page will ask your permission to allow access to your Google Analytics account.

Click on the blue ‘Allow’ link.

Allowing access to your account

Once you have click on the ‘Allow’ link you will be asked to select the profile of the website you want to connect to.

Select the correct website profile

If you have multiple sites you will need to select the correct website profile from the drop-down menu.

Connecting your site to Google analytics

Once you have selected the correct website profile then click on ‘Complete Connection’.

You will then be asked to wait a few moments and then you will be taken back to the Monster Insights screen in your WordPress admin.

Connect your site with Google analytics

Once you return to your admin that means that your Google Analytics account is now linked to your website and you can track your visitors.

How long does it take for stats to show up in the Google Analytics dashboard?

You have real-time stats and non-real time stats.

The real-time stats show visitors to your website in real-time. You get to see what pages or posts visitors are looking at and for how long as they are on your website.

Non-real time stats are all the other reports they show you everything about visitors to your website. These stats take from 24 to 48 hours to update. So you are always looking at stats that are about 2 days old.

How to add Google Analytics to your WordPress site video tutorial


Google Analytics code is so easy to implement if you use the Monster Insights plugin. You do not need any technical knowledge at all.

I always use this plugin and have never experienced any problems.

I like things to be easy to understand and implement. This plugin does the job for me and is totally free.

This plugin is constantly updated so you do not have worry about an outdated plugin causing your website to crash.

Once you have set up your Google Analytics, you can monitor traffic to your website. If you would like to check your keyword rankings, I have a great post about that, too. ‘Free and easy way to check your keyword ranking in Google and Bing.

Further reading

If you want to know how to implement Google Analytics code into your website without a plugin then I suggest a post from Monster Insights. They show you the way to add Google Analytics without a plugin.

I have never added Google Analytics code to my websites without a plugin and would recommend you use the plugin if you do not have experience of adding code.

Frequently asked questions

Do you have to pay for Google Analytics?

No, you don’t. Google Analytics is totally free.

I would highly recommend you adding it to your website as early as possible.

You might not have many visitors now and don’t see what benefit you will have from it. But I am sure as your visitor count climbs over time you will find the data you get from it invaluable.

Where do I get my Google Analytics code?

Your personal Google Analytics code can be found from clicking on ‘Admin’ in the bottom left of your Google Analytics dashboard screen.

Once you click on ‘Admin’ you will see another screen with three columns. The middle column ‘Property’ will have a ‘Tracking Info’ option. It the third option from the top. Click on that.

After clicking on ‘Tracking Info’ you will see a ‘tracking code’ option at the top. Click on that and your tracking code will appear in a window on the right side of your screen.

What is the best Google Analytics Plugin for WordPress?

I always use the Monster Insights plugin for all my WordPress websites. I have used it each and every time and have never had a problem with it.

In my opinion, it is the best and easiest plugin to use when you want to implement Google Analytics on your website.

How do I install Google Analytics?

Follow my step by step guide above and you will have Google Analytics code installed on your website in a few minutes.

How delayed is Google Analytics?

The non-real time statistics take from 24 to 48 hours to show up on your report.

I have found my reports to be at least 48 hours behind.


Let me know if you found this post useful.

I would love to get feedback about things that are good and also things you think I should improve.

Do you need me to go into more detail or have I given too much detail?

I look forward to getting some feedback.

What do you do to implement Google Analytics code to your websites?

What do you think of the Monster Insights plugin?

Do you use another plugin?

Sharing is caring!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.