How to Setup GA4 for WordPress - Free and Paid Methods

Sep 22, 2023

Reader Disclosure

If you've been wondering about how to setup GA4 for WordPress on your business's online site, then you're at the right place. This comprehensive guide the Growth Manager Curt Noble will show you how to do it fast, painless and for no cost.

Contents          Toggle

This is not your average GA4 blog post or guide. I'm not going to spend the time to explain the basics of what GA4 is or why it sucks.

I just want to how you setup GA4 as well as provide all the details you require to complete the task in the shortest time possible.

There's been plenty written about the process of migrating away from Universal Analytics (UA) to GA4. This is why, in this blog I'll demonstrate the steps to perform the new installation of GA4 for your web-based business site.

In case you're beginning to learn about WordPress and you're looking to monitor your visitors' and performance metrics, bookmark this post.

click save button

Every Website Has Different GA4 Monitoring Needs

Every site has its own unique data tracking needs. It's not feasible to address each and every GA4 tracking scenario. Therefore, I'm planning to stick to the basics, to the extent that I can.

So, if would like to know the number of tacos customers have consumed before signing to sign up for the Taco Tuesday Premium Recipe Membership... you're in the wrong place.

We probably won't be describing that data tracking solution here.

However, stay with us because you'll have to begin here anyway. First, you need to set up your GA4 account with Google and then set up the data stream.

Sounds fun, right?

The best membership plugin When it Comes to GA4 reporting

Woman doing GA4 reporting

All the methods shown in this tutorial work on any WordPress website. But let's be honest. There are some WordPress themes and plugins perform better when using GA4. And this is the case with membership sites.

The main benefit of the integration with GA4 is its flexibility in terms of hooks available and API access. GA4 is the most simple Membership plugin to integrate with.

All the important Google Analytics plugins have integrated with . You'll see throughout this guide the ways these integrations can make your life easier.

So, I'll just be honest and admit that. If you're not using GA4 on your site  Google Analytics, then you'll need a Google Analytics specialist to completely install GA4 on your WordPress Membership site.

cta character

Start Today!

Get paid to create your content.

How Do You Set Up Google Analytics GA4 on Your WordPress Membership Site

Follow these steps for how to set up GA4 on WordPress

This guide outlines four methods for how to set up GA4 on WordPressfor your membership site or business online. The methods vary between simpleto cost-free and include the easymethod with a minor fee.

I'm confident that one of these strategies will work for your situation. Each of them has the exact first step. And you'll need to start with that first step before you can move on to the next one.

Get an Google Analytics Account

If you're not already registered for one of the Google products (like Gmail or Google Drive) or want to use a separate account to use Google Analytics, you'll first be required to set up your own Google account.

In case you want to create an account then you are able to register for one on the Google Analytics webpage.

Create a New GA4 Property

Once you've registered to create your Google Analytics account and logging in, you'll need to make your GA4 property.

Because a single Google Analytics account can be used to monitor and analyze multiple websites, you can set up multiple properties to separate the information.

When you are logged in to Google Analytics, click on the Admin option in the lower left corner. Then click the button to make a new property..

Create Property in Google Analytics.

In the Create Property screen You'll need to provide some basic info about your website. In the Business Objectives options you can choose several objectives.

These settings decide which reports you'll be able to see within GA4. But don't fret. It is possible to alter the appearance of your GA4 reports through the interface at a later time.

Add property details in Google Analytics.

If you are able to access the Data Collection options, choose Webfrom the options. This is where you'll configure your GA4 Data Stream.

The Data stream is where GA4 collects all the events that happen on your website.

You must enter your website's URL. assign your data stream a name. I suggest including "GA4" in the stream name. This will help you easily determine it is the GA4 data stream later in this guide.

Configuring GA4 Events to be Collecting on WordPress

GA4 gathers so-called default events. And you can choose which of these events are important to you.

I would suggest choosing the Enhanced Measurement option. By doing this, GA4 is told GA4 to record a handful of other events of a standard nature, including scroll depth, outbound clicks, web search, and many others.

