How do I Setup GA4 for WordPress (Free and Paid) Methods

Sep 22, 2023

Reader Disclosure

If you've ever wondered how to install GA4 for WordPress on your business's online website, you're in the right spot. In this comprehensive guide, Growth Manager Curt Noble demonstrates how to get it done fast, painless and for no cost.

Contents          Toggle

This isn't the typical GA4 guide or blog. I'm not going to spend long explaining what GA4 is or why it's a pain.

I just want to how you set up GA4 and provide you with all of the info you need to do it, in the shortest time possible.

There's been plenty written on the subject of moving away from Universal Analytics (UA) to GA4. In this article I'll show you how to do the clean installation of GA4 on your website commercial website.

So, if you're just starting out with WordPress and need to track your site visitors and performance metrics, bookmark this article.

click save button

Every website has different GA4 tracking requirements

Every website has unique requirements for tracking data. And it's unreasonable to cover every single GA4 tracking case. So, I'm going to keep to the basic, to the extent that I can.

So, if are interested in knowing how many tacos customers have consumed just before they sign up for your Taco Tuesday Premium Recipe Membership... you're in the wrong place.

Probably not going to outline that data tracking solution here.

However, stay with us because you'll need to start here regardless. Your first task is to establish an GA4 account through Google and configure your data stream.

It sounds like fun, doesn't it?

is the Best Membership Plugin for GA4 Reporting

Woman doing GA4 reporting

The methods described in this guide work on any WordPress website. Let's admit it. Certain WordPress themes and plugins perform better when using GA4. This is especially the case with membership sites.

The main benefit of to integrate with GA4 is its versatility 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 . This guide will show the ways these integrations can make your life simpler.

This is why I'm going to straight up say it. If you aren't using , you're probably going to require a Google Analytics specialist to completely set up GA4 on your WordPress membership site.

cta character

Get Now!

Start getting paid for the content you produce.

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 ways on how to set up GA4 on WordPressfor your website for membership or business online. The methods vary from easyto no cost and include the straightforwardmethod that requires a minimal fee.

I'm sure that any of these strategies can be used for you. All four have the same starting point. And you'll need to start with that first step before you can move on to the next one.

Set Up Google Analytics Account

If you're still not in the process of signing up to any Google products (like Gmail or Google Drive), or you'd like to create a new account for Google Analytics You'll have to sign up for your own Google account.

If you're looking to make an account then you are able to create one via Google Analytics. Google Analytics webpage.

Create a New GA4 Property

After signing up for the Google Analytics account and logging into your account, you'll be required to create your GA4 property.

As a Google Analytics account can be used to monitor and analyze several websites, it is possible to make multiple properties on this page to keep the data separate.

When you're logged into Google Analytics, click on the Admin menu in the bottom left-hand corner. Then click the button to create a property.

Create Property in Google Analytics.

When you are on 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 choose several objectives.

These settings determine which reports you'll see out-of-the-box GA4. GA4. Do not worry about it. You can always modify your GA4 reports through the interface at a later time.

Add property details in Google Analytics.

If you are able to access your 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 that happen on your website.

Input your website's URL and provide your data stream with a name. I suggest including "GA4" in the stream 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 the default events. And you can choose what events are 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, clicks outbound, web search, and many more.

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

There's a chance that you'll notice a glaring omission here - there's no purchasing 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 wasn't it?

