If you want to accurately track the success of your WordPress website, your first step is to learn how to add Google Analytics to WordPress.
Google Analytics, currently in version GA4, is a powerful tool for making data-driven decisions that are going to help your eCommerce store or publishing site succeed. If you’ve ever been intimidated by Google Analytics in the past, don’t worry! We’re with you every step of the way.
In this article, I’ll show you how to add Google Analytics to your WordPress site.
Here’s an overview of what you’ll learn in this post:
- Why is Google Analytics Important?
- How to Sign Up for Google Analytics
- How to Add Google Analytics to WordPress
Let’s get started.
Why Is Google Analytics Important?
Google Analytics is a free, comprehensive analytics solution for your website.
Understanding your website analytics is key to growing your site’s traffic. That, in turn, leads to increased subscribers and then, to boosting revenue.
With Google Analytics on your website, you’ll be able to track all of the data that you need to get actionable insights to grow your business, eliminating the question of what you should be doing.
With Google Analytics, you can get site statistics like:
- Number of website visitors
- Where visitors are coming from (referral links)
- What content on your site is most popular
- And a ton more
So, why is Google Analytics important?
Here are some of the ways Google Analytics helps improve your business marketing strategy:
- Learn More About Your Visitors: Using Google Analytics for WordPress helps you track and collect information about your visitors. The more data you have, the more you can personalize your content marketing strategy.
- Understand How Visitors Interact With Your Content: Track what your visitors are doing while they’re on your site. You’ll be able to see things like what pages they visit, how long they stay on your website, what pages they stay on the longest, and more.
- Discover How Visitors Find Your Website: Having Google Analytics on WordPress also gives you essential tracking info about how visitors find your site in the first place.
- Troubleshoot When Things Go Wrong: With Google Analytics data at your fingertips, if you notice any abnormalities in traffic or sales, you can fix those problems much faster and reduce unnecessary losses.
The bottom line is that when it comes to digital marketing, knowledge isn’t just power; it’s also profit.
Now let’s turn our attention to how you can sign up for Google Analytics in the first place.
How to Sign Up for Google Analytics
Google Analytics is available for free. All you need is a Google account to sign up. It only takes a few minutes to create a Google Analytics account for your website. Below, I’ll provide step-by-step instructions for getting started with GA4.
Step 1: Sign in to Google Analytics
Visit the Google Analytics website and click the blue Get started today button.
Next, you’ll be prompted to sign in to your Google account. If you don’t already have a Google account, click the Create account link. Otherwise, simply log in.
After you’ve signed into your Google account, click the Start measuring button on the next screen.
Step 2: Create Your Google Analytics Account
At the top of the screen, you’ll see a progress bar with the 5 sections you’ll need to complete. The first is Account creation.
You’ll be creating the account that you’ll use to access Google Analytics. You can monitor multiple websites within a single account.
Under Account details fill out the Account name. This should likely be your business name or perhaps even your own name if you’re an independent contractor. Remember, this is the name of your account, not the individual website or app that you want to monitor.
Next, scroll down to Account Data Sharing Settings. Here, you’ll choose how much data you want to share with Google.
Click the Next button at the bottom of the screen.
Step 3. Create a Property
Now, you’ll create your Google Analytics property. Your property is the website that you want to track with Google Analytics 4.
Enter an identifying name for your website in the Property name field. Then select the timezone you want to use for reporting and your currency.
When you’re finished, click Next.
Step 4: Describe Your Business
Now, you’ll give Google some details about your business. Use the dropdown menu to select an Industry category and select the appropriate Business size. Click Next.
Step 5: Choose Business Objectives
Your next step is to select your primary business objectives. These selections help Google Analytics create more personalized reports.
Click Create. Doing so will trigger a popup with the Google Analytics Terms of Service agreement.
To proceed through the TOS, you’ll need to:
- Click the checkbox beside “I also accept the Data Processing Terms as required by GDPR.”
- Scroll down and click the checkbox beside “I accept the Measurement Controller-Controller Data Protection Terms for the data that I share with Google.”
- Click the I Accept button.
Step 6: Set Up Data Collection
The final step in creating your GA4 account is to set up a data stream.
You can set up multiple data streams within your property. For instance, you might have separate data streams for your website, Android app, and iOS app.
Under Start collecting data, you’ll be prompted to choose a platform. Since we’re focusing on WordPress websites today, choose Web.
Now, you’ll enter your Website URL and choose a Stream name.
When you click the Create & continue button, you’ll see the Google tag code that you’ll need to add to each page of your website.
In the next section of this tutorial, I’ll show you several methods for adding Google Analytics to WordPress. You won’t need this code if you use the first method, which involves installing MonsterInsights. For the other methods, you’ll need to copy this Google Analytics tag and keep it handy.
How to Add Google Analytics to WordPress
There are many ways to add Google Analytics to WordPress. I’m going to show you the 3 easiest ways.
I’ll start with the simplest and most helpful method: using MonsterInsights.
Method 1: Connect to Google Analytics With MonsterInsights (Recommended)
MonsterInsights is the easiest and best way to add Google Analytics to WordPress websites. This premium WordPress plugin not only lets you connect your site to GA4 without any code, but it also lets you track your website data directly from your WordPress dashboard.
GA4 is a complicated beast, but MonsterInsights lets you view easy-to-understand reports without even leaving your WordPress account. You can monitor your site’s performance, user behavior, sales, and more.
You have 2 options to get started with MonsterInsights:
- Choose a premium MonsterInsights plan to unlock the full power of the plugin’s WordPress analytics features. If you’ve never installed a premium plugin, check out these instructions from MonsterInsights.
- Download the free MonsterInsights Lite plugin. However, the tracking options are very limited for the free version. If you’ve never installed a free plugin in WordPress, you can follow MonsterInsights’ instructions here.
Either way, MonsterInsights lets you easily add Google Analytics to your WordPress site, without needing to handle any code.
How to Add Google Analytics to WordPress With MonsterInsights
With MonsterInsights, you don’t have to touch any code to connect your website to GA4. Simply follow these steps.
Step 1: After installing and activating MonsterInsights, click Insights in the left menu in your WordPress dashboard. This will take you to your MonsterInsights settings. Click Launch Setup Wizard.
Step 2. Select your website category and click Save and Continue.
If you’ve purchased a paid plan, you’ll then be prompted to enter your License Key. If you’ve already entered your key or are using the free plugin, you won’t need to.
Step 3: Connect MonsterInsight to your Google account.
First, click Connect MonsterInsights.
You’ll see an Authorizing message for a few moments before you see a message prompting you to connect MonsterInsights to your Google Analytics account. Click Continue & Connect to Google.
Next, sign in to the Google account that you used to set up your Google Analytics account.
After signing in, you’ll be prompted to allow MonsterInsights to access your Google account.
Step 4: Connect Google Analytics to your website.
Because you’ve already set up your Google Analytics account and property, you’re just a couple of clicks away from connecting your WordPress site to GA4.
Use the dropdown menu to select the Property name for your website, and click Complete Connection.
And that’s it! The rest of the MonsterInsights setup wizard involves recommended settings and enabling various features. But once you’ve clicked Complete Connection, you’ve successfully connected Google Analytics with your WordPress site. You’ll be able to track your site’s analytics with MonsterInsights in your WordPress dashboard, and you’ll also be able to run full reports and explorations in GA4.
Method 2: Add the Google Analytics Tag Using the WPCode Plugin
Here’s how to add Google Analytics by adding the code to your site’s header using the WPCode plugin (formerly known as Insert Headers and Footers by WPBeginner).
Note that this method does not allow advanced tracking configurations. You also won’t be able to view Google Analytics data in your WordPress dashboard, as you can with MonsterInsights.
Step 1: Install and activate WPCode. Click Plugins > Add New Plugin, and search for “WPCode” in the search box. Click Install Now beside WPCode in the search results.
After a few seconds, the Install Now button will change to say Activate. Click Activate.
Step 2: Add your Google Analytics tag to your header.
After installing and activating the plugin, click Code Snippets > Header & Footer in the left menu. You can now paste the code that you copied when you set up your Google Analytics property. Click Save Changes.
Method 3: Add Your Google Analytics Tag in WordPress Theme Settings
Another way to add Google Analytics to WordPress is to paste your tag into the <head> code in your WordPress theme’s settings.
This may sound complicated, but most themes make it pretty easy.
For instance, Divi users can add their Google Analytics tag in just a few clicks.
All you need to do is click Divi > Theme Options in the left panel of your WordPress dashboard. Then select the Integration tab.
You’ll see an option to Add code to the <head> of your blog. Simply paste your Google Analytics tag into that code field.
Now, you’ll be able to track your website data in GA4.
Note: If you’re confident in your knowledge of PHP, you can add your Google Analytics tag code to your site’s header.php or functions.php file. However, this method can be risky, and you’ll lose your tag anytime you update your WordPress theme. I highly recommend using a plugin like MonsterInsights or WPCode, or I recommend editing the <head> code in your theme settings as a secondary option.
Grow Your WordPress Website With Google Analytics
Whichever method you choose, you’ll now be able to track the performance of your WordPress website in Google Analytics.
With MonsterInsights, you don’t have to worry about learning all of the complicated reporting in GA4. Instead, you’ll be able to view reports and data right in your WordPress dashboard!
By tracking your website’s performance, you can work toward increasing your traffic. Want to convert those visitors into subscribers and customers? OptinMonster’s popups, floating bars, and other onsite campaigns help you grow your email list and make more sales!
Related Resources:
Add a Comment