When you click on the gear icon on the right, you'll be able to pick and choose which events to track. The best option is to leave them all checked.

Now, you might find a huge omission - there's an event to purchase event available! Weird, right?

We'll talk about that in the near future.

Set up data stream in Google Analytics.

Step One is Done!

This wasn't too difficult, wasn't it?

So, now you have an fully functional GA4 Web property and data stream. But it's just sitting there just waiting for data to move (kind as my son who is sitting at the table with a bowl waiting for someone to pour them the Cap'n Crunch).

Next let's look at four different methods of getting cereal into the bowl. I'm sorry... I mean to get the GA4 events in the data stream.

Making GA4 available to any WordPress Website

Your GA4 data stream set up and ready to receive the events on your website. The next step is to incorporate some code into WordPress to send data to the stream.

I mentioned earlier that there are many options to achieve this. You'll need to decide what is best to use based on your situation.

There are some things to keep in mind when you figure out what is the optimal way to incorporate GA4 on your WordPress website:

  • Are you comfortable analyzing data within the GA4 report interface?
  • Do you sell subscriptions, courses or downloads via your site?
  • Are you familiar with Google Tag Manager?
  • Do you also have advertisements or social networks that you want to monitor?
  • Have you got affiliate link you want to promote?

There's probably more to be thinking about. This is just a great list to start with. For each of the four options that follow, I'll include examples of when each technique might be appropriate.

Now let's move on!

METHOD #1 Method #1: Add GA4 plugin to WordPress for freewith Google Site Kit plugin

This method can be absolutely cost-free. But it may not be the right choice for your WordPress site. This option is suitable for WordPress websites that aren't selling anything.

The reason for this is Google Site Kit has a significant limitation in relation to ecommerce tracking - that is, it does not have it.

It can also only manage Google instruments and services.

Do you think you'll want to monitor affiliate links or the traffic of social networks such as Facebook and Twitter (X) sometime in the future? You'll want to skip this cost-free technique.

When you are deciding to increase your size it will cause you too limited. This being said, here are the steps.

Install the Google Site Kit plugin

Install Google Site Kit plugin.

On the Add Plugins page, simply browse for the words Site Kit on Google. Then install and enable the plugin.

Add plugins in WordPress.

Once the plugin is activated it is time to start the configuration process. The initial step is to connect to the same Google account you have used to register the GA4 property in the past.

Connect Your GA4 Data Stream to WordPress by using Google Site Kit

I have mentioned before that Site Kit can be used Site Kit to connect to other Google products and services. However, this is optional.

Now, let's join Google Analytics by selecting it from the options to start the setup.

Google Site Kit installation screen.

Next you'll need to select your account, property, and data stream. Make sure to pick the GA4 data stream that you've made.

It is also possible to permit Google Site Kit to make a GA4 data stream for you if don't already have one. But the options are limited. So, I would recommend configuring the data stream separately.

Make sure you select the option to place Google Analytics 4 Coding on your site. This is how GA4 will collect analytics events within your WordPress site.

Google Site Kit connect service.

And that's it. Google Analytics 4 is now installed on your WordPress website.

Take note of a minor time delay when data is collected. So, you won't see the data you've requested in your GA4 report for some time.

Validate you are sure that GA4 The data is flowing

It is possible to check sure your data is flowing through your Real Time report in GA4.

Return to the Google Analytics account, and select Reportson in the navigation menu left. Then click Real Time.

If you don't see any information here It's likely that there isn't anyone currently browsing your website. That's okay. Simply visit your site within a new tab in your browser.

In a short time, you will see the user session show up in real time reports.

Method #2 2. Add GA4 on WordPress membership site with Google Tag Manager for free (kind of)

This next method for adding GA4 on to WordPress utilizes the no-cost Google Tag Manager (GTM) solution.

Although GTM is available for free however, it might need the assistance of an analytics specialist to finish the set-up. This method is suitable in those with previous experience with GTM.

