How to set up GA4 for WordPress (Free and Paid) Methods

Sep 22, 2023

Reader Disclosure

If you've ever wondered how to install GA4 for WordPress for your company's website, you're in the right spot. In this comprehensive guide, growth manager Curt Noble will show you how to do it quick, easy even free.

Contents          Toggle

This isn't your typical GA4 blog post or guide. I'm not going to spend the time to explain the basics of what GA4 is or why it's not a good idea.

I just want to how you how to install GA4, and give you all of the info you need to get it done so that you can do it as fast as you can.

A lot has been said about migrating away from Universal Analytics (UA) to GA4. In this article I'll show you how to do an clean installation of GA4 for your web-based business site.

So, if you're just getting started with WordPress and you're looking to monitor the number of visitors to your website and other measure performance, bookmark this article.

click save button

Every Website Has Different GA4 Monitoring Needs

Every site has its own unique need for data tracking. It's not feasible to address every single GA4 tracking case. So, I'm going to keep to the basic, as much as possible.

This means that if you want to know how many tacos they've eaten before signing to sign up for the Taco Tuesday Premium Recipe Membership... you're in the wrong place.

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

Keep reading, as you'll need to start here anyway. Your first task is to establish your GA4 account using Google and set up your data stream.

It sounds like fun, doesn't it?

is the Best Membership Plugin When it Comes to GA4 reporting

Woman doing GA4 reporting

The methods described in this article work with any WordPress site. However, let's admit it. Certain WordPress plugins and themes just are better suited to GA4. And this is the case for membership websites.

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

All the major Google Analytics plugins have integrated with . In this article, you'll learn how these integrations make your life simpler.

Therefore, let me straight up say it. If you aren't using  Google Analytics, then you'll need an Google Analytics specialist to completely set up GA4 for your WordPress membership site.

cta character

Start Now!

Get paid to create the content you create.

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

Follow these steps for how to set up GA4 on WordPress

This guide covers four different options for setting up GA4 in WordPressfor your membership site or online business. These methods range anywhere between easyto no cost and include the easymethod requiring a small additional cost.

I'm sure that any of these four methods will work for your situation. All four have the same first step. And you'll need to start there before doing anything else.

Create Google Analytics Account

If you're not already in the process of signing up to any Google services (like Gmail or Google Drive) or if you'd like to have a different account with Google Analytics to begin, you'll need to create an account with Google. Google account.

In case you want to make an account then you are able to sign up for 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 have to make your GA4 property.

As a Google Analytics account can be utilized to analyze and monitor several websites, it is possible to set up multiple properties to keep the data separate.

When you're logged into Google Analytics, click to the Admin option in the lower left-hand corner. Click the button Create Property.

Create Property in Google Analytics.

When you are on the Create Property screen, you'll just need to fill in some basic info regarding your site. Within the Business Objectives options you can choose multiple goals.

These settings decide which reports you'll see out-of-the-box GA4. GA4. Don't worry though. You can always alter the appearance of your GA4 reports in the interface later.

Add property details in Google Analytics.

If you are able to access your Data Collection options, choose Webfrom the choices. It's where you'll set up your GA4 Data stream.

This is where GA4 collects all the events which occur on your site.

You must enter your website's URL. give your data stream a name. I would suggest adding "GA4" within the stream name. This will help you easily identify it as the GA4 data stream later on in this article.

Configuring GA4 Events to be Collecting on WordPress

GA4 gathers so-called "default events". You can pick the ones that are important to you.

I suggest selecting the enhanced measurement option. This will tell GA4 to collect a few additional events that are standard, such as scroll depth, outbound clicks, web search, and many more.

If you select the gear icon to the right, you'll be able to pick the events you want to follow. Your best bet is to keep them all in check.

Now, you might find a huge omission There's no purchasing event available! Weird, right?

More on that later.

Set up data stream in Google Analytics.

Step One is Complete!

This wasn't too difficult, did it?

