How do I Setup GA4 for WordPress - Free and Paid Methods

Sep 22, 2023

Reader Disclosure

If you've been wondering how to set up GA4 for WordPress for your company's site, then you're at the right place. In this comprehensive guide, Growth Manager Curt Noble shows you how to get it done quickly, easily, and even for free.

Contents          Toggle

This is not your average GA4 guide or blog. I'm not planning to take the time to explain the basics of what GA4 is, and the reasons it's not a good idea.

I'd like to tell you how to set up GA4, and give you the information you need to get it done in the shortest time possible.

A lot has been said about the process of migrating from Universal Analytics (UA) to GA4. So, for this post, I'll be showing you how to do a fresh install of GA4 on your online business site.

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

click save button

Every Website Has Different GA4 tracking requirements

Every website has unique need for data tracking. And it's unreasonable to cover each and every GA4 tracking case. So, I'm going to stay with the basics as much as possible.

So, if would like to know the number of tacos your customers have eaten just prior to signing in for your Taco Tuesday Premium Recipe Membership... you're at the wrong spot.

Probably not going to outline this data tracking system on this page.

But stick around, because you'll need to start here anyway. The first step is to create your GA4 account with Google and set up the data stream.

It sounds like fun, doesn't it?

is the Best Membership Plugin When it Comes to GA4 reporting

Woman doing GA4 reporting

All the methods shown in this article work with any WordPress website. Let's face it. Certain WordPress plugins and themes just perform better when using GA4. It's the same for membership websites.

One of the main advantages 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 incorporate with.

This means that all the most popular Google Analytics plugins have integrated with . You'll see throughout this guide the ways these integrations can make your life simpler.

This is why I'm going to come right out and say that. If you're not using GA4 on your site  Google Analytics, then you'll need a Google Analytics specialist to completely install GA4 for your WordPress website for membership.

cta character

Start Today!

Get paid to create the content you produce.

How to Set Up Google Analytics GA4 on Your WordPress Membership Website

Follow these steps for how to set up GA4 on WordPress

This guide covers four different methods for how to setup GA4 using WordPressfor your membership website or online business. These methods range anywhere between easyto no cost, with the easymethod requiring a small extra cost.

I'm confident that one of these strategies will work for your situation. All four have the same starting point. And you'll need to start there before doing anything else.

Create an Google Analytics Account

If you're still not signed up for any Google products (like Gmail or Google Drive) or if you'd like to create a new account for Google Analytics You'll have to sign up for your own Google account.

So if you need to create an account, you can create one via the Google Analytics webpage.

Create a new GA4 property

After registering to create an account with your Google Analytics account and logging in, you'll need to set up your GA4 account.

Because a single Google Analytics account can be utilized to analyze and monitor multiple websites, you can create multiple properties here for keeping the data distinct.

When logged into Google Analytics, click on the Admin option in the lower left corner. Click the button make a new property..

Create Property in Google Analytics.

In the Create Property screen, you'll just need to enter a bit of essential information regarding your site. In the Business Objectives options you can select multiple objectives.

These settings determine which reports you'll be able to see in GA4. Do not worry about it. There is always the option to alter the appearance of your GA4 reports through the dashboard at a later time.

Add property details in Google Analytics.

If you are able to access the Data Collection options, choose Webfrom the list. Here you can set up the GA4 Data stream.

The Data Stream is the place where GA4 tracks all the activities which occur on your site.

Input your website's URL and assign your data stream an appropriate name. I would suggest adding "GA4" in the stream's name. This can help you identify it as the GA4 data stream in the future in this tutorial.

Configuring GA4 Events to Collect on WordPress

GA4 collects what are called "default events". You can pick which of these events are important to you.

I suggest selecting the enhanced measurement option. By doing this, GA4 is told GA4 to collect a few other events of a standard nature, including scroll depth, clicks outbound, site search, and more.

If you select the gear icon in the left, you will be able to select and choose which events to follow. It is best to leave them all checked.

You may notice a glaring omission here There's an event to purchase event on the schedule! Weird, right?

More on that later.

Set up data stream in Google Analytics.

Step One is Done!

It wasn't that difficult was it?

So, now you have a fully functional GA4 web property and data stream. However, it's still waiting for the data to come in (kind of like my kid who is sitting at the table and a bowl, waiting for someone to pour the Cap'n Crunch).

Next let's explore four possible methods of getting cereal into the bowl. Errr... I mean to get the GA4 events in the data stream.

Add GA4 to Any WordPress Website

You've got your GA4 data stream configured and ready to receive web-based events. The next step is to include some code in WordPress for sending data to the stream.

I mentioned earlier that there are many ways to do this. It's up to you to figure out which one is most suitable for you based upon your specific situation.

