How to Setup GA4 for WordPress The GA4 is available for both free and paid Methods

Sep 22, 2023

Reader Disclosure

If you've been wondering how to install GA4 for WordPress on your business's online website, then you're in the right place. This comprehensive guide Growth Manager Curt Noble will show you how you can do it quick, easy and for no cost.

Contents          Toggle

This isn't the typical GA4 guide or blog. We won't spend a the time to explain how GA4 is or why it sucks.

I'd like to tell you set up GA4, and give you all the details you require to do it, as quickly as possible.

Enough has been written on the subject of moving to Universal Analytics (UA) to GA4. In this article I'll show you the steps to perform an fresh install of GA4 for your web-based company website.

If you're only beginning to learn about WordPress and want to keep track of your site visitors and performance metrics, bookmark this post.

click save button

Every website has different GA4 Monitoring Needs

Every website has unique requirements for tracking data. It's not feasible to address each and every GA4 tracking scenario. Thus, I'll stick to the basics, to the extent that I can.

That means, if you are interested in knowing how many tacos they've eaten before signing in for your Taco Tuesday Premium Recipe Membership... you're not in the right place.

Probably not going to outline the solution to track data here.

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

Sounds fun, right?

Is the best Membership plugin when it comes to GA4 Reporting

Woman doing GA4 reporting

Each of the techniques described in this tutorial work on any WordPress site. However, let's face it. Some WordPress plugins and themes just work better with GA4. This is especially the case for membership websites.

One of the main advantages of the integration GA4 GA4 is its flexibility as well as the hooks that are available, along with API access. It's also the easiest membership plugin to integrate with.

All the major Google Analytics plugins have integrated with . In this article, you'll learn how these integrations will make the life of users easier.

Therefore, let me be honest and admit that. If you're not using GA4 on your site  GA4, you'll likely require a Google Analytics specialist to completely set up GA4 on your WordPress membership site.

cta character

Get today!

Get paid to create the content you produce.

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

Follow these steps for how to set up GA4 on WordPress

This article outlines four distinct options for how to setup GA4 using WordPressfor your membership website or business online. The methods vary from easyto free, with the easymethod that requires a minimal fee.

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

Create an Google Analytics Account

If you're still not signed up for any Google service (like Gmail or Google Drive) or want to have a different account with Google Analytics to begin, you'll be required to set up a 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 your Google Analytics account and logging in, you'll have to create your GA4 property.

Since one Google Analytics account can be used to track and analyze several websites, it is possible to create multiple properties here to keep the data separate.

When logged into Google Analytics, click on the Admin option in the lower 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 fill in some essential information about your website. Within the Business Objectives options you can choose several objectives.

The settings you set will determine what reports you'll see out-of-the-box GA4. GA4. But don't fret. It is possible to alter the appearance of your GA4 reports in the interface later.

Add property details in Google Analytics.

When you get to the Data Collection options, choose Webfrom the choices. This is where you'll configure your GA4 Data Stream.

This is where GA4 gathers the information about all events which occur on your site.

Enter your website URL and give your data stream an appropriate name. I recommend including "GA4" within the name of your stream. This can help you determine it is GA4. GA4 data stream later on in this tutorial.

Configuring GA4 Events to Collect on WordPress

GA4 gathers so-called "default events". It is your choice to decide what events are important to you.

I suggest selecting the Enhanced Measurement option. This will tell GA4 to collect a few other events of a standard nature, including scroll depth, outbound clicks site search, and more.

If you click the gear icon in the right you can pick the events you want to follow. It is best to leave them all checked.

You may notice a glaring omission here that there is an event to purchase event on the schedule! Weird, right?

We'll talk about that in the near future.

Set up data stream in Google Analytics.

Step One is completed!

It wasn't that difficult did it?

Now, you've got a fully functioning GA4 website property with a data stream. But it's just sitting there 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).

Then let's take a explore four possible methods to put cereal in the bowl. Errr... I mean get the GA4 events in the data stream.

Adding GA4 to Any WordPress Site

It's all set. You've got your GA4 data stream in place and is ready to be able to get website events. Now you just need to incorporate some code into WordPress to allow data to the stream.

I mentioned earlier that there are a number of ways to do this. And you'll have to determine which is the best method to use based upon your specific situation.

