How to Add Google Analytics 4 to WordPress

How to Add Google Analytics 4 to WordPress (Best Way)

Google Analytics 4 (GA4) is here, and Google is encouraging every user to create a GA4 property. If you’re a WordPress user, that means it’s time to add Google Analytics 4 to WordPress.

In this article, we’ll go over the best (and easiest) way to add Google Analytics 4 to WordPress.

What is Google Analytics 4?

Google Analytics 4 (GA4) is Google’s newest version of Google Analytics. Google Analytics 3 (Universal Analytics) is still supported and won’t be going away any time soon, but Google is urging everyone to at least start up a GA4 property.

It has many of the same features as Universal Analytics, but adds a few extras and is missing some, too.

MonsterInsights is the best WordPress Analytics plugin. Get it for free!

For instance, in Universal Analytics, you have to set up event tracking, like enhanced ecommerce and conversion tracking, using special code (or just by turning it on in MonsterInsights). In Google Analytics 4, however, you can just turn on some built-in event tracking features. However, you’ll probably have a pretty difficult time finding that event data and reading it, unless you’re an Analytics pro.

GA4 is missing some key features, too, like bounce rate and the integration with Google Search Console. That means you can’t see your Search Queries (keywords) right inside Google Analytics, like you can in Universal Analytics.

There’s one even bigger thing that’s missing in GA4: your data. If you’ve been using Universal Analytics and you set up a GA4 property, it won’t have any of your historical data in it. It starts collecting from scratch. Your data will be safe in your Universal Analytics property, but you’d have to switch back and forth to see it there.

Plus, if you’ve been a Google Analytics user for some time, you’ve probably gotten used to how Universal Analytics looks. When you set up a GA4 property, you might be pretty intimidated by how different it looks and how different the navigation is. There’s definitely a learning curve there.

Google Analytics 4 is a powerful tool, but it’s not a beginner-friendly one. Even intermediate users are finding it difficult to learn and navigate.

So, while it’s important to set up a GA4 property to gather data there and be up to date on the future of Analytics, you might want to set up or keep using your Universal Analytics property, too.

The Best Way to Add GA4 to WordPress

If you have a WordPress website and you’re setting up a GA4 property, you’ll want to know how to connect it to your site. The absolute easiest way to do that is with the MonsterInsights Google Analytics plugin. Not only can the plugin connect GA4 to your WordPress website, but it can also provide solutions to many of the drawbacks of using GA4 we went over above.

MonsterInsights is the best Google Analytics plugin for WordPress. It allows you to easily connect your WordPress site with Google Analytics (both Universal Analytics and GA4), so you can view all the data that matters most right in your WordPress dashboard.

MonsterInsights Home Dashboard

Plus, with the click of a button, you can set up sophisticated tracking features such as event tracking, eCommerce tracking, form tracking, custom dimension tracking, outbound link tracking, and more.

Dual Tracking

Want to use GA4, but also want to keep your historical data, the bounce rate metric, and the Search Queries report?

Just use the MonsterInsights dual tracking feature. Connect both your GA4 AND Universal Analytics properties to WordPress to get the best of both versions of Google Analytics, plus all your historical data.

This is the only tool you’ll find that allows you to combine both Google Analytics properties into one dashboard.

Add GA4 to WordPress: Tutorial

Let’s get started. To add Google Analytics 4 to WordPress, follow this step-by-step tutorial. Use the links below to jump to the section you need:

Step 1: Sign In to Google

The first thing you’ll need to do is log in or sign up for a Google account.

To get started, you’ll need to open the Google Analytics website and click the Sign in to Analytics link or Start for free button in the top right corner of the page.

Sign in to Google Analytics

Next, you can log in to your existing Google account if you have one, or click the Create account link to create a new Google account.

Sign In to Your Google Account for Analytics Account

Step 2: Sign Up For Google Analytics

If you don’t have a Google Analytics account yet, click the Start measuring button on the next screen. If you already have an account, skip to Step 3 click start measuring

Next, you’ll need to enter the Account name for your Google Analytics account. You’ll also see different data sharing settings. Make sure you check all the boxes and then click Next.

enter account details and check sharing options

