How to Add Google Analytics Code in WordPress

Forrest Pykes Mar 19, 2025

When I started blogging, blog statistics were just to get an idea of how many visitors I had, over time I realized that blog statistics are the key to blog growth.

Whether your blog gets 100 page views per day or 100 million page views per day, you need a statistics program to help you track your blog traffic and analyze it.

Google Analytics is one of the must-have free statistics programs for any blogger. I will not go into detail about the benefits of Google Analytics because I have already covered them here .

In this tutorial, you will learn how to set up your Google Analytics account and add Google Analytics to your WordPress blog.

I have also simplified this guide for non-technical users, so you don’t have to worry about the technical aspects of Google Analytics and WordPress integration.

How to Set Up a Google Analytics Account

Let’s start this guide by setting up a Google Analytics account for your WordPress blog. You can repeat the same process for any website as well.

If you are doing this for the first time for your website, you will need to go to the Google Analytics page and log in with your Google account or create a free account.

When setting up for the first time, you will be asked to add your website details and personal information to get started.

Let me walk you through the process of adding a new website property to your Google Analytics account:

Step 1: Log in and select your account

First, log into  your Google Analytics account and select the website you want to add a new property to.

How to Add Google Analytics Code in WordPress

Then, click Administrator in the left taskbar.

How to Add Google Analytics Code in WordPress

Step 2: Set up new property settings

Click the Create drop-down menu and select Property:

How to Add Google Analytics Code in WordPress

Next, you'll need to enter your site's property details. First, enter a name, select a reporting time zone, and choose a currency.

How to Add Google Analytics Code in WordPress

Step 3: Enter property details

Select your industry category and business size, then click Next .

How to Add Google Analytics Code in WordPress

Finally, select your business goal. We recommend selecting "Other" to get all the standard Google Analytics reports in your account.

How to Add Google Analytics Code in WordPress

Click Create .

Click Get Tracking ID and you will find your Google Analytics tracking code or script.

How to Add Google Analytics Code in WordPress

Depending on how we put the Google Analytics code into WordPress, we might use just the tracking ID or the full script. Basically, this will help us connect WordPress with Google Analytics to track website visitors, among other things.

The next step is to put the Google Analytics code into WordPress

3 Ways to Add Google Analytics to WordPress

There are multiple ways to add Google Analytics (GA) to your blog and you should choose one of the following methods based on the level of your blog. I have listed the different methods based on what I recommend

1. Google Tag Manager:

How to Add Google Analytics Code in WordPress

I have been using Google Tag Manager since 2013 and now it is the only tag manager for all my websites. It is free and with it you can manage all tags for your blog from one place. I recommend GTM to every professional and serious blogger.

It barely takes 5 minutes to set up, and once it’s done, you won’t have to worry about future tag management.

[](http://127.0.0.1:86/google-tag-manager-configuration-tutorial.html)Here is a 5 minute tutorial on integrating GTM on your WordPress blog .

2. Use your WordPress theme:

How to Add Google Analytics Code in WordPress

Many of you may not realize that most WordPress themes have an option to add a header and footer script. You can use this to add the GA tracking code to your WordPress site.

Simply copy the tracking code you got in step 1, then go to theme settings option, find the option to add footer script and paste the code.

It will work seamlessly, and you won’t need to rely on other plugins to accomplish simple tasks. The screenshots above are from the popular Genesis theme framework.

3. Use the Google Analytics for WordPress plugin

How to Add Google Analytics Code in WordPress

There are many Google Analytics WordPress plugins available in the plugin repository . Some of them are free and some are paid.

Monsterinsights’ Google Analytics plugin is the most popular one.

Once you activate the plugin, you will see a pop-up window asking you to allow or disallow tracking, I prefer to select “Do not allow tracking”.

Go to Settings > Google Analytics Configuration Plugin and click Click here to authenticate with Google, or you can choose to enter the UA code manually.

How to Add Google Analytics Code in WordPress

Click Save Settings and you have successfully configured the plugin. If you want to view Google Analytics data in the dashboard, click Insights > Dashboard

How to Add Google Analytics Code in WordPress

Of the three options, I recommend the Google Tag Manager option because it will make your life easier in the long run.

If you are an experienced blogger and need more data, like which category is the most popular.

If you want to know which authors are driving the most page views, then I recommend using the MonsterInsights plugin .

Here are the important GA tutorials for bloggers to advance in this series:

Please let me know which method you used to add Google Analytics to your blog and which other statistical program you use to track blog visitors. Don't forget to share this tutorial with your friends on LinkedIn.

Disclosure: Some of the links in this article contain affiliate links, which means we may earn a commission if you click through to visit us, at no extra cost to you. See how SidelinePlay is funded, why it’s important, and how you can support us.

Was this helpful?

0/400

Get free tips and resources right in your inbox, along with 60,000+ others