Here are a few things to think about when figuring out how to determine the optimal way to incorporate GA4 on your WordPress website:

  • Are you comfortable analysing data using the GA4 Reporting interface?
  • Are you selling subscriptions, courses, or downloads on your site?
  • Are you aware of Google Tag Manager?
  • Are you also running advertising or social media traffic you need to track?
  • Are you a member of an affiliate program? Do you have links you wish to promote?

There are probably more things to think about here. However, this is an excellent list to start with. Under each of the four approaches that follow, I'll include situations that illustrate when each method might be appropriate.

So let's get to it!

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

This method can be totally free. But it may not be the right choice for your WordPress site. This method works on WordPress membership websites that do not sell products.

This is because Google Site Kit has a important limitation with regards to tracking online sales - that is, it does not have the capability.

And it can only configure Google applications and tools.

Are you thinking of using it to track affiliate links, or even traffic coming from social networks such as Facebook or Twitter (X) at some point in the near future? It's best to avoid this no-cost method.

When you are deciding to increase your size 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 on the Add Plugins Page, simply search for the keywords Site Kit on Google. Install and then enable the plugin.

Add plugins in WordPress.

When the plugin is enabled it is time to start the process of setting it up. The first step requires you to connect to the same Google account that you have used to register the GA4 property previously.

Connect Your GA4 Data Stream to WordPress using Google Site Kit

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

For now, let's connect Google Analytics by selecting it from the list to begin setting up.

Google Site Kit installation screen.

The next step is to choose your account, property, and data stream. Make sure to select GA4 as the GA4 data stream that you've created.

Or you could let Google Site Kit to make an GA4 information stream to you, if you don't already have one. However, the choices aren't endless. So, I would recommend configuring the data stream separately.

Be sure to enable the option to insert Google Analytics 4 Coding on your site. This is how GA4 will record analytics events within your WordPress website.

Google Site Kit connect service.

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

Be aware there's a slight delay in data collection. This means that you won't get any information in the GA4 accounts for many hours.

Verify that GA4 Data is Flowing

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

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

If you don't see any of the information listed, it's possible that no one is currently visiting your site. That's okay. Simply visit your site in another browser tab.

Shortly you should see that user session show up in real time reports.

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

This method of how to integrate GA4 to WordPress uses the free Google Tag Manager (GTM) solution.

Even though GTM is available for free however, it might need the assistance of an expert in analytics to finish the setup. Therefore, this approach is ideal in those with previous experience with GTM.

GTM permits you to set your own events. And with GA4, you'll be required to configure a lot of events using Tag Manager. Therefore, put on your seat belts.

For the implementation of the e-commerce tracking feature through GTM in an WordPress website for members You'll likely require extra coding. Particularly, you'll need a script that pushes your transaction information into the Google Analytics data layer.

Understanding the Layer of Data Layer

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

And it allows you to transmit your own data for GA4, Google Ads, and various other third-party service providers.

The primary function for the layer's data is to separate the data from the layer of presentation (your information). So, instead of hardcoding data directly into tags or scripts for your site or scripts, you could push the data into your data layer.

Then, GTM can read the data, and make use of it in the creation of tags, triggers and variables.

A Data Layer Can Make Your Life Easier

  • FlexibilityIt is possible to edit, change or remove data without changing the site's code. This is especially useful for marketers who might not have access directly to the site's source code.
  • Consistency - By centralizing data in one place it ensures consistent data collection across different devices and platforms.
  • Enhanced Tracking The data layer allows for more advanced tracking scenarios, such as collecting the data of dynamic websites or applications that are single-page.
  • Security - By controlling what data goes to the data layer, and how that data is accessible, you can make sure that sensitive information isn't inadvertently transferred to third-party programs.

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

Install a Google Tag Manager Plugin

There are numerous plugins which allow you to integrate GTM for your WordPress site. Because there's a common GTM implementation the majority of them perform the same function.

In the end, the Site Kit Google plugin will also set up a GTM container to suit your needs!

Scroll up to METHOD #1 to learn the procedure you can install the Google Site Kit plugin. After that, you can select the option to add Google Tag Manager.

Configuring the GA4 Tag in Google Tag Manager

After having GTM set up and configured, you're ready to start deploying your first tag!

Note: Google recently migrated the old GA4 Configuration Tag to the worldwide Google Tag. Therefore, if you've come across others tutorials that mention GA4 Configuration tags GA4 Configuration tag inside GTM, it's not in use anymore.