GTM permits you to set your own events. And with GA4, you'll have to set up a number of events in Tag Manager. Therefore, put on your seat belts.

In order to implement the e-commerce tracking feature through GTM in the WordPress site for membership You'll likely require additional code. In particular, you'll require the script to push your transaction information into Google Analytics' data layer. Google Analytics data layer.

Understanding the Layer of Data Layer

The layer of data is an essential concept when working in conjunction with GTM as well as Google Analytics (GA4). It functions as the bridge between your website and GTM.

It also lets you provide custom-designed information to GA4, Google Ads, as well as other services from third parties.

The primary function of the data layer is to separate the information from the presentation layer (your content). Therefore, instead of coding data directly in tags or scripts for your site, you can push the data into the data layer.

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

A Data Layer Can Make Your Life Easier

  • FlexibilityIt is possible to change, add or erase data with no need to alter the website's code. This is particularly helpful for marketers who might not have direct access to the source code of a website.
  • Consistency - By centralizing information in one location it ensures consistent data gathering across various tools and platforms.
  • Enhanced Tracking Data Layer allows for more advanced tracking scenarios, such as capturing the data of dynamic websites or applications that are single-page.
  • Security - By controlling what data goes into the data layer and the way that it is accessed, you can ensure that information you aren't knowingly transferred to third-party programs.

After you've understood the notion of the data layer let's get GTM set up!

Install an Google Tag Manager Plugin

There are many plugins that allow you to integrate GTM to your WordPress website. As there's a common GTM implementation that is used by most plugins, they do the same thing.

It turns out that the Site Kit Google plugin can also install a GTM container for you!

Click on METHOD 1 for instructions on the procedure you can download Google Site Kit. Google Site Kit plugin. You can then select to add Google Tag Manager.

Configuring the GA4 Tag in Google Tag Manager

After having GTM set up and configured You're now ready to begin deploying your first GTM tag!

Note: Google recently migrated the old GA4 Configuration Tag to the global Google Tag. So, if you've seen different tutorials that mentioned the GA4 Configuration tag within GTM, it's not present any more.

When you login onto your GTM workspace Click to create an additional tag. Then give the tag a title in the lower left.

I would suggest using the phrase "Google Tag" for GA4". This can help you keep track of the tag that is controlling your GA4 implementation.

After that, you can go into the Tag Configuration tab for the option to add a brand new tag type. Then, you'll be presented with an option to add Google Analytics. On the next screen, you'll see several Google Analytics alternatives. You must pick Google Tag here.

DQSVXMMxoIsAchbzVaYG

You'll configure GA4 events later. The first step is to make sure that Google Analytics to start. Google Analytics code firing.

Once you've added the correct Google Tag, you'll have to input your Google Analytics Measurement ID.

The tag ID determines the way Google can determine where to collect data on your website. Here's how you identify the GA4 Measurement ID.

Now we need to tell Google Tag Manager where you would like this tag to be displayed on your WordPress site. The GTM container appears on each page of your site. Therefore, you may decide to add your GA4 tag on every webpage as well.

In the Triggering panel select the option Initiation All Pages.

Google tag for GA4 screenshot

The GA4 tag you publish to your WordPress Membership Website

The only thing left to do now is to back up your configuration for tags and upload the modifications to the container you have created.

Then, you'll find the Submitbutton located in the upper lefthand area of the GTM Workspace.

Now GA4 has begun collecting event details that are default on your site.

All the necessary code is already in place to push default event data into your data layer.

And the events you configured previously in the GA4 data stream options are being tracked.

However, there's still no tracking of e-commerce in place. Let's fix that...

How Do You Track Your Membership sales revenue in GA4

Remember all that talk about the data layer above? To track member sales revenue or other ecommerce data, you need to push that data into the data layer.

This involves a bit of more code. You'll also need to reference Google Documentation. Google Documentation.

There are two parts to this setup.

The first step is to transfer the details of your transaction to your data layer after an effective sale. Here's an example of code to use for the "purchase" occasion:

