How to Add Google Analytics 4 to WordPress Website?

Follow this step-by-step guide to easily add google analytics 4 to your WordPress website and start tracking your website’s performance.


How to Add Google Analytics 4 to WordPress

It’s been almost a year since Google Analytics 4 has been introduced. With the recent ceasing of Universal Analytics, website owners have no choice but to shift to GA4, and why won’t they do it? GA4 is way better than Universal Analytics in every aspect.

In case you are not using GA4 and don’t know how to add it to your website, then scroll down! We will show you how to add Google Analytics 4 to a WordPress website in 3 steps!

What Is Google Analytics 4?

Google Analytics 4 (GA4) is a new analytics platform from Google that provides a single view of user behavior across websites and apps. It is designed to help businesses understand their customers better and make more informed decisions about their marketing and product development efforts.

GA4 is a significant upgrade from Universal Analytics (UA), the previous version of Google Analytics. It uses an event-based data model instead of a session-based model, which gives businesses more flexibility in how they track and measure user behavior. GA4 also includes a number of new features, such as:

  • Cross-platform tracking: GA4 can track users across websites and apps, giving businesses a complete view of their customer journey.
  • Predictive analytics: GA4 uses machine learning to provide insights into future customer behavior, such as which customers are likely to churn or make a purchase.
  • Privacy-focused design: GA4 is designed to help businesses comply with evolving privacy regulations, such as GDPR.

Here’s how GA4 can benefit you and your business-

  • Unified customer view: GA4 tracks users across websites and apps for a comprehensive customer journey understanding.
  • Improved customer experience: Identify areas for enhancement by analyzing customer interactions with your brand.
  • Predictive analytics: Analyze future behavior of customers to inform marketing and product decisions.
  • Privacy compliance: GA4 includes cookieless measurement and behavioral modeling to adhere to privacy regulations like GDPR.

If you want to know more about  Google Analytics 4, you can check out the Google Analytics 4 documentation:

How to Add Google Analytics 4 to WordPress Website

Adding Google Analytics 4 to WordPress sites is a breeze. In fact, it only takes 3 steps to add GA4 to WP sites. Let’s see what the steps are-

Step One: Create a Google Analytics Account

The first step to add GA4 to WordPress is to open a Google Analytics account. If you already have an account, you can skip this step and go here.

  • To open a Google Analytics account, you need to go to:
  • Click on the “Start Measuring” button to start.
  • Provide your account name, then click next.
  • Then, create your Google Analytics property by giving it a name. Also, set your time and currency.

To keep track of when people visit your site accurately, you need to set a time zone and currency for your website’s data. This helps you see when visitors are coming, no matter where they are.

  • If you pick a time zone that follows Daylight Savings Time, your data will automatically adjust for those time changes. If you don’t want to deal with these time changes, you can choose Greenwich Mean Time (GMT).

Click next when you are finished.

  • In the next step, tell GA4 about your business a bit more, like your business industry and your business size. When you are done, click next.
  • Going forward, tell GA4 about your business objective.
  • When you’re done, click on the Create button. Then, “Google Analytics Terms of Service Agreement” will pop up. Check the box that says, “I also accept the Data Processing Terms as required by GDPR.” and click “I Accept.”

Now, you have created a Google Analytics 4 account and a property. 

Add a New Property With an Existing GA Account

If you already have an account, you will have to create a new property. For that, go to your Google Analytics account, and click on admin, which is in the bottom-left corner.

After clicking on it, you will find the option to add a new property. 

Step Two: Set Up a Data Stream

After creating your Google Analytics 4 account, you will be left with these options:

Since you want to add GA4 to your WordPress website, you need to select “Web”.

Once you do, this window will open asking you to provide your website URL and a name for your stream. Provide the necessary information and click on Create Stream.

Next, you will see this window. You should notice the warning message on top:

Data collection isn’t active for your website. If you installed tags more than 48 hours ago, make sure they are set up correctly.

This means you will need to add a Google tag to your website. 

Step Three: Add a Google Tag

There are two ways you can add a Google tag to your website.

  1. By using a plugin in your WordPress website.
  2. Adding the Google tag manually.

How to Add Google Analytics 4 to WordPress With Plugin

The best plugin you can use to add GA4 to your WordPress website is by using the “Site Kit by Google”.

To add it to your WordPress website-

  • Go to your Dashboard.
  • Click on Plugins > Add New
  • Find the search bar on the top right. Search for “Site Kit by Google”. The plugin should appear as the first result.
  • Click on the “Install now” button. It will take a few seconds to install. Then, when it’s finished, click on “Activate”.
  • As soon as it has been activated, go to Dashboard again and then click on Site Kit.
  • Click on “Sign In with Google”, then you will have to select the Google Account you wish to continue with. 
  • Upon doing so, the Site Kit will ask for the following accesses:
  • You need to provide it with the necessary access, you can also select all.
  • The Site Kit will then verify blog ownership. Simply click Verify to comply.
  • The next steps involve turning on metrics, setting up the search console, and finally setting up Google Analytics.
  • As soon as you click next, Google will require your account name, property name, and data stream. Select them from the dropdown list.
  • When you have done so, click on Configure Analytics. This may take up a few seconds and after that, your Google Analytics 4 will be set up with your WordPress website.

Once you have it all set up, this message will appear confirming that the setup process has been completed.

How To Add Google Analytics 4 to WordPress Without Plugin

Now, if you do not fancy plugins, you can also add GA4 to WordPress manually. To do that, follow these steps-

  • Go to your Google Analytics account and click on the data stream that you have added. 
  • After doing so, this window will pop up-
  • Click on the View Tag Instructions button. The instructions for “Install with a website builder or CMS” and “Install manually” will appear. Select the tab named “Install manually.”
  • You can see the code for Google tag. All you have to do is copy this code and paste it into your WordPress website’s header.php file.
  • Go to your site’s dashboard. From there click on Appearance > Theme File Editor.
  • From the list on the right side, find header.php.
  • After pasting the code, click on Update File to save changes. 

With this, Google Analytics 4 has been added to your WordPress website. It may take up to 48 hours to start working. So, wait 48 hours to take advantage of it.

If GA4 is still not working after 48 hours, recheck the whole process to see if you made any mistakes.

Step Four: Confirm If the Integration Was Successful

After waiting for 48 hours, it’s time we check if the setup was successful. Go to your Google Analytics account, and from there go to Reports > Real Time.

  • Now, paste the tracking code that you copied here before the </head> tag.

If you have linked Google Analytics 4 to your WordPress website successfully, you can see your site’s historical data there.


So, in summary, knowing how to add Google Analytics 4 to a WordPress website is crucial. GA4 will help with providing accurate site data that will help you determine your course of action regarding your business.

Share This Story, Choose Your Platform!

Leave a comment

Your email address will not be published. Required fields are marked *

Related Best Posts

Get the latest news from Riovizual in your inbox.

Your information will be used in accordance with Riovizual’s privacy policy.

Start Building WordPress Table Now

Instead of writing custom code, create feature-rich WordPress tables in minutes with RioVizual Gutenberg table plugin