Now, you've got a fully functioning GA4 web property and data stream. It's sitting waiting for the data to come in (kind similar to my child in the dining room and a bowl, waiting for somebody to pour out the Cap'n Crunch).

Then let's take a explore four possible methods to put cereal in the bowl. Oh, no... I'm trying to incorporate the GA4 events in the stream of data.

Making GA4 available 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. You'll need to add some code to WordPress to send data to the stream.

In the past, I've mentioned that there are numerous options to achieve this. You'll need to decide which is the best method depending on your situation.

There are some things to consider when working out what is the best way to add GA4 to your WordPress site:

  • How confident are you in analysing data using the GA4 Reporting interface?
  • Do you offer memberships, courses or downloads through your website?
  • Are you aware of Google Tag Manager?
  • Are you also running paid ads or social traffic you'd like to monitor?
  • Have you got affiliate link you wish to promote?

There's likely to be more to consider here. But this is a good idea to begin with. For each one of the 4 methods listed below, I'll provide scenarios showing when each method might be appropriate.

Now let's move on!

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

This solution can be completely and cost-free. But it may not be the ideal solution for your WordPress site. This option is suitable for WordPress membership sites that don't sell anything.

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

And it can only configure Google applications and tools.

Think you might want to track affiliate links, or even traffic coming from social networks such as Facebook and Twitter (X) later in the future? It's best to avoid this cost-free method.

If you choose to scale the size of your business, this will make you with a lot of limitations. In that regard Here are the steps.

Install Google Site Kit Plugin

Install Google Site Kit plugin.

On the Add Plugins webpage, you need to look up the keyword Site Kit by Google. Install and then activate the plugin.

Add plugins in WordPress.

Once the plugin is activated after activation, you are able to begin the setup process. The initial step is to sign in to the same Google account you created to get the GA4 property previously.

Connect your GA4 Data Stream to WordPress with Google Site Kit

As I said earlier, you could use Site Kit to connect to various other Google tools and services. But, it's not required.

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

Google Site Kit installation screen.

You'll then need to select your property, account, and data stream. Make sure to choose your GA4 data stream you've previously made.

It is also possible to allow Google Site Kit to make the GA4 Data stream to you, if you don't already have one. However, the choices aren't endless. So, I would recommend setting up the data stream in a separate manner.

You must enable the option to Place the Google Analytics 4 code Here. This is the way GA4 will collect analytics events for your WordPress website.

Google Site Kit connect service.

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

There is a small time delay when data is collected. Therefore, you won't be able to see any information on reports for your GA4 report for some time.

Check to ensure the fact that GA4 The data is flowing

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

Navigate back to the Google Analytics account, and select Reportson in the navigation menu left. Click Real Time..

If there isn't any information here there's a chance that there isn't anyone currently browsing your website. That's okay. Simply visit your site using a different browser tab.

In a short time, you will see the user session appear in the real-time reports.

Method 2: Add GA4 to WordPress website for membership 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.

Even though GTM is available for free, it may require an analytics specialist to finish the set-up. So this method works well for those who have prior experiences with GTM.

GTM allows you to configure your own custom events. In GA4, you'll need to create a variety of events in Tag Manager. So, buckle up.

For the implementation of ecommerce tracking with GTM for an WordPress site for membership, you'll probably need some more code. Particularly, you'll need the script to push your transactions' data to Google Analytics' data layer. Google Analytics data layer.

Understanding the Data Layer

The layer of data is the most important notion when you work in conjunction with GTM and Google Analytics (GA4). It serves as an intermediary between your site and GTM.

It also lets you transmit your own information directly to GA4, Google Ads, as well as other services from third parties.

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

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

A Data Layer Can Make Your Life Easier

  • FlexibilityThe HTML0 flexibility allows you to easily edit, change or erase data with no need to alter the website's code. This can be particularly useful to marketers who might not have direct access to the site's source code.
  • Consistency - By centralizing the data into one central location, you ensure consistent data gathering across various devices and platforms.
  • Advanced Tracking The data layer lets you use more advanced tracking applications, for example capturing data from dynamic web pages or even single-page apps.
  • Security - By controlling what data goes into the data layer and also how it's accessible, you can make sure that sensitive information isn't inadvertently sent to third-party tools.

Once you've grasped the concept of the data layer, we'll get GTM set up!

Install a Google Tag Manager Plugin

There are a number of plugins that can be used to add GTM to your WordPress site. Because there's an common GTM implementation, most of them perform the same function.

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

Scroll up to METHOD #1 to see the procedure to install Google Site Kit. Google Site Kit plugin. You can then select to include Google Tag Manager.

Configuring the GA4 Tag in Google Tag Manager

With GTM installed and configured and configured, it's time to deploy your first tag!

A quick note: Google recently migrated the old GA4 Configuration Tag to the global Google Tag. If you've noticed other tutorials mentioning the GA4 Configuration tag within GTM, it's not in use any more.

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

It is suggested to use the phrase "Google Tag to GA4". This can help you be aware of how the tag controls the GA4 implementation.

After that, you can go into The Tag Configuration section to create a new type of tag. You'll see an option for Google Analytics. Then, on the next screen there are a variety of Google Analytics choices. Be sure to select Google Tag here.

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

The GA4 events will be configured later. We first need to have the Google Analytics code firing.

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

The tag ID will be what Google determines where it should transmit data from your website. Here's how you identify 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 will be on every page of your site. This means that you could select to include GA4 tags on every page. GA4 tag on each page, too.

On the Triggering tab select the option Initiation All Pages.

Google tag for GA4 screenshot

The GA4 tag you publish to your WordPress Membership Site

The only thing left to do now is to backup your tag configuration and then publish your changes to the container you have created.

You'll see a Submitbutton in the upper righthand corner of the GTM Workspace.

Now GA4 will be collecting the standard event information for your website.

The entire necessary code is already in place for pushing default event data to your data layer.

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

But, there's no ecommerce tracking in place. So let's take care of this...

How Do You Track Your Membership Profits from Sales in GA4

Remember all that talk regarding the data layer? To track member sales revenues or other e-commerce data, you need to transfer that data to the data layer.

This requires some extra programming. Also, you'll need to use the Google Documentation.

There are two components to this setup.

First, you'll need to push the transaction details to the data layer upon an effective sale. Here's an example of code 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 create an event tag within GTM to gather and transmit the data from transactions in GA4 reports. Tags set up in GTM will look something like:

  • Create a tag using the tag type "GA4 Event".
  • To name the event you must enter "purchase".
  • The event's parameters are mapped as prior to:
  • currency to urrency|A|The} Data Layer Variable
  • value to alue|the|A} Data Layer Variable
  • transaction_id to ransaction_id||A} Data Layer Variable
  • objects to tems|A|the} Data Layer Variable
  • Create a trigger on this tag to trigger the confirmation page of an order or after the transaction is successful.