Below are a few points to consider when working out how to determine the optimal way to incorporate GA4 on your WordPress site:

  • Are you comfortable analyzing data within the GA4 report interface?
  • Are you selling subscriptions, courses or downloads via your site?
  • Are you aware of Google Tag Manager?
  • Are you also running paid ads or social traffic that you want to monitor?
  • Have you got affiliate link that you wish to promote?

There's probably more to be thinking about. But this is a good list to start with. Under every one of these four options below, I'll also include situations that illustrate when each method might be appropriate.

So let's get to it!

METHOD #1 Step 1: Adding GA4 on WordPress freewith Google Site Kit plugin

The method you choose to use can be completely free. But it may not be the ideal solution for your WordPress site. This method works on WordPress websites which aren't selling anything.

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

It can also only manage Google instruments and services.

Are you thinking of using it to keep track of affiliate links or the traffic of social media sites like Facebook or Twitter (X) at some point in the future? This is a no-cost method.

If you choose to scale the size of your business, this will make the user with too little. That being said Here are the steps.

Install the Google Site Kit Plugin

Install Google Site Kit plugin.

On the Add Plugins webpage, simply browse for the words Site Kit using Google. Then install and allow the plugin to be activated.

Add plugins in WordPress.

After the plugin has been activated it is time to start the configuration process. The initial step is to connect to the same Google account you used to create the GA4 property in the past.

Connect your GA4 Data Stream to WordPress with Google Site Kit

As I said earlier, you can use Site Kit to connect to various other Google applications and tools. However, this is optional.

Right now, let's just join Google Analytics by selecting it from the drop-down menu to start setup.

Google Site Kit installation screen.

The next step is to choose your account, property, as well as the data stream. You must choose your GA4 data stream you've previously created.

It is also possible to permit Google Site Kit to make the GA4 data stream to you, if you do not have one already. The options are quite limited. So, I would recommend making the data stream separate.

You must activate the option Place the Google Analytics 4 Code here. This is the way GA4 can collect events from analytics on your WordPress website.

Google Site Kit connect service.

That's all there is to it. Google Analytics 4 is now installed on your WordPress site.

Take note of a minor delay in the data collection. This means that you won't get the data you've requested on the GA4 report for many hours.

Check to ensure that GA4 Data is Flowing

Check to be sure that your data flows by viewing GA4's Real Time report in GA4.

Navigate back to the Google Analytics account, and click Reportson from the menu on the left. Then click the Real-Time option..

If you do not see any of the information listed It's likely that there isn't anyone currently visiting your site. That's okay. Just go to your website using a different browser tab.

Sooner or later, you'll see your users session appearing in real time reports.

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

This method of how to add GA4 to WordPress utilizes the no-cost Google Tag Manager (GTM) solution.

While GTM is completely free, it may require an analytics specialist to finish the set-up. So this method works well for people who have previous knowledge of GTM.

GTM allows you to configure your own custom events. And with GA4, you'll have to configure a lot of events in Tag Manager. So, buckle up.

In order to implement the e-commerce tracking feature with GTM in a WordPress membership site You'll likely require extra code. Particularly, you'll need a script that pushes your transaction information into Google Analytics' data layer. Google Analytics data layer.

Understanding the Layer of Data Layer

The data layer is the most important concept when working with GTM and Google Analytics (GA4). It functions as a bridge between your website and GTM.

It also lets you transmit your own information to GA4, Google Ads, and other third-party services.

The main purpose that the data layer serves is isolate the data from the layer of presentation (your information). Therefore, instead of coding data directly in tags or scripts for your site or scripts, you could push the data into your data layer.

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

A Data Layer Can Make your life easier

  • FlexibilityIt is possible to edit, change or erase data with no need to alter the code of your website. This can be particularly useful to marketers who might not be able to access the site's source code.
  • Consistency In centralizedizing your the data into one central location, you ensure consistent data collection across different devices and platforms.
  • enhanced tracking Data Layer lets you use more advanced tracking options, like collecting information from dynamic websites or even single-page apps.
  • Security - By controlling what data goes into the data layer and how that data is accessed, you can ensure that confidential information doesn't accidentally sent to third-party tools.

After you've understood the notion of the data layer now let's install GTM installed!

Install a Google Tag Manager Plugin

There are a number of plugins to add GTM on your WordPress site. As there's an regular GTM implementation that is used by most plugins, they accomplish the same task.

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

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

Configuring the GA4 Tag in Google Tag Manager

Once you have GTM installed and configured, you're ready to start deploying your first tag!

