Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Cup
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

How to Switch to Google Analytics 4 in WordPress (The RIGHT Way)

Editorial Note: We earn a commission from partner links on WPBeginner. Commissions do not affect our editors' opinions or evaluations. Learn more about Editorial Process.

Are you looking to switch to the latest Google Analytics version?

Google is recommending website owners move to the new Google Analytics 4 because it sunset the previous Universal Analytics on July 1, 2023.

In this article, we will show you how to easily switch to Google Analytics 4 in WordPress.

Switch to Google Analytics 4 in WordPress

Why Switch to Google Analytics 4?

Google Analytics 4 (GA4) is the latest version of Google Analytics. It lets you track your mobile apps and websites in the same account and offers new metrics, reports, and tracking features.

If you haven’t created a GA4 property yet, then now is the best time to switch to the latest version. That’s because Google closed down the old Universal Analytics on July 1, 2023.

What this means is that Universal Analytics will no longer receive and process data from your WordPress website. You can access your past data for now, but it will eventually stop showing old reports by July 2024. That means that all your old analytics data will be lost.

Switching to Google Analytics 4 will protect you from starting from scratch with no historical data. This way, you can future-proof your data while giving yourself plenty of time to learn the new Google Analytics dashboard and features.

That being said, let’s see how you can switch to Google Analytics 4 in WordPress.

Creating a Google Analytics 4 Property

If you already have an existing Google Analytics account using the old version, then you can easily create a new GA4 property and start sending stats to GA4.

First, you will need to visit the Google Analytics website and log in to your account.

After that, head over to the ‘Admin’ settings in the bottom left corner.

Click admin settings

If you are on classic Google Analytics, then you will see the option to set up GA4.

Go ahead and click on ‘GA4 Setup Assistant’ under the Property column.

Click on GA4 setup assistant

In the next step, the setup assistant will give you 2 options. You can create a new Google Analytics 4 property or connect an existing one.

Since we are setting up a new property, simply click the ‘Get Started’ button under the ‘I want to create a new Google Analytics 4 property’ option.

Create a new GA4 property

A popup will now appear with the details about the setup wizard.

If you’ve implemented your Universal Analytics using the Global Site Tag (gtag.js) code, then you’ll see an option to Enable data collection using existing tags.

This uses the existing tracking code on your site to collect information. That said, if you don’t already have the right tracking code on your website, then we will show you how to add it to your WordPress blog below.

For now, you can go ahead and click the ‘Create property’ button.

Click the create property button

The setup wizard will add a new GA4 property and copy the Universal Analytics property name, website URL, timezone, and currency settings.

You can now view your new Google Analytics 4 property in the GA4 Setup Assistant.

Click go to your property button

Next, you’ll need to click on the ‘Go to your GA4 property’ button to see your Google Analytics tracking code.

From here, you can click on the ‘Collect website and app data’ option and select the ‘Manage data streams’ option.

Open manage data streams

You should now see your new GA4 property under Data Streams.

Go ahead and click on your new property.

Select your data stream

A new window will slide in from the right, and you’ll be able to see your web stream details.

Note: Google Analytics 4 uses both ‘data stream’ and ‘web stream’. These both simply mean the flow of analytics data that Google Analytics receives from your website.

Simply click the ‘View tag instructions’ button at the top.

View stream ID and measurement ID

Next, you’ll see different ways to connect your WordPress site with Google Analytics.

For instance, Google Analytics can connect with a website builder or a WordPress plugin.

View Analytics installation instructions

You can also manually add the tracking code to your site.

Simply switch to the ‘Install manually’ tab to view the code.

Install GA code manually

One thing you need to know is that Google Analytics 4 reports are quite different than what you are used to in Universal Analytics.

They have introduced new terminology, and many familiar metrics and reports are missing completely. Basically, if you were using common reports like the Top Landing Pages report or others, then you would have to recreate those from scratch in Google Analytics 4.

That’s why we recommend using MonsterInsights Pro or even the free version of MonsterInsights.

It will help you see all the familiar analytics reports right in your WordPress dashboard and make it easier to find the data you need for decision-making.

Not to mention, with MonsterInsights, you get all the powerful tracking features such as outbound link tracking, author tracking, and more, which can be enabled without writing any code.

For more information, you can see our complete MonsterInsights review.

Let’s take a look at how to easily set up Google Analytics 4 on your WordPress site with MonsterInsights.

Adding Google Analytics Tracking Code to WordPress Site

