Adding Google Analytics To Wordpress



To add Google Analytics to WordPress using MonsterInsights plugin, go to Plugins » Add New from your WordPress menu. Search for MonsterInsights and when the plugin shows up, click Install Now then, Activate. Go to Insights » Settings to authenticate your blog with Google Analytics. Click Authenticate with your Google account. Click Connect MonsterInsights. Now, you’ll need to sign in to your Google account. Click the Allow button to add Google Analytics to your WordPress site. The next step is to select your website and click Complete Connection.

Do you want to add Google Analytics to WordPress to grow your traffic?

By using Google Analytics, you’ll gain a deeper understanding of your audience. It’s the best way to get to know your site visitors and give them exactly what they want. That’s why if you want to increase your traffic, you need Google Analytics.

The problem is that it’s not always straightforward to install or use this important tool.

Fortunately, it’s easy to add Google Analytics to WordPress using a plugin.

By the end of this article, you’ll know exactly how to add Google Analytics to your WordPress site with and without a plugin.

Why Add Google Analytics to WordPress

There are several reasons why you should add Google Analytics to your WordPress site.

Google Analytics tracks your website traffic and tells you how people are engaging with your site. You’ll be able to uncover your most popular pages, offers, and traffic sources. Instead of guessing which content and campaigns your audience loves, you can check the stats for yourself.

Using Google Analytics, you can view:

  • Top performing content
  • Biggest referral sources
  • Length of time readers spend on your site
  • Bounce rate

You’ll also be able to learn more about your audience, like where they’re from and the devices they use to browse your site.

This information will guide the choices you make about content and marketing campaigns.

For instance, if you’re a content publisher, you can use the insights to create better content for your readers. As a result, you’ll be able to increase the time people spend on your site and even decrease your bounce rate.

Online store owners can track the point of sale, determine when shoppers abandon their carts, and identify their highest converting pages. This gives you the data you need to improve your checkout process and encourage sales.

As you can see Google Analytics helps you answer so many questions about your audience.

So, you might be wondering how do I add Google Analytics to my WordPress site?

The good news is that it’s incredibly easy to add Google Analytics to your site.

You simply need a Google account and 10 minutes.

Let’s begin.

How to Add Google Analytics to WordPress

Adding Google Analytics to WordPress is quick, simple, and free.

Here are the methods we will use today:

  • Method 1: Connecting to Google Analytics using a reliable tool
  • Method 2: Adding Google Analytics Tracking Code into WordPress theme

Now, the recommended method is adding Google Analytics to WordPress with a tool. That’s because it’s the easiest way, and you won’t have to write any code or worry about editing your WordPress theme.

Before we get into the details, we’ll need to create a Google Analytics account.

If you have already have a Google account, you’ll need to sign in to set up Google Analytics.

Once you’re logged in with your Gmail account, you’ll be able to sign up for Google Analytics.

Now, you will need to provide an account name. This is for internal use. You can add multiple website properties under this account name.

Click the Next button to move to the next step.

Here, you will need to add your property details. This is specific to your website. So enter a name that represents your website or business.

You can select your timezone and then click the Next button once you’ve added your details.

After this, you can select your business information. This will help Google tailor the data according to your business needs.

Now, you’ll need to accept Google’s terms of the agreement. Tick the two checkboxes and then scroll to the bottom to find the ‘I Accept’ button.

Once done, the Google Analytics dashboard will open. Here, you’ll see 3 options to set up a data stream. You’ll need to select the ‘Web’ option.

Next, you can enter your website’s URL and a stream name and then click on the ‘Create Stream’ button.

Google will create a measurement ID and stream ID, along with a tracking code.

You can find this tracking code under the ‘Tagging instructions’ section. You’ll need to open the Global Site Tag tab and then copy this tracking code.

Now, you’ll need to add this tracking code on your WordPress site in order to connect Google Analytics to your website.

It can be quite technical to do so. So we’ll show you two ways to add it to your site, using a plugin and manually entering the code.

Method 1: Installing Google Analytics Plugin on WordPress

We’ll start with the simplest method for adding Google Analytics to WordPress.

For that, we’ll use the MonsterInsights plugin.

MonsterInsights is the best Google Analytics WordPress plugin because it comes with an easy to use dashboard and powerful features.

Adding Google Analytics To Wordpress Sites