Quick note here: Google recently migrated the old GA4 Configuration Tag into the global Google Tag. Therefore, if you've come across other tutorials mentioning a GA4 Configuration tag inside GTM, it's not in use any more.

Once you sign in into the GTM workspace, click to add a new tag. Give the tag a name in the lower left.

I would suggest using something like "Google Tag for GA4". This will help you keep track of the tag that is controlling the GA4 implementation.

Next, click into then the Tag Configuration section to add a new tag type. There will be a choice for Google Analytics. Then, on the next screen there are a variety of Google Analytics choices. You must choose Google Tag here.

" decoding="async" width="1024" height="453" src="https://nftified.io/content/images/2023/09/google-tag-in-gtm-config-1024x453.png" alt="Google Analytics Tag Configuration Area.">

It will be possible to configure GA4 events in the future. First we need to get Google Analytics to start. Google Analytics code firing.

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

The tag ID is what Google knows where to collect data on your website. Here is how you can locate the GA4 Measurement ID.

Now we need to tell Google Tag Manager where you want this tag to appear on your WordPress website. The GTM container is on every page of your site. Therefore, you may select to include your GA4 tag on every page as well.

In the Triggering panel select the option Initiation - All Pages.

Google tag for GA4 screenshot

Uploading Your GA4 Tag to Your WordPress Membership Site

All you have to do now is to back up your configuration for tags and publish the changes to the container you have created.

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

The moment is now GA4 will be collecting the default event data for your website.

The entire code is in place to push default event data to your data layer.

And the events you configured prior to the GA4 option for data streams are tracked.

However, there's still no ecommerce tracking in place. We'll take care of that...

How do you track your membership's Profits from Sales in GA4

Do you recall all the discussion about the data layer? To track member sales revenue or other ecommerce data, you need to transfer that data to the data layer.

It requires a little extra coding. Also, you'll need to refer to this document. Google Documentation.

There are two parts to this set-up.

First, you'll need to push the transaction details to the data layer upon 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 ] ); 

In the second, you'll have to configure an event tag within GTM to collect and send the transaction data in GA4 reports. Tags set up in GTM is as follows:

  • Make a new tag by using the tag's name 'GA4 Event'.
  • For the event name, enter "purchase".
  • The event's parameters are mapped as the ones 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
  • objects to tems|A|the} Data Layer Variable
  • Set a trigger for this tag to fire on the confirmation page of an order or upon an order is completed successfully.

Isn't There an Easier Way?

Utilizing GTM to include GA4 tracking on an WordPress site can be quite a task.

The method I've described above can provide you with the fundamental tracker of analytics and revenue reporting.

But consider that you'd need to go and configure every other piece of data you'd need to track. Then think about the danger of what might happen if Google "flips its script" on you.

In particular, the switch from GA3 (Universal Analytics) to GA4 resulted in quite a shake-up for owners of websites and marketing.

If you're in charge of the entire monitoring strategy using GTM and GTM, you'll need to pay close attention to any changes. In many companies, it's a full-time position.

Do you think there is an alternative? It is indeed. There are actually two more ways to do all this using premium plugins.

A Cost-Effective Method to Setup GA4 for WordPress Membership Sites and Online Businesses

Phew! It's over! difficult part. If you've read the two previous options in setting up GA4 on WordPress, you might be thinking that this is way above your salary. It's not. These next two options could be referred to as "stupid-easy".

Over the past 10 years, I've been in the field of web analytics.

I've been involved in implementations that range from no-cost Google Analytics Legacy versions, to solutions for enterprise like Web Trends and Omniture SiteCatalyst (both prior to and following that Adobe acquisition).

In fact, I've been working with Customer Data Platform solutions like Tealium for the deployment of analytics codes. I worked on data layers prior to when they became cool.

You can therefore be sure that I am right in my words that the following two plugins provide the best method to install GA4 for WordPress.

Method #3 METHOD #3 "almost free" method to integrate GA4 to WordPress with WPCode Pro

In the time I attended college, I had a discount card called"the "Starving Student Card." This card gave me sweet discounts on Big Juan Burritos at Taco Time. There were other discounts too. But that's not important.

Point is, I should be calling this the "Starving Student" method to add GA4 to your membership site.

This is a great option for budgeting, especially when you're a student at a college with a tight budget. This is how:

Join WPCode Pro and install it. WPCode Pro

WPCode homepage screenshot

There's a version for free as well, called WPCode Lite. But since you're implementing GA4 in a site that is a member-based, you'll need some key features only available in professional.

Specifically, you'll need the Conversion Pixels and advanced eCommerce locationsfeatures.

Plus! There's also the option to use WPCode Pro to add your social media tracking pixels.

There are many millions of WordPress websites that use WPCode. And at 4.9 points, it's quite probably the most highly rated plugin on the market.

