How to Setup GA4 for WordPress - Free and Paid Methods

Sep 22, 2023

Reader Disclosure

If you've ever wondered how to setup GA4 for WordPress for your company's website, then you're in the right spot. In this thorough guide, the Growth Manager Curt Noble demonstrates how you can do it fast, painless even free.

Contents          Toggle

This is not your average GA4 blog post or guide. I'm not going to spend a lot of time explaining what GA4 is and why it's not a good idea.

I'd like to tell you setup GA4 and provide you with all of the info you need to get it done in the shortest time possible.

A lot has been said about migrating away from Universal Analytics (UA) to GA4. In this article I'll demonstrate how to do a fresh install of GA4 for your web-based company website.

So, if you're just getting started with WordPress and you're looking to monitor your visitors' and the performance of your site, bookmark this blog post.

click save button

Each Website has its own GA4 Monitoring Needs

Every website has unique data tracking needs. Also, it's impossible to tackle every single GA4 tracking scenario. So, I'm going to keep to the basic, in the greatest extent possible.

This means that if you want to know how many tacos your customers have eaten just prior to signing in for your Taco Tuesday Premium Recipe Membership... you're in the wrong place.

We probably won't be describing the solution to track data on this page.

But stick around, because you'll have to begin here in the end. Your first task is to set up an GA4 account with Google and configure your data streaming.

Sounds fun, right?

Is the best Membership plugin When it Comes to GA4 reporting

Woman doing GA4 reporting

The methods described in this tutorial work on any WordPress website. But let's face it. There are some WordPress plugins and themes just are better suited to GA4. And this is the case with membership sites.

The main benefit of integrating GA4 GA4 is its flexibility as well as the hooks that are available, along with API access. GA4 is the most simple Membership plugin to integrate with.

All the most popular Google Analytics plugins have integrated with . In this article, you'll learn the ways these integrations can make the life of users easier.

Therefore, let me be honest and admit it. If you aren't using  GA4, you'll likely require a Google Analytics specialist to completely set up GA4 for your WordPress membership site.

cta character

Start Now!

Begin to earn money for the content you create.

How do you set up Google Analytics GA4 on Your WordPress Membership Website

Follow these steps for how to set up GA4 on WordPress

This article outlines four distinct methods for how to setup GA4 in WordPressfor your website for membership or online business. The methods vary from straightforwardto free and include the easymethod that requires a minimal fee.

I'm sure that any of these four methods can be used for you. All four have the same initial step. You'll have to begin from there prior to doing anything else.

Create an Google Analytics Account

If you're not signed up for any Google service (like Gmail or Google Drive) or want to use a separate account with Google Analytics, you'll first need to create an account with Google. Google account.

If you're looking to make an account, you can create one on the Google Analytics webpage.

Create a new GA4 property

Once you've registered to create an account with your Google Analytics account and logging into your account, you'll be required to set up your GA4 account.

Since one Google Analytics account can be utilized to analyze and monitor different websites, you are able to set up multiple properties to separate the information.

If you are you're logged into Google Analytics, click on the Admin item in the bottom left corner. After that, click on the button to create a property.

Create Property in Google Analytics.

In the Create Property screen on the Create Property screen, all you have to do is enter a bit of essential information regarding your site. Within the Business Objectives options you can choose multiple goals.

These settings decide which reports will be available out of the box in GA4. But don't fret. There is always the option to alter the appearance of your GA4 reports using the GUI at a later time.

Add property details in Google Analytics.

Once you've reached the Data Collection options, choose Webfrom the list. Here you can set up the GA4 Data Stream.

The Data stream is where GA4 collects all the events which occur on your site.

Input your website's URL and assign your data stream a name. I suggest including "GA4" in the stream's name. This can help you determine it is GA4. GA4 data stream later in this article.

Configuring GA4 Events to be Collecting on WordPress

GA4 collects what are called default events. And you can choose which of these events are most important to you.

I suggest selecting the enhanced measurement option. Doing so tells GA4 to gather a couple of additional events that are standard, such as scroll depth, outbound clicks website search and much other things.

When you click on the gear icon in the left, you will be able to select and select which events to track. Your best bet is to leave them all checked.

Now, you might find a huge omission There's an event to buy event available! Weird, right?

Further details on that to come.

Set up data stream in Google Analytics.

Step One is Done!

It wasn't that difficult did it?

You now have a fully functional GA4 web property and data stream. It's sitting waiting for the data to come in (kind of like my kid in the dining room with his bowl awaiting someone to pour them the Cap'n Crunch).

Let's now look at four different methods of getting cereal into the bowl. Oh, no... I'm trying to incorporate the GA4 events into the data stream.

Add GA4 to Any WordPress Site

It's all set. You've got your GA4 data stream set up and set to accept website events. You'll need to add some code to WordPress to allow data into the stream.

In the past, I've mentioned that there are numerous options to achieve this. It's up to you to figure out which is the best method to use based upon your specific situation.

Here are a few things to consider when working out how to determine the best way to add GA4 to your WordPress site:

  • How comfortable are you analysing data using the GA4 reporting interface?
  • Do you sell memberships, courses or downloads through your website?
  • Are you acquainted with Google Tag Manager?
  • Do you also have paid ads or social traffic you need to track?
  • Are you a member of an affiliate program? Do you have links that you wish to promote?