Once you login onto GTM, once you have logged into your GTM workspace, click to add the tag. Then give the tag a name at the upper left.

It is suggested to use the phrase "Google Tag" for GA4". This can help you keep track of the tag that is controlling the GA4 implementation.

Next, click into then the Tag Configuration tab to add a new type of tag. You'll see an option for Google Analytics. On the next screen, you'll find a number of Google Analytics options. Be sure to choose Google Tag here.

DQSVXMMxoIsAchbzVaYG

It will be possible to configure GA4 events in the future. We first need to have the Google Analytics code firing.

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

The tag ID determines the way Google knows where to collect data on your website. Here is how you can identify your GA4 measurement ID.

We now need to inform Google Tag Manager where you wish this tag to appear on your WordPress website. The GTM container appears on each page of your site. So, here you can decide to add GA4 tags on every page. GA4 tag on every webpage as well.

Within the Triggering Panel, choose the option for Initiation All Pages.

Google tag for GA4 screenshot

Uploading Your GA4 Tag to your WordPress Membership Site

The only thing left to complete is save your tag configuration and upload the modifications to your container.

You'll see an Submitbutton on the upper righthand edge of the GTM Workspace.

Now GA4 will be collecting the event details that are default on your site.

The entire necessary code is already in place to transfer default event information into the data layer.

And the events you configured prior to the GA4 option for data streams are now being monitored.

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

How Do You Track Your Membership Sales Revenue in GA4

Do you recall all the discussion of the layer that stores data above? In order to track membership sales revenues or other e-commerce information, you must integrate that information into your data layer.

It requires a little additional programming. Also, you'll need to reference the Google Documentation.

There are two components to this setup.

First, you'll need to send the transaction information to your data layer after the sale has been successful. Here's a code sample that will trigger the "purchase" instance:

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 inside GTM to collect and send the transaction data in GA4 reports. Tags set up in GTM look like this:

  • Create a tag using the tag's type of 'GA4 Event'.
  • To name the event, enter "purchase".
  • Create the event's parameters as the ones before:
  • currency converts to currency|A|The} Data Layer Variable
  • value to alue|the|A} Data Layer Variable
  • transaction_id to ransaction_id||A} Data Layer Variable
  • Items to tems|A|the} Data Layer Variable
  • Set a trigger for this tag to trigger the page that confirms an order, or after a successful transaction.

Isn't There an Easier Way?

Using GTM to incorporate GA4 tracking on the WordPress site is quite an undertaking.

The approach I've outlined above will give you the basics of tracker of analytics and reports on sales.

However, you'll need to set up every other data point that needs to be tracked. Consider the possibility of what could happen if Google "flips the script" on you.

In particular, the switch to GA3 (Universal Analytics) to GA4 created some confusion for site owners and marketing.

If you're managing the complete tracker's strategy by using GTM You're required to pay very close attention to changes. In many companies, it's a full time position.

So, is there an easier way? The answer is yes. There are actually two better ways to do all this with premium plugins.

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

Phew! We made it through the tough portion. If you've gone through the previous two options to set the GA4 on WordPress, you might be thinking this is above your pay grade. You're right, it's not. Two of the options above are "stupid-easy".

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

I've worked on implementations ranging from free Google Analytics Legacy versions, to solutions for enterprise like Web Trends and Omniture SiteCatalyst (both before and after an acquisition by Adobe deal).

And I've even worked with customer data platform solutions like Tealium for the deployment of analytics codes. I worked on data layers prior to when they got cool.

Therefore, you are able to trust me to say that these two plugins provide the best option to use GA4 in WordPress.

METHOD #3 METHOD #3 "almost free" method of adding GA4 to WordPress with WPCode Pro

While I was a student, I had a discount card called"the "Starving Student Card." The card gave me sweet discounts on Big Juan Burritos at Taco Time. And I think there are other deals too. But that's not important.

It's a good idea to call this"Starting Student. "Starving Student" method to integrate GA4 into your membership site.

It's totally budget-friendly, even for college students with a tight budget. Here's what you do:

Sign Up For and Install WPCode Pro

WPCode homepage screenshot

There's a version for free too, which is called WPCode Lite. However, since you're using GA4 in a site that is a member-based it will require some important functions that are only available to users of the premium.

In particular, you'll require the conversion pixels as well as the Advanced eCommerce Locationsfeatures.

Bonus! It's also possible to use WPCode Pro to add your social media tracking pixels.