window.dataLayer = window.dataLayer || []; window.dataLayer.push( 'event': 'purchase', 'currency': 'USD', // use your currency 'value': 100.00, // total transaction value 'transaction_id': 'T12345', // unique transaction ID 'items': [ // array of purchased item objects  'item_id': 'SKU12345', 'item_name': 'Product Name', 'price': 50.00, 'quantity': 2  // ... other purchased items ] ); 

Second, you'll need create an event tag in GTM for collecting and sending the data from transactions in GA4 reports. The tags that are configured within GTM will look something like:

  • Make a new tag by using the tag's name 'GA4 Event'.
  • For the event name you must enter "purchase".
  • Map the event parameters like before:
  • currency to urrency|A|The} Data Layer Variable
  • value to alue|the|A} Data Layer Variable
  • transactions_id to ransaction_id||A} Data Layer Variable
  • items to tems|A|the} Data Layer Variable
  • Make a trigger to this tag to fire on the order confirmation page or after an order is completed successfully.

Isn't There an Easier Way?

Using GTM to incorporate GA4 tracking to the WordPress website can be quite a task.

The approach I've outlined above would get you the basic analytics tracking and ecommerce reports on sales.

However, you'll need to set up every other data point that needs to be tracked. And then consider the risk of what might happen if Google "flips its script" upon you.

As an example, the transition to GA3 (Universal Analytics) to GA4 caused quite a shake-up for site owners and marketers.

If you're in charge of the entire tracking strategy with GTM, then you've got to be attentive to any changes. In many companies, it's a full-time post.

So, is there an easier way? It is indeed. There are actually two better options for doing this by using premium plugins.

The Most Budget-Friendly Ways to Configure GA4 for WordPress Websites for Membership and Online Business

Phew! We've made it to the hard portion. If you've read through the two previous options in setting the GA4 on WordPress You might be thinking this is a bit above your pay grade. It's not. These next two options could be referred to as "stupid-easy".

More than 10 years have I spent working on web analytics systems.

I've worked on implementations ranging from the free Google Analytics Legacy versions, to more sophisticated solutions such as Web Trends and Omniture SiteCatalyst (both prior to and following an acquisition by Adobe acquisition).

In fact, I've been working with Customer Data Platform solutions like Tealium to implement analytics software. I worked using data layers long before they were cool.

Therefore, you are able to be sure that I am right when I say, these two plugins are the most effective option to use GA4 for WordPress.

Method #3: The "almost free" way to add GA4 to WordPress with WPCode Pro

While I was a student, I had a discount card called the "Starving Student Card." This card gave me sweet discounts for Big Juan Burritos when I went to Taco Time. And I think there are other deals too. However, that's not the point.

It's a good idea to refer to this as"Starting Student. "Starving Student" method to include GA4 on your website for members.

It's totally budget-friendly, even for college students with a tight budget. This is how:

Sign Up For and Install WPCode Pro

WPCode homepage screenshot

There's a version for free also, dubbed WPCode Lite. However, since you're using GA4 for a membership website and you'll require certain key options that only come with pro.

In particular, you'll require the conversion pixels and advanced eCommerce locationsfeatures.

Plus! You'll also be able to utilize WPCode Pro to add your social media tracking pixels.

There are many millions of WordPress websites that use WPCode. With 4.9 points, it's quite possibly the highest rated plugin on the market.

WPCode customer rating screenshot

So, as a first step, go sign up for WPCode Pro. (If you just need to set it up on a single site, the Basic Plan will give you everything you require for GA4.)

Follow the next steps to connect and then activate the plugin on the WordPress website. WPCode Pro has been integrated with the WordPress platform, and it will automatically detect the plugin. This is a major time-saver.

Setting up WPCode Pro to Implement GA4 for Your WordPress Membership Site

There is no need to install any additional scripts or code. WPCode Pro will set up the ecommerce layer and then push data into the layer of data.

You won't have to modify anything within Google Tag Manager. Actually, WPCode completely eliminates the necessity to install Google Tag Manager on your WordPress website.