There are probably more things to be thinking about. But this is a good starting point. For every one of these four approaches below, I'll also include examples of when each technique could be suitable.

Let's go!

Method 1: Add GA4 on WordPress freewith Google Site Kit plugin

The method you choose to use can be completely cost-free. But it may not be the right choice for your WordPress website. This method works on WordPress membership websites that don't sell anything.

This is because Google Site Kit has a significant limitation in relation to tracking online sales - that is, it doesn't have it.

It can also only manage Google instruments and services.

Think you might want to track affiliate links or traffic from social media sites like Facebook or Twitter (X) sometime in the future? You'll want to skip this free method.

If you choose to scale it will cause you with a lot of limitations. That being said below are the steps to follow.

Install Google Site Kit Plugin

Install Google Site Kit plugin.

On to the Add Plugins webpage, you need to browse for the words Site Kit by Google. After that, install and enable the plugin.

Add plugins in WordPress.

When the plugin is enabled after activation, you are able to begin the setup process. The initial step is to connect to the exact Google account used to create the GA4 property in the past.

Connect your GA4 data stream to WordPress with Google Site Kit

I have mentioned before that you can use Site Kit to connect to other Google products and services. This is however, an option.

Right now, let's just connect Google Analytics by selecting it from the options to start setup.

Google Site Kit installation screen.

You'll then need to select your account, property as well as the data stream. Be sure you select your GA4 data stream you've already created.

It is also possible to permit Google Site Kit to generate the GA4 Data stream for you if you do not have one already. But the options are limited. So, I would recommend configuring the data stream separately.

You must enable the option to Place the Google Analytics 4 Code Here. This is how GA4 will collect analytics events within your WordPress site.

Google Site Kit connect service.

It's that simple. Google Analytics 4 has been installed on your WordPress website.

Take note of a minor delay in data collection. Therefore, you won't be able to see any information on reports for your GA4 accounts for some time.

Verify you are sure that GA4 Data is Flowing

Check to be sure that your data flows through your Real Time report in GA4.

Return to your Google Analytics account, and select Reportson the left navigation menu. Click the Real-Time option..

If you don't see any information here, it's possible that nobody is browsing your website. That's okay. Just go to your website within a new tab in your browser.

Shortly you should see that user session appear in the live reports.

METHOD #2 Method 2: Add GA4 to WordPress membership site with Google Tag Manager for free (kind of)

The next option for how to add GA4 into WordPress uses the free Google Tag Manager (GTM) solution.

Even though GTM is available for free, it may need the assistance of an analytics specialist to finish the installation. This method is suitable for those who have prior knowledge of GTM.

GTM permits you to set the events you want to create your own. In GA4, you'll have to configure a lot of events in Tag Manager. Also, make sure you buckle up.

To implement e-commerce tracker through GTM for a WordPress site for membership, you'll probably need some extra coding. Specifically, you'll need an application that can push your transaction information into Google Analytics' data layer. Google Analytics data layer.

Understanding the Layer of Data Layer

Data layer is the most important notion when you work with GTM and Google Analytics (GA4). It serves as the bridge between your website and GTM.

It also lets you provide custom-designed data to GA4, Google Ads, and various other third-party service providers.

The main purpose for the layer's data is to separate the data from the layer of presentation (your information). Instead of hardcoding the data directly into tags and scripts on your website or scripts, you could transfer the data to the data layer.

Once it is there, GTM can read the data, and utilize it to create triggers, tags, and variables.

A Data Layer Can Make Your Life Easier

  • FlexibilityThe HTML0 flexibility allows you to easily add, modify, or remove data without changing the site's code. This can be particularly useful to those who don't have access directly to a site's source code.
  • Consistency - By centralizing information in one location it ensures consistent data collection across different devices and platforms.
  • enhanced tracking The data layer lets you use more advanced tracking applications, for example collecting information from dynamic websites or single-page applications.
  • Security - By controlling the data that is put into the data layer and the way that it is accessible, you can make sure that confidential information doesn't accidentally transferred to third-party programs.

Now that you've got the idea of data layer let's get GTM set up!

Install a Google Tag Manager Plugin

There are a number of plugins that can be used to add GTM on your WordPress website. Since there is an standard GTM implementation that is used by most plugins, they accomplish the same task.

It turns out that it turns out that the Site Kit from Google plugin can also install the GTM container to suit your needs!

Click on METHOD 1 to learn how you can install this Google Site Kit plugin. You can then select to add Google Tag Manager.

Configuring the GA4 Tag in Google Tag Manager

Once you have GTM installed and set up, you're ready to begin deploying your first GTM tag!

Note: Google recently migrated the old GA4 Configuration Tag into the global Google Tag. If you've noticed other tutorials mentioning the GA4 Configuration tag inside GTM, it's not present any more.

When you sign in into the GTM workspace Click to create a new tag. Give the tag a name in the upper left.

I suggest using an example such as "Google Tag to GA4". This will help you keep track of the tag that is controlling the GA4 implementation.

Then, go to The Tag Configuration tab for the option to add a brand new tag type. You'll see an option for Google Analytics. On the next screen, you'll find a number of Google Analytics options. Make sure you pick Google Tag here.