Isn't There an Easier Way?

Using GTM to include GA4 tracking to the WordPress site is quite a task.

The method I've described above would get you the basic tracker of analytics and report on revenue.

However, you'll need to go and configure every other piece of data you'd like to monitor. Consider the possibility of what could happen if Google "flips its script" upon you.

As an example, the transition from GA3 (Universal Analytics) to GA4 caused some confusion for site owners as well as marketers.

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

Do you think there is an easier way? The answer is yes. There are two different methods to accomplish this with premium plugins.

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

Phew! It's over! tough portion. If you've read the previous two options for setting up GA4 on WordPress, you might be thinking this is above your pay grade. I assure you, it's not. Two of the options above can be described as "stupid-easy".

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

I've been involved in implementations that range from no-cost Google Analytics Legacy versions, to more sophisticated solutions such as 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 to deploy analytics code. I was working with data layers before they became cool.

You can therefore believe me in my words that the following two plugins provide the best way to implement GA4 in WordPress.

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

While I was a student, we had this discount card known as"the "Starving Student Card." The card gave me sweet discounts for Big Juan Burritos when I went to Taco Time. And I think there were other discounts too. But that's not important.

The point is that I'd be calling this"Starting Student" method "Starving Student" method to integrate GA4 into your site for membership.

It's totally budget-friendly, even for college students who is on a budget. What you can do:

Join WPCode Pro and install it. 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 options that only come with premium.

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

And bonus! It's also possible make use of WPCode Pro to add your social media tracking pixels.