Now, we know Google Analytics offers a lot of data. That’s a good thing. But it can be overwhelming to sort through the reports to find meaningful information. With MonsterInsights, you get to view the most important statistics right from your WordPress dashboard.

All you need to do is download the plugin and view your reports from the dashboard.

With MonsterInsights, you get:

  • Access to your analytics right from inside your WordPress dashboard
  • Quick Google Analytics set up without writing any code
  • Easy to understand audience and content reports
Adding Google Analytics To Wordpress

This is why it has more than 2 million active installs and the most popular Google Analytics plugin for WordPress.

One of the best things about the MonsterInsights plugin is that it’s regularly tested and optimized for speed. So it won’t slow down your site which is good for SEO.

Below, we will walk through how to set up MonsterInsights in 5 minutes or less.

Add Google Analytics To Website

First, you need to download and activate the MonsterInsights plugin.

After activating the plugin, you’ll see the Insights tab in your dashboard.

Select it to open up the MonsterInsights dashboard and inside, you’ll see an option to Launch Setup Wizard.

This will start step by step instructions for you to install Google Analytics.

On the next screen, you’ll need to select which category best describes your site.

Google Analytics And Wordpress

After your ‘Save and Continue’, you’ll see a page that lets you instantly Connect MonsterInsights.

You’ll need to sign in to the same Google account that you did earlier when you set up Google Analytics.

Adding Google Analytics To Wordpress

Click the Allow button to add Google Analytics to your WordPress site.

MonsterInsights will fetch your account. All you need to do is to select your website and click the Complete Connection button.

Now, MonsterInsights will do the technical work and add Google Analytics to your WordPress site without any risk.

Keep in mind that it will take some time for Google Analytics to show your statistics.

Once you’re up and running, you can view your data right from your WordPress dashboard.

Method 2: Adding Google Analytics Without a Plugin

The second method is adding your Google Analytics code in WordPress without a plugin.

Bear in mind, you’ll be editing your website theme, and this could break your website. You’ll also need to reenter the tracking whenever you switch themes.

Any misstep here could lead to a blank or malfunctioning site. So before adding the Google Analytics code to your site, it’s a good idea to backup your site.

First, make sure you’ve copied the tracking code in your Google Analytics account.

Now, head over to your WordPress dashboard.

From the dashboard, click Appearance. Next, click Theme Editor. If you don’t see this option, your security plugin or developer may have disabled it for you to secure your site from hackers. You’ll need to contact them to enable it.

Inside the Theme Editor, from the left-hand menu, select Theme Header.

Now, just before the closing head tag, paste the tracking code. Make sure you leave everything else as is.

Exit the editor and that’s it. You’ve added Google Analytics to your site.

Now, you’ll be able to track your site visitors and how they engage with your WordPress site.

We hope you found this article helpful.

Using Google Analytics is one way to turn your website into a business tool. If you’re hungry for more resources on growing your business using your website, check these articles:

There you have practical resources and strategies for using analytics to gain a deeper understanding into your audience. This means you’re one step closer to creating the content and offers they truly want.

On October 14th, 2020, Google released Google Analytics 4, also called GA4. This is being referred to as their “next generation analytics.” You may have previously known it as App > Web property, within your Google Analytics account.

Before you add this new Google Analytics to WordPress, it is important to know how beneficial having analytics on your WordPress site is. Analytical data and traffic numbers coming from your site can give you insights into all sorts of numbers that can be used for marketing, interaction, SEO, social media, and more.

Why Add GA4 to WordPress?

As stated above, the importance of Google Analytics and the data it can provide you can’t be overstated. For that reason, when Google releases big updates or versions of Analytics, it is important to upgrade and give your website all of the latest benefits that come with the update.

For example, the Google Analytics 4 update brought with it 4 really great features that everyone can take advantage of. These include:

  • Smarter Insights
  • Deeper Integration with Google Ads or Adwords
  • Customer-Centric Data Measurement
  • More Data Controls

These are important tools you can take advantage of and really help get your site marketing to the next level.

Today, I am going to show you how to set up Google Analytics 4 in WordPress. Let’s get right to it.

Note: The rest of this tutorial assumes you already have Google Analytics set up on your WordPress website.

Add GA4 to WordPress

Step 1: Go to Your Google Analytics Account

Go ahead and start the process by heading over to the Google Analytics homepage and login with your Google account. This gives you access to your dashboard and we can move forward from there.

Step 2:Create a New Google Analytics 4 Property