The best way to add Google Analytics tracking code to your WordPress website is by using MonsterInsights. This is the plugin that we use on WPBeginner.

MonsterInsights is the best Analytics solution for WordPress, and it’s trusted by over 3 million websites because it lets you easily set up advanced tracking without any coding skills.

You can use the MonsterInsights Lite version to set up Google Analytics in no time. There are also premium MonsterInsights plans that offer more features like custom dashboard reports, email summaries, scroll tracking, eCommerce tracking, premium integrations, and more.

First, you’ll need to install and activate the MonsterInsights plugin. For more details, please see our guide on how to install a WordPress plugin.

Upon activation, you’ll be taken to the MonsterInsights welcome screen in your WordPress dashboard. Simply click the ‘Launch the Wizard’ button to add Google Analytics to your site.

Launch setup wizard

After clicking the button, the setup wizard will ask you to choose a category that best describes your website.

You can choose from a business website, publisher (blog), or online store. Once you’ve selected a category, click the ‘Save and Continue’ button.

The MonsterInsights setup wizard

In the next step, you’ll need to connect MonsterInsights with your WordPress site.

Go ahead and click the ‘Connect MonsterInsights’ button.

Connect MonsterInsights with your site

Once you click the button, you’ll need to sign in to your Google Account.

Simply select your account and click the ‘Next’ button.

Choose Google account to sign in

Next, MonsterInsights will require access to your Google Analytics Account.

MonsterInsights App needs these permissions so it can help you set up analytics properly and show you all the relevant stats right inside your WordPress dashboard.

You can click the ‘Allow’ button to continue.

Allow access to your Google account

After that, you’ll be redirected back to the MonsterInsights setup wizard.

To complete the connection, select your Google Analytics 4 property from the dropdown menu and click the ‘Complete Connection’ button.

Select your GA4 property

Next, MonsterInsights will connect Google Analytics with your WordPress website.

On the next screen, you’ll see some recommended settings like file download tracking and affiliate link tracking.

You can use the default settings in the setup wizard. However, if you are using an affiliate link plugin, then you’ll need to enter the path you use to cloak the affiliate links.

Recommended settings

Next, you can scroll down and select who can see reports and add different WordPress user roles.

Once you are done, click the ‘Save and continue’ button.

Who can see the reports

After that, MonsterInsights will show different tracking features that you can enable for your website.

You can scroll down and click the ‘Skip for Now’ button.

Choose which tracking features to enable

Next, you’ll see a checklist showing that you’ve successfully connected Google Analytics to your website.

For example, it will show that you are successfully connected to Google Analytics, the tracking code is properly installed, and the data is being collected.

Tracking should be all setup

Next, you’ll need to scroll down and enter your license key.

For this tutorial, we will simply click the ‘Complete Setup without Upgrading’ option.

Continue setup without upgrading

That’s it. You’ve added Google Analytics 4 property to your WordPress site.

You can learn more by following our guide on how to install Google Analytics in WordPress.

To see how your website is performing, simply go to Insights » Reports. Here, you’ll find all the data you need to make the right decisions to grow your website.

Dashboard reports

You can learn more about different reports by following our guide on how to add a stats dashboard in WordPress.

We hope this article helped you learn how to switch to Google Analytics 4 in WordPress. You may also want to see our ultimate WordPress SEO guide to improve your ranking or our comparison of the best email marketing services for small businesses.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us. Here's our editorial process.

Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit - a collection of WordPress related products and resources that every professional should have!

Reader Interactions

6 CommentsLeave a Reply

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. Jac says

    Hello,
    I have a WordPress site and I have connected Google Analytics 4 with MonsterInsights (free version). I am replacing one of my pages with another page by changing the slug to match the original page. Will GA4 recognize that slug and keep any visitor info from the previous version of the page, or will it reset as if it were a new page?
    Thanks :)

    • WPBeginner Support says

      If the URL is the same then Google will consider them the same page. The page with the changed URL would need a 301 redirect from the old URL to the new URL if you wanted Google to consider them the same.

      Admin

  3. Heidi says

    I think Google is not tracking using Universal Analytics anymore… is this correct? Then if we follow these instructions, we should ignore anything having to do with Universal Analytics, right?

    • WPBeginner Support says

      With Universal Analytics closed, you would not need to set up anything for Universal Analytics :)

      Admin

Leave A Reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

WPBeginner Assistant
How can I help you?

By chatting, you consent to this chat being stored according to our privacy policy and your email will be added to receive weekly WordPress tutorials from WPBeginner.