The only thing you need to tell WPCode Pro your GA4 measurement ID (in the blurred-out field below). The program will handle all the rest. Make sure you select the conversion events you want to track. I suggest keeping track of all open instances.

GA4 set up in WPCode

That's all there is to it. You're done adding GA4 to your site for membership. Your membership sign-ups are being tracked, and the data is being delivered to the GA4 report.

After this article, I'll tell you where to find the information about your members' conversion within GA4 reports. First, let me offer an additional, simple solution to you!

Method 4 is the most flexible and cheapest method to include strong GA4 tracking capabilities to WordPress Membership Websites is to use MonsterInsights

One caveat to using WPCode (above) has to do with the fact that it sends all the data to the GA4 account. Therefore, in order to view the data you have, you will must log into your GA4 account, and then find how to navigate the GA4 user interface.

The first reports are out. The new GA4 user interface is very well... garbage According to the people who have used it.

This is the reason why MonsterInsights is my preferred solution for a complete, full GA4 install. With MonsterInsights you'll be able to accomplish the following tasks, quickly:

  • Fully-scale GA4 tracking, including ecommerce and no FOMO about not tracking or tagging something you might think of in the future.
  • View all your information within your WordPress Administration This means you don't have to fumble around the terrible GA4 user interface to find critical insights in your database
  • Link tracking outbound - You'll know how many visitors are visiting the hyperlinks that you have included in your blog posts
  • Affiliate link tracking Find out what affiliate links get the most attention
  • EU compliance included You can rest at night without a fear of paying a huge fine from the EU in case you violate data privacy laws
  • Tracking of registered users - Analyze how your paying members make use of your site in a different way in comparison to the general population
  • Author monitoring - - Report on every blog's author's performance
  • Zero-Code Implementation No additional cost to set up your tracking code and event setup

This is a brief overview. There are many options that make MonsterInsights an easy and affordable decision.

The zero-code aspect pays its dividends instantly. You don't need an analytics engineer or expert with MonsterInsights.

Sign Up and Install MonsterInsights Pro for less than the cost of a Chipotle Burrito Every Month

And the setup wizard makes the installation process quick and easy.

MonsterInsights setup wizard in WordPress

The wizard is comprehensive, and extremely intuitive. Therefore, I will not cover each step.

But there's an thorough tutorial to the entire procedure of setting up, in case you need it. Once you've completed the Addons section, make sure you download the MonsterInsights eCommerce extension.

MonsterInsights recommended addons screen

This is really all there is to the setup.

Your WordPress Membership website should have been set up and running GA4 tracking. MonsterInsights has built your data layer as well as all the GA4 events you decided to track during the setup process.

In the same way You don't have to login into your GA4 account to see the data. MonsterInsights displays your information right within the admin section of WordPress.

Accessing your GA4 data within the WordPress Administration

To get to your GA4 details within MonsterInsights there's a quick summary in the dashboard widget.

MonsterInsights WordPress admin data screen

And you'll see a full set of data by navigating through Insights. Insights button in the left navigation.

The Viewing of Your Data in Google Analytics

Out of all the options of which there are many, only MonsterInsights displays the analytics information directly within WordPress. For the other options, you'll need to log into your Google Analytics account and navigate to your GA4 site.

This image was the outcome from the sandbox that I played around in within this article. So, there's not any data available to show. If you'd like to dive into GA4 and play around with it for a while, I suggest visiting GA4 Test Account. GA4 test account.

Final Thoughts

Congrats! You've achieved Google Google Analytics set up on your WordPress website for membership to your business online.

Now you can start to gain a greater understanding of your visitors, how they're interacting with your content, and how successful your website is to convert visitors to members.

If you're interested in learning the details about Google Analytics, we've published an article about ways to utilize this service to enhance your site for membership.

There's also a free course that can be found on Google Analytics. Google Analytics website for people who want to make the most of this service.

 Do you have questions about using Google Analytics for your site's membership? If so please, leave an answer in the comments in the box below.