Now that you are inside your Analytics dashboard, you want to create a new GA4 property. You can either click on Admin > Create Account, or select an existing account that you want to set up your new property on.

Since this tutorial assumes you already have a Google Analytics account, we are going to simply click on “Create Property” on an existing account.

Step 3: Add All Property Details

Clicking on the “Create Property” button will take you to the Property Details page. Here, you can add all the relevant property information needed.

Go ahead and name your property, report a time zone, and add any other relevant details that are needed. You set this up how you see fit.

When you are finished, click on the “Next” button to move forward. This takes you down to a few more details you may want to add. This includes business size and a couple of other questions. You can fill this out how you see fit.

When you are done, click on the “Create” button at the bottom of the page.

Step 4: Select “Web” Option

At this point, you will be on the “Data Streams” page. You will see that there are three different options available. iOS App, Android App, and Web. Select “Web.”

Step 5: Set Up Web Stream

When you click on the Web option, a screen pops out to allow you to set up your web stream. Go ahead and fill out all the relevant information to create the stream. This includes adding your URL, giving your stream a name, and adding or subtracting any enhanced measurements you want.

Click on the “Create Stream” button when you are finished.

Step 6: Connect Your Existing Analytics Property to GA4

Go back to your existing UA property by clicking on the Admin button and then select your UA Property from the drop-down.

Now, click on the “Tracking Info” option, and in the dropdown menu select “Tracking” code.

On the screen that pops out, copy your tracking code so that you can have it.

Finally, switch back to your new GA4 Property by selecting the new GA4 Property from the drop-down. Then click on the stream you created above, and look for “Connected Site Tags.” Click on it.

Enter or paste the tracking ID that you copied above, give it a nickname, and then click on “Connect.”

Step 7: Install Tracking Code on Your WordPress Website

You have now made it to the last step of the process. You need to install the tracking code on your WordPress site and then you will start receiving all the data and analytics that come with Google Analytics 4.

From your web stream, click on the “Add new on-page Tag” option and Select Global Tag (gtag.js).

Copy the tracking code. Now let’s head to your site and add the code.

Note: In this case, we are using a WordPress website. You can enter the code into the “head” section of your website. Again, you can go straight into the theme options and add the code, or you can do it by using a plugin that gives you easy access to add code to the head. Either way is fine.

Log in to your WordPress admin dashboard and paste the code into the head of your site as described in the note above. Click on the “Save” button to save your code.

You can do this by using a plugin like Insert Header and Footer. This lets you place code directly into those sections of WordPress. Or you can manually place the code into your site files.

That’s it. You should now be running Google Analytics 4 on your site and you will start to see those numbers come through in your Analytics dashboard shortly.

Can I Add GA4 Using a Plugin?

The short answer, yes! There are a number of Google Analytics plugins available and at this point, many of them give you the ability to add Google Analytics 4 tracking options. How you do it will be based on your particular plugin settings.

That being said, there is a Google Analytics plugin I recommend using to do this with.

GA Google Analytics

GA Google Analytics is one of many really great Analytics plugins that allows you to easily integrate Google Analytics into your WordPress website.

To enter and enable Google Analytics 4 using the plugin, simply copy your tracking (measurement) ID and then paste it into the plugin setting that is available called “GA Tracking ID.” Then, select “Global Site Tag” for the plugin setting, “Global Site Tag.”

That’s it. You don’t have to worry about trying to put it in a site head, as the plugin takes care of it for you.

Final Thoughts

Google Analytics 4 update can be viewed as a major update that can impact the life of marketers in several positive ways. You now have the ability to choose when and how to use customer data to optimize ads. You also have the ability to limit data use for the purpose of measurement only.

Overall, if used correctly, you should be able to meet all customer requirements and improve products and overall marketing strategy. If you are a marketer, anything that can be done to make the process easier is always welcomed.

I hope this tutorial was able to show you how easy it is to upgrade your site and add Google Analytics 4 to it. With the above info, you can add this all to your website manually or by using a plugin as described. Good luck with it from here, as you should see results pretty quickly.

Have you already been using GA4 in WordPress? Do you prefer to add it through a plugin instead of manually?

Author: Jeremy Holcombe

Growing up in Hawaii, Jeremy started his freelance writing career doing resumes, business plans, article writing, and everything in between. He now specializes in online marketing and content writing and is part of the Content Marketing Team at GreenGeeks.

Was this article helpful?

Related Articles