There are thousands of WordPress sites that are using WPCode. And at 4.9 points, it's quite probably the most highly rated plugin out there.

WPCode customer rating screenshot

For the first step, go register for WPCode Pro. (If you only need to set it up on a single site, the Basic Plan will give you everything you need for GA4.)

Next, follow the instructions to connect and enable the plugin for the WordPress website. WPCode Pro is integrated with an auto-detect feature for the plugin. This is a major time saver.

Setting up WPCode Pro to Implement GA4 in Your WordPress Membership Website

It is not necessary to include any additional scripts or code. WPCode Pro will set up the ecommerce layer and then push data into Data Layer.

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

The only thing you'll need to tell WPCode Pro your GA4 measurement ID (in the field that is blurred out below). The plugin handles everything else. Be sure to select which event you wish to monitor. I suggest keeping track of all available occasions.

GA4 set up in WPCode

And that's it. It's done. GA4 to your membership site. All your membership signups are being tracked, and all the information is sent to GA4 reports. GA4 reports.

After this article, I'll tell the location of the data on your conversion to a member from GA4 reports. But first, I've got an additional, simple solution to those of you who are looking for a solution!

Method #4 is the most flexible, cheapest way to add strong GA4 tracking capabilities to WordPress Membership sites is using MonsterInsights

One caveat to using WPCode (above) has to do with the fact that it sends all the data directly to your GA4 account. To view the data you have, you will need to login to your GA4 account, then figure out your way around that user interface.

Initial reports have been released. The brand new GA4 user interface looks, well... garbage, according to people who have used it.

That's why MonsterInsights is my top choice for a full-scale, complete GA4 installation. With MonsterInsights you'll have the ability to accomplish the following tasks, quickly:

  • Large-scale GA4 tracking that includes E-commerce - No FOMO over not tracking or tagging something you might consider in the future.
  • View all your information within your WordPress Administration and you won't have to navigate the dreadful GA4 user interface to find critical insights in your database
  • Link tracking outbound You'll be aware of the number of people who are visiting the hyperlinks you include in your blog content
  • Tracking affiliate links - See which affiliate links are getting the most attention
  • EU compliance built-in So you can sleep at night without a fear of a major fine from the EU in case you violate data privacy law
  • Logged-in tracking of users - Analyze the way your members who pay you make use of your site in a different way from the public
  • Author tracking - - Report on every blog's author's performance
  • Zero-Code Implementation There are no additional costs to configure your tracking code and to set up your event

It's a short summary. There are so many features which make using MonsterInsights a simple and cost-effective choice.

Zero-code technology pays for itself instantly. You don't need an engineer in analytics or a specialist to use 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 painless.

MonsterInsights setup wizard in WordPress

The wizard is thorough, and very intuitive. Therefore, I will not cover every step here.

But there's an complete step-by-step guide on the full installation process, should you're in need of it. If you're at the step to add-ons, be sure that you add the MonsterInsights Ecommerce addon.

MonsterInsights recommended addons screen

That's really all there is to it.

Your WordPress Membership website should have been set up and running GA4 monitoring. 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 it isn't necessary access into your GA4 account in order to view your information. MonsterInsights provides your information directly in the admin area of WordPress.

Accessing your GA4 data within the WordPress Administration

To get to your GA4 information in MonsterInsights, you'll see a quick summary in the dashboard widget.

MonsterInsights WordPress admin data screen

You can also access a complete suite of reports by navigating through Insights. Insights link in your left navigation.

Accessing Your Data on Google Analytics

From all of these choices, only MonsterInsights displays the analytics information directly within WordPress. In order to use the other options you'll need to login to the Google Analytics account and navigate to the GA4 site.

This image was the outcome of the sandbox environment I was playing around with within this article. This means that there's not much data to display. If you'd like to dive into GA4 and explore a bit, I recommend accessing the GA4 Testing Account.

Final thoughts

Congrats! You've been granted Google Google Analytics set up on your WordPress membership site for your online business.

Now you can start to understand your audience, how they're interacting with your content, and the effectiveness of your website in converting users into customers.

If you're looking to learn the details about Google Analytics, we've published an article that explains ways to utilize Google Analytics to improve the performance of your site for membership.

Additionally, there's an online course for free at the Google Analytics website for those looking to make the most from this tool.

 Do you have any questions about using Google Analytics for your membership site? If yes, please leave a a comment below.