Now, you've got now a fully operational GA4 website property and data stream. It's sitting waiting for data to flow (kind similar to my child sitting at the table with his bowl awaiting someone to pour them the Cap'n Crunch).

Next let's explore four possible methods to put cereal in the bowl. Errr... I'm trying to to get the GA4 events in the data stream.

Add GA4 to Any WordPress site

Your GA4 data stream in place and set to accept web-based events. The next step is to incorporate some code into WordPress for sending information 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 for you based upon your specific situation.

There are some things to consider when working out how to determine the most effective way to integrate GA4 on your WordPress site:

  • How confident are you in using the GA4 reporting interface?
  • Do you offer subscriptions, courses or downloads through your site?
  • Are you acquainted with Google Tag Manager?
  • Are you also running advertising or social media traffic you'd like to monitor?
  • Do you have affiliate links that you would like to share?

There's probably more to be thinking about. However, this is an excellent starting point. In each of the four approaches listed below, I'll provide examples of when each technique could be suitable.

So let's get to it!

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

This solution can be absolutely and cost-free. But it may not be the best solution for your WordPress site. This option is suitable for WordPress websites which do not sell products.

The reason for this is Google Site Kit has a major limitation when it comes to tracking of e-commerce - which is, it doesn't have the capability.

And it can only configure Google tools and solutions.

Do you think you'll want to monitor affiliate links or traffic from social networks such as Facebook as well as Twitter (X) sometime in the near future? This is a no-cost method.

When you decide to scale it will cause the user with too little. That being said below are the steps to follow.

Install the Google Site Kit Plugin

Install Google Site Kit plugin.

From to the Add Plugins webpage, just look up the keyword Site Kit on Google. After that, install and enable the plugin.

Add plugins in WordPress.

After the plugin has been activated it is time to start the process of setting it up. First, you need to sign in to the same 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 could use Site Kit to connect to various other Google applications and tools. But, it's not required.

Right now, let's just join Google Analytics by selecting it from the options to start setting up.

Google Site Kit installation screen.

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

You could also permit Google Site Kit to create the GA4 Data stream for you if don't already have one. However, the choices aren't endless. So, I would recommend making the data stream separate.

You must activate the option insert the Google Analytics 4 code on your site. This is how GA4 will record analytics events for your WordPress website.

Google Site Kit connect service.

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

Take note of a minor delay in data collection. So, you won't see any information on the GA4 report for many hours.

Verify that GA4 The data is flowing

You can check to make sure your data is moving via GA4's Real Time report in GA4.

Navigate back to your Google Analytics account, and choose Reportson from the menu on the left. Click Real Time..

If you do not see any data here there's a chance that there isn't anyone currently visiting your site. That's okay. Go to your website using a different browser tab.

In a short time, you will see the users session appearing in real-time reports.

Method #2 Method 2: Add GA4 to WordPress Membership site using Google Tag Manager for free (kind of)

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

Even though GTM is completely free however, it might need the assistance of an expert in analytics for a complete set-up. This method is suitable for those who have prior experience with GTM.

GTM lets you set up your own events. With GA4, you'll be required to set up a number of events in Tag Manager. Therefore, put on your seat belts.

To implement the e-commerce tracking feature using GTM for a WordPress website for members, you'll probably need some extra coding. In particular, you'll require a script that pushes your transaction data into the Google Analytics data layer.

Understanding the 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 provide custom-designed data to GA4, Google Ads, and various other third-party service providers.

The principal function that the data layer serves is distinguish the information from the presentation layer (your information). So, instead of hardcoding data directly in tags or scripts for your site or scripts, you could transfer the data to the layer of data.

Then, GTM can read the information and then utilize it to create tags, triggers and variables.

A Data Layer Can Make Your Life Easy

  • FlexibilityIt is possible to add, modify, or delete data, without altering the code of your website. This can be particularly useful to marketers who might not have direct access to a site's source code.
  • Consistency In centralizedizing your data in one place this ensures consistency in information collection across different devices and platforms.
  • enhanced tracking The data layer permits more sophisticated tracking scenarios, such as capturing the data of dynamic websites or even single-page apps.
  • Security - By controlling which data is entered into the data layer and the way that it is accessed, you can ensure that information you aren't knowingly transmitted to third-party software.

After you've understood the idea of data layer we'll get GTM set up!

Install a Google Tag Manager Plugin

There are numerous plugins to add GTM on your WordPress website. As there's an standard GTM implementation the majority of them perform the same function.

It turns out that this Site Kit Google plugin is also able to install an GTM container for you!

Click on METHOD 1 to learn the steps you can download this Google Site Kit plugin. After that, you can select the option to add Google Tag Manager.

Configuring the GA4 Tag in Google Tag Manager

With GTM installed and configured You're now ready to deploy your first tag!

A quick note: Google recently migrated the old GA4 Configuration Tag into the global Google Tag. If you've noticed others tutorials that mention GA4 Configuration tags GA4 Configuration tag inside GTM, it's not present now.

After you sign in onto your GTM workspace Click to create a new tag. Then give the tag a name at the lower left.

I would suggest using an example such as "Google Tag to GA4". This will make it easier to be aware of how the tag controls the GA4 implementation.

Next, click into then the Tag Configuration tab for the option to add a brand new type of tag. You'll see an option for Google Analytics. On the next screen, there are a variety of Google Analytics options. You must choose Google Tag here.

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

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

After you've created the proper Google Tag, you'll be required to enter the Google Analytics Measurement ID.

The tag ID is what Google determines where it should send data collected on your website. This is how to locate the GA4 Measurement ID.

The next step is to notify Google Tag Manager where you want this tag to appear on your WordPress website. The GTM container appears on each page of your website. Therefore, you may select to include the GA4 tag on every page as well.

In the Triggering panel select the option Initiation Every Page.

Google tag for GA4 screenshot

The GA4 tag you publish to Your WordPress Membership Site

All you have to complete is backup your tag configuration and then publish your changes to the container you have created.

There's a Submitbutton on the upper righthand area of your GTM Workspace.

Today, GA4 is collecting the event details that are default for your website.

The entire software is there for pushing default event data to your data layer.

Additionally, the events you defined previously in the GA4 option for data streams are now being monitored.

There's also no tracking of e-commerce in place. So let's take care of this...

How to Track Your Membership sales revenue in GA4

Remember all that talk regarding the data layer? In order to track membership sales or any other information, you must push that data into the data layer.

It requires a little more code. Also, you'll need to use Google Documentation. Google Documentation.

There are two parts to this set-up.

In the beginning, you'll have to transfer the details of your transaction into your data layer following the sale has been successful. Here's an example of code to use for the "purchase" event:

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 ] ); 