There are many millions of WordPress websites using WPCode. And at 4.9 rating, this is possibly the highest rated plugin out there.

WPCode customer rating screenshot

For the initial step, register for WPCode Pro. (If you're only looking to put it on a single site, the Basic Plan includes all the GA4 features you require.)

Follow the next steps to install and then activate the plugin on the WordPress website. WPCode Pro has been integrated with, and will auto-detect the plugin. This can be a huge time-saver.

Configuring 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 Data Layer.

And you won't need to modify anything within Google Tag Manager. In actual fact, WPCode completely eliminates the need to use Google Tag Manager on your WordPress website.

All you have to do is tell WPCode Pro your GA4 measurement ID (in the field that is blurred out below). It will take care of the rest. Be sure to select which event you wish to monitor. I would recommend keeping track of all available events.

GA4 set up in WPCode

And that's it. Then you can add GA4 to your membership site. Your membership sign-ups are being monitored, and all the information is transferred to GA4 reports. GA4 reports.

At the end of this post, I'll show you where to find your membership conversion data from GA4 reports. But first, I've got an additional, simple solution to you!

Method #4: The most scalable 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 your GA4 account. Therefore, in order to view your data, you have to log in to your GA4 account and find your way around that user interface.

And initial reports are in. The brand new GA4 user interface looks pretty much... garbage According to the people who have used it.

That's why MonsterInsights is my first choice to complete a large-scale GA4 install. With MonsterInsights you'll have the ability to do the following, easily:

  • Large-scale GA4 tracking and E-commerce - No FOMO over the fact that you are not tracking or tag things you may consider at a later time
  • View all your information within your WordPress Administration - You won't need to fumble around the terrible GA4 user interface to find critical insights in your data
  • Outbound link tracking - You'll know how many people are actually clicking on the links you include in your blog posts
  • Affiliate link tracking Find out which affiliate links are getting the highest number of clicks
  • EU conformance built-in You can rest all night long without the worry of a major fine from the EU in case you violate data privacy legislation
  • Logged-in user tracking - Analyze how your paying members are using your site differently in comparison to the general population
  • Author tracking - - Report on every blog's performance by the author
  • Zero-Code Implementation - No extra costs to set up your tracking code and event setup

That's just a quick overview. There are many options that make MonsterInsights an easy to afford.

The zero-code aspect pays the dividends immediately. It doesn't require an engineer in analytics or a specialist with MonsterInsights.

Join and install MonsterInsights Pro for Less Than a Chipotle Burrito Each Month

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

MonsterInsights setup wizard in WordPress

The wizard is comprehensive, and extremely intuitive. This is why I don't go through each step.

There's also an thorough guide to the entire procedure of setting up, in case you need it. When you get to the addons step, make sure that you install the MonsterInsights ecommerce addon.

MonsterInsights recommended addons screen

That's really all there is to the setup.

Your WordPress Membership website should be fully set up and running using GA4 tracking. MonsterInsights has created the data layer for you and of the GA4 events you chose to track in the initial setup.

Like I said it isn't necessary to sign in on to your GA4 account in order to view your data. MonsterInsights provides your information directly in the admin area of WordPress.

The GA4 Dashboard is accessible in the WordPress Admin

To get to the GA4 information in MonsterInsights, you'll see an instant summary on the widget on your dashboard.

MonsterInsights WordPress admin data screen

In addition, you can access the complete set of data by navigating to the Insights button in the left navigation.

Viewing Your Data in Google Analytics

Of all these options of which there are many, only MonsterInsights displays the analytics information directly within WordPress. To access the other options, you'll need to login to the Google Analytics account and navigate to your GA4 site.

The image is a result from the sandbox that I was playing around with within this article. So, there's not a lot of data to display. If you're looking to jump in GA4 and play around with it a bit, I recommend visiting the GA4 Test Account.

Final Reflections

Congrats! You've got 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 the content you provide, and the effectiveness of your website in converting users to members.

If you'd like to know more about Google Analytics, we've published an article on how to use Google Analytics to improve the performance of your membership site.

Additionally, there's an online course for free on 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 so please, leave an answer in the comments here.