WPCode customer rating screenshot

So, as a initial step, to sign up with WPCode Pro. (If you're only looking to set it up on a single website, the Basic Plan includes everything you require for GA4.)

Next, follow the instructions to add and enable the plugin for the WordPress website. WPCode Pro has been integrated with, and will auto-detect your plugin. It is an enormous time-saver.

Configuring WPCode Pro to Implement GA4 on Your WordPress Membership Site

It is not necessary to include additional code or scripts. WPCode Pro will set up and push ecommerce data to the layer of data.

And you won't need to set up anything using Google Tag Manager. In fact, WPCode completely eliminates the necessity to install Google Tag Manager on your WordPress site.

The only thing you need to tell WPCode Pro your GA4 measurement ID (in the blurred-out field below). The program will handle everything else. You must select which types of conversion events you would like to keep track of. I suggest keeping track of all possible occasions.

GA4 set up in WPCode

That's all there is to it. It's done. GA4 to your membership site. Every single signup for your membership is being monitored and all the information is delivered to your GA4 reports.

In the final part of this article, I'll tell the location of your membership conversion data from GA4 reports. But first, I've got one more stupid-easy solution for those of you who are looking for a solution!

METHOD #4 The most efficient cost-effective method of adding solid GA4 tracking to WordPress Membership Sites using MonsterInsights

One caveat to using WPCode (above) one of the disadvantages is that it will send all data to the GA4 account. So, to see your data, you need to login to your GA4 account, then figure out how to navigate the GA4 user interface.

Initial reports have been released. The latest GA4 user interface looks pretty much... garbage, according to people who have used it.

This is the reason why MonsterInsights is my first choice for a full-scale, complete GA4 installation. With MonsterInsights you'll be able to perform the following:

  • Full-scale GA4 tracking and E-commerce and no FOMO about the fact that you are not tracking or tag something you might imagine at a later time
  • See all your data right in your WordPress Admin and you won't have to fumble around the terrible GA4 interface for finding critical insights in your data
  • Link tracking outbound It will be clear the number of people who are visiting the hyperlinks that you have included in your blog content
  • Affiliate link tracking - See which affiliate links are getting the most attention
  • EU compliance integrated You can rest at night without a fear of a major fine from the EU in case you violate data privacy laws
  • Logged-in user tracking Find out the way your members who pay you are using your site differently from the public
  • Author monitoring Track each blog's performance by the author
  • Zero-Code Implementation There are no additional costs for setting up your tracking codes and to set up your event

That's just a quick summary. There are so many features that make it an easy to afford.

Zero-code technology pays its dividends instantly. It doesn't require an analytics engineer or specialist with MonsterInsights.

Register and download MonsterInsights Pro for less than a Chipotle Burrito Every month

And the setup wizard helps make the process of installation quick and simple.

MonsterInsights setup wizard in WordPress

The wizard is thorough, and extremely easy to use. So, I won't cover every step here.

But there's a detailed step-by-step guide for the complete procedure of setting up, in case you're in need of it. Once you've completed the addons step, make sure that you add the MonsterInsights Ecommerce extension.

MonsterInsights recommended addons screen

This is really all there is to the setup.

Your WordPress Membership site should now be all setup and running GA4 tracking. MonsterInsights has created your data layer and all the GA4 events you chose to track in the initial setup.

As I mentioned above, you don't even need to sign in into your GA4 account in order to view the data. MonsterInsights provides your information directly in the admin area of WordPress.

The GA4 Dashboard is accessible within the WordPress Administration

For access to the GA4 information to access your GA4 data in MonsterInsights, you'll see a quick summary in the dashboard widget.

MonsterInsights WordPress admin data screen

You can also access a complete set of data by navigating to the Insights link on your left navigation.

Viewing Your Data in Google Analytics

From all of these choices, among them, MonsterInsights can display the analytics information directly within WordPress. To access the other options, you'll have to sign in to your Google Analytics account and navigate to your GA4 site.

This screenshot is the result of the sandbox environment I was playing around with within this article. This means that there's not any data available to display. If you're looking to jump in GA4 and explore some, I would suggest using GA4 Test Account. GA4 Testing Account.

Final thoughts

Congrats! Congratulations! You've now been granted Google Google Analytics set up on your WordPress website for membership to your online business.

Then you'll be able to understand the people who visit your site and how they're engaging with your content, and how successful your website is to convert visitors into customers.

If you'd like to know more details regarding Google Analytics, we've published an article that explains how you can use Google Analytics to improve the performance of your membership site.

There's also an online course for free at the Google Analytics website for those who really want to maximize the benefits of this service.

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