Now, you’ll have to enter the property details of your website. Start by entering a name, selecting a reporting time zone, and choosing your currency.

Next, you can choose from three options:

To set up a GA4 property, enter your property name, then choose your time zone and currency. Click Next.

GA4 property setup example

Fill in the rest of the business information, then scroll down and click Create.

select industry and business size

You may see a popup at this point to accept the Google Analytics Terms of Service. Go ahead and check the checkbox and click I Accept.

Your next step is creating your data stream. Since you’re setting this up for a WordPress website, click the Web button.

GA4 create a data stream

Now, just fill in your website’s URL and name, then click Create stream.

GA4 web stream setup

That’s it! Move on to Step 3.

To set up a Universal Analytics property only, enter your property name and choose your time zone and currency. Then, click the Show advanced options link.

enter property details

After that, enable the Create a Universal Analytics property option.

enable create a universal analytics property

Then, enter the URL of your website and make sure you select the Create a Universal Analytics property only option. This will ensure that you’re able to use other tracking platforms and measure your ad performance accurately.

Click Next when you’re done.

enter website URL

In the next step, you’ll need to enter your business information. For instance, select an industry and size of your business.

After you’re done, click the Create button.

select industry and business size

You may see a popup at this point to accept the Google Analytics Terms of Service. Go ahead and check the checkbox and click I Accept. Once you accept the terms, you’ll be taken to a screen where you can see the Tracking ID and the tracking code for your site.

That’s it! Move on to Step 3.

To set up both GA4 and Universal properties at the same time, enter your property name and choose your time zone and currency. Then, click the Show advanced options link.

enter property details

Toggle on the switch to create a Universal Analytics property. Then, fill in your website’s URL and select the checkbox to create both properties. Click Next.

Create both a GA4 and Universal property

Fill in your business details and click Create. You may see a popup at this point to accept the Google Analytics Terms of Service. Go ahead and check the checkbox and click I Accept.

That’s it! Move on to step 3.

Step 3: Set Up MonsterInsights

Normally, you’d have to insert your Google Analytics tracking code into your WordPress website’s code.

But with MonsterInsights, you don’t need to worry about using any code.

Instead, you can get started by downloading MonsterInsights. To do that, you’ll need to log into your MonsterInsights account and download the plugin zip file.

Once you have the zip file, navigate to the site where you want to install MonsterInsights and go to the WordPress admin dashboard.

Then navigate to Plugins » Add New and click the Upload Plugin button at the top.

Upload Plugin Button in WordPress

On the next screen, you can click the Choose File button to select the zip file you just downloaded. Then click the Install Now button to upload the file and install the plugin on your site.

Install MonsterInsights Google Analytics WordPress Plugin

Once the plugin has been uploaded and installed, you can click the Activate Plugin button to activate it on your site.

Activate MonsterInsights WordPress Plugin

After the plugin is activated, the plugin setup wizard will open to guide you through the setup process step by step.

At first, you’ll see the ‘Welcome to MonsterInsights!’ message and options to choose the category of your website. There’re 3 options: Business website, Publisher (Blog), and eCommerce.

MonsterInsights Setup Wizard - Choose Your Website Category

Select a category that best describes your website, and then click ‘Save and Continue’ button.

If you want to skip the setup wizard, for now, you can click ‘Exit Setup’ button at the top.

In the next screen, you’ll need to connect MonsterInsights plugin to your website by providing your license key.

Enter Your MonsterInsights License Key to Connect with WordPress

You can find your MonsterInsights license key in your email receipt or account area on the plugin website.

Once you enter your license key, it’ll verify your account, and then you can click on the ‘Connect MonsterInsights’ button.

After that, you’ll see an option to connect your Google Analytics with your MonsterInsights account. Select your account to continue authentication.

Choose Your Google Account to Connect with MonsterInsights

Next, you’ll need to allow MonsterInsights the proper permissions.

Allow MonsterInsights to Access Your Google Analytics Data

After that, you’ll need to pick a profile to complete the connection. If you have multiple websites connected to your Google Analytics account, then you’ll need to choose the right website property here.

If you have just a GA4 property, choose that. If you have just a Universal Analytics (UA) property, choose that. If you have both, you can choose either one here. NOTE: If you want to see bounce rate, choose your Universal Analytics property in this step.