The second step is set up an event tag in GTM for collecting and sending the data from transactions to GA4 reports. The tag setup within GTM will look something like:

  • Make a new tag by using the tag's type of "GA4 Event".
  • In the name of the event you must enter "purchase".
  • The event's parameters are mapped as 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 be referred to as tems|A|the} Data Layer Variable
  • Set a trigger for this tag to fire on the order confirmation page or after a successful transaction.

Can't You Find a Simpler Way?

Using GTM to include GA4 tracking to the WordPress website can be quite an undertaking.

The method I've described above will give you the basics of analysis tracking as well as the ecommerce reports on sales.

However, you'll need to go and configure every other data point that you'd need to track. Then think about the danger of what could happen if Google "flips the script" upon you.

For example, the migration of GA3 (Universal Analytics) to GA4 resulted in quite a shake-up for site owners as well as marketers.

If you're in charge of the entire monitoring strategy using GTM You're required to be attentive for any shifts. In many companies, this is a full time post.

Do you think there is an easier way? Yes, it is. There are actually two better methods to accomplish this by using premium plugins.

How to Save Money and Time to Setup GA4 for WordPress Membership Sites & Online Business

Phew! We made it through the hard portion. If you've read the two previous options in setting GA4 on WordPress, you're in the right place. GA4 on WordPress it's possible you're thinking this is a bit above your salary. I assure you, it's not. These next two options could be referred to as "stupid-easy".

I've spent over 10 years working with web analytics systems.

I've participated in various implementations, ranging from no-cost 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 been working with Customer Data Platform solutions like Tealium to deploy analytics code. I used to work with data layers before they got cool.

Therefore, you are able to believe me in my words that these two plugins are the most effective option to use GA4 for WordPress.

METHOD #3 Method #3: The "almost free" method of adding GA4 to WordPress by using WPCode Pro

In the time I attended college, I had a discount card known as the "Starving Student Card." The card offered me discounts for Big Juan Burritos when I went to Taco Time. It's possible that there were other discounts too. But that's not important.

Point is, I should call this"Starting Student. "Starving Student" method to include GA4 on your site for membership.

This is a great option for budgeting, especially for college students on a limited budget. This is how:

Join WPCode Pro and install it. WPCode Pro

WPCode homepage screenshot

There's a free version too, which is called WPCode Lite. Since you're installing GA4 on a membership site it will require some important features only available in pro.

Particularly, you'll require Conversion Pixels as well as the Advanced Locations for eCommercefeatures.

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

There are thousands of WordPress websites that use WPCode. At 4.9 rating, this is possibly the highest rated plugin on the market.

WPCode customer rating screenshot

So, as a first step, sign up for WPCode Pro. (If you only need to install it on one website, then the Basic Plan includes all the GA4 features you require.)

Next, follow the instructions to install and then activate the plugin on your WordPress website. WPCode Pro is integrated with, and will auto-detect the plugin. This can be a huge time-saver.

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

You won't need to add any scripts or codes. WPCode Pro will set up and push ecommerce data to the layer of data.

It's also not necessary to set up anything using Google Tag Manager. Actually, WPCode completely eliminates the need to use Google Tag Manager on your WordPress website.

The only thing you need to provide is telling WPCode Pro your GA4 measurement ID (in the blurred-out field below). The program will handle all the rest. You must select which types of conversion events you would like to monitor. I would recommend keeping track of all possible occasions.

GA4 set up in WPCode

And that's it. Then you can add GA4 to your membership site. All your membership signups are being monitored and all the information is transferred to the GA4 report.

In the final part of this blog post, I'll inform how to locate your membership conversion data from GA4 reports. First, let me offer an additional, simple solution to those of you who are looking for a solution!

Method 4 is the most flexible and cheapest method to include robust GA4 tracking capabilities to WordPress Membership Sites using MonsterInsights

The only drawback to using WPCode (above) is that it will send all information to your GA4 account. Therefore, in order to view your information, you'll have to log in to your GA4 account and find the user interface.

And initial reports are in. The latest GA4 user interface looks pretty much... garbage as per 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 do the following, easily:

  • Fully-scale GA4 tracking and eCommerce - No FOMO over not tracking or tagging an idea you'll think of in the future.
  • Access all of your data directly in your WordPress admin This means you don't have to struggle with the horrible GA4 interface for finding crucial insights from your database
  • Outbound link tracking You'll be aware of how many people are actually visiting the hyperlinks on your blog content
  • Affiliate link tracking Check out which affiliate link is getting the most clicks
  • EU compliance built-in You can rest at night without a fear of a major fine from the EU for violating data privacy law
  • Logged-in user tracking Examine how your paying members use your website differently from the public
  • Author monitoring - Report on each blog's performance by the author
  • Zero-Code implementation There are no additional costs to set up your tracking code and setup of events

It's a short review. There are many options that make it an easy and affordable decision.

The no-coding aspect will pay the dividends immediately. There is no need for an analytics engineer or expert with MonsterInsights.

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

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

MonsterInsights setup wizard in WordPress

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

There's also an detailed step-by-step guide on the full installation process, should you need it. Once you've completed the Addons section, make sure you install the MonsterInsights ecommerce extension.

MonsterInsights recommended addons screen

That's really all there is to it.

Your WordPress Membership website should be all setup using GA4 tracking. MonsterInsights has set up the data layer for you and your GA4 events you chose to track during the setup process.

As I mentioned above it isn't necessary to login into your GA4 account to see your information. MonsterInsights provides your information directly in the admin area of WordPress.

The GA4 Dashboard is accessible on the WordPress admin

For access to the GA4 information to access your GA4 data in MonsterInsights there's an overview of the data in the dashboard widget.

MonsterInsights WordPress admin data screen

And you'll see a full range of information by going through Insights. Insights button in the left navigation.

Viewing Your Data in Google Analytics

Of all these options of which there are many, among them, MonsterInsights can display your analytics directly in WordPress. In order to use the other options you'll have to sign in to the Google Analytics account and navigate to the GA4 site.

This screenshot is the result of the sandbox environment I've been playing with during this tutorial. There's a lot of data to show. If you'd like to dive into GA4 and poke around for a while, I suggest using the GA4 Test Account.

Final thoughts

Congrats! You've got Google Google Analytics set up on your WordPress Membership site to help you grow your online business.

You can now get a better understanding of the people who visit your site and how they're engaging with the content you provide, and how effective your site is in converting users into members.

If you're interested in learning more about Google Analytics, we've published an article about ways to utilize Google Analytics to improve the performance of your membership site.

It's also a free course at Google Analytics. Google Analytics website for those looking to get the most out from this tool.

 Do you have any questions about using Google Analytics with your site's membership? If so please, leave your comment here.