Pick Your Google Analytics Property from Analytics Account to Connect with MonsterInsights

Choose your profile, and then click the ‘Complete Connection’ button.

After that, it’ll finalize the authentication process in a few seconds, and then take you back to your MonsterInsights setup page.

Now you can see recommended settings for the Google Analytics plugin.

MonsterInsights GA Plugin Recommended Settings

This page includes some of the most important settings like:

  • Events tracking – Enabled by default.
  • Enhanced Link Attribution – Enabled by default.
  • File Download Tracking – Most used file types (doc,exe,js,pdf,ppt,tgz,zip,xls) added by default.

As you scroll down, you’ll see more settings.

MonsterInsights GA Plugin Recommended Settings -second part

  • Affiliate Link Tracking – It has 2 affiliate link paths added by default, and lets you add more affiliate link paths.
  • Access to MonsterInsights Reports – You can choose who can see the MonsterInsights reports within the plugin.
  • Automatic Plugin Updates – You can enable or disable the option to install updates automatically.

Review and configure these recommended settings, and then click the ‘Save and Continue’ button at the end.

On the next screen, it’ll recommend you to install a couple of addons.

MonsterInsights Plugin Recommended Addons

The MonsterInsights Forms addon helps you to track your form views, submissions, and conversions. MonsterInsights Page Insights is great for tracking the metrics for individual posts/pages as you’re visiting them when logged into WordPress.

In the next step, you’ll see a recommendation for the WPForms plugin. It’s the most beginner-friendly WordPress form plugin created by the same team behind MonsterInsights.

MonsterInsights Recommended Plugin WPForms

Click on the ‘Continue & Install WPForms’ button if you want to use WPForms. Otherwise, you can click ‘Skip this Step’ link.

After that, you’ll see a new screen with this message ‘Awesome, You’re All Set!’. It means the setup process is complete, and you’ve successfully installed Google Analytics in your WordPress site.

Finish MonsterInsights Setup in WordPress to Add Google Analytics

This screen also notifies you about when you can start seeing your website reports. Depending on the size of your website, it can take between a few hours to 24 hours.

Don’t forget to click on the ‘Finish Setup & Exit Wizard’ button.

Step 4: Set up Dual Tracking

Now, you’ll be able to set up dual tracking if you have both a Universal Analytics property and a GA4 property. Setting up dual tracking will bring in all your historical data from Universal Analytics, while giving you the benefits of Google Analytics 4.

On the main Settings page, scroll down to Google Authentication and find the Dual Tracking Profile box. Here, you can input either your Universal Analytics Tracking ID or your GA4 Measurement ID, whichever one you didn’t authenticate with in the setup wizard.

Remember, if you want to see your bounce rate metric, you’ll need to authenticate with Universal Analytics. You can then add your GA4 profile via dual tracking.

Dual tracking profile settings

Step 5: Create an API Secret

If you’re using Google Analytics 4 either as your main or dual tracking profile, you need to create an API secret for some of MonsterInsights’ tracking features to work.

To create an API secret, open Google Analytics and navigate to Admin.

GA4 Admin

Now, under the Property column, click into Data Streams and open the data stream connected to MonsterInsights.

GA4 Data Stream

Next, scroll down to find Measurement Protocol API secrets. Click into it.

GA4 Data Stream Additional Settings

Here you can Create a new API secret and give it a nickname.

GA4 create API

Now that your new API secret is created, make sure to copy the Secret Value.

GA4 copy secret value

Finally, in your WordPress admin, go to Insights » Settings. Within the Google Authentication section, you’ll find the Measurement Protocol API Secret field. Paste your Secret Value here and the settings will automatically save.

That’s it! You’ve successfully added Google Analytics 4 to WordPress.

Looking for some ideas for what you can do with Google Analytics? Read 7 Types of Google Analytics Reports to Grow Your Business.

And don’t forget to follow us on Twitter, Facebook and YouTube for more helpful Google Analytics tips.

Want to Try MonsterInsights for Free?

Enter the URL of Your WordPress website to install MonsterInsights Lite.

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

This form is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.