Are you wondering how to use Google Analytics 4 (or GA4) with your WooCommerce store or website? Are you familiar with Universal Analytics and need to upgrade?
Since GA4 was launched, web designers and developers have had to consider how Google’s new implementations can affect not just their traffic but also monitoring and reporting on a site’s conversion tracking data. And if you’re running a WooCommerce shop, understanding how to integrate GA4 effectively so you can stay on top of your store’s performance is a must.
In this article, we’ll provide a tutorial on how to set up Google Analytics for WooCommerce and easily get actionable data about your WordPress site. So, let’s get started!
What is GA4?
Google Analytics 4 (GA4) is the newest generation of Web Analytics. It was launched in 2019, so marketers and businesses have been deploying it to understand their web traffic and user behavior.
GA4 is taking over from Universal Analytics, and by mid-2023, Universal Analytics will stop tracking hits, so it’s vital that businesses jump on to stay competitive!
So, what does GA4 do? The tool is an extension of the “app+web” property released by Google. It primarily focuses more on cross-channel data collection, giving you an excellent bird’s-eye view of your site’s traffic as it lands on your site coming in from different sources.
How Does a G4 Property Work?
GA4 collects data using predictive AI (something also known as AI predictive analytics) and a tool named Channel Measurement. This means that this version of Google Analytics can focus on relevance when collecting data, which is important for any site but especially helpful if you want to do eCommerce tracking. Then, it groups the findings according to their source and displays them as part of your Google Analytics account dashboard.
Universal Analytics used to place a lot of importance on security, but GA4 is even more focused on user privacy. This is why the data collected does not rely on hits (such as page-tracking hits, event-tracking hits, and others we’ve become familiar with in the last years) but instead on taking data from websites and apps using a tracking ID and Machine Learning.
Why You Should be Using GA4 with WooCommerce
If you run a WooCommerce eCommerce site, Google Analytics offers several benefits, most of which revolve around its ability to use machine learning to produce interesting and helpful insights. But let’s go through the advantages of using GA4 for your eCommerce reporting in a little more detail.
One of Google Analytics 4’s most significant benefits is that it gives you access to cross-platform information because it measures both in-app and website engagement. In fact, the tool is architected so it can deliver integrated insights in order to follow a user’s entire journey across various devices. All this collected data can then construct a clear view of your site’s performance and give you ideas for areas of improvement.
One of the reasons most users consider GA4 the best analytics tool available is because it can save you time and money by producing automated reports you can then easily share with your team. All AG4 reports are generated using machine learning algorithms and can detect any sudden changes, such as spikes or dips in trends. What this means, in short, is that Google Analytics 4 lets you identify problems on your WooCommerce website so you can share it with your team and take immediate action.
Using GA4, you can analyze product by product to understand which one has a higher demand, set competitive pricing, and implement other marketing methods to help you increase revenue. You can also map a user’s activity and forecast their actions by collecting data (as we mentioned, this is done automatically for all the different platforms using AI-based predictive data).
One thing Google Analytics is slowly transitioning into is using fewer and fewer cookies. This can also help future-proof your site for any potential changes in privacy rules. For example, if you use Google’s Consent Mode, you can make your site run GA4 based on your end users’ consent state. If someone chooses not to consent to cookies, Google will respect their privacy by collecting only basic measurements that can still be helpful for your WooCommerce shop.
How to set up a GA4 WooCommerce Integration
We’ve covered what Google Analytics 4 is and some of its main advantages when it comes to using it with WooCommerce. Now, let’s go through the steps you will need to follow if you want to integrate the tool into your WordPress site and start tracking your store’s performance.
Installing GA4 Using a Plugin
There are several Google Analytics plugins you can use to incorporate Google Analytics into your website. Some popular choices include Conversios.io, GA Google Analytics, and GTM for WordPress.
These all work similarly (you will need to get a Manager ID and add it to the plugin). Here’s what you need to do if you want to integrate GA4 with WooCommerce using the GTM for WordPress plugin.
- Locate and install the Google Tag Manager plugin (GTM for WordPress plugin), so you can start sending data to Google Analytics.
- Activate the plugin and go to Settings.
- Enter your Google Tag Manager ID. To find your ID, all you need to do is:
- Go to Google Tag Manager on Google Analytics.
- Add a new tag and name it GA4.
- Choose GA4 configuration as the tag type.
- Get your ID from Admin > Data Streams > WordPress site > Copy measurement ID.
- Paste the ID into the tag configuration.
- Select Triggering > All Pages.
- Click on Submit.
- Then, click on Publish (this means that the tag is now in your container).
- Copy the gtm container ID on the menu bar at the top and paste it into WordPress with no spaces.
- Save your changes.
- Go to the Integration tab > WooCommerce > Enable track enhanced eCommerce.
Save your changes again.
That’s it! You should now have Google Analytics 4 working on your WordPress site.
Installing GA4 Without Using a Plugin
If you want to integrate Google Analytics with WooCommerce manually, this is possible, too. All you’ll need to do is to edit a core file called header.php (this file is common to all WordPress themes and contains global properties for your entire site, such as metas, titles, and scripts).
The crucial part of this process is understanding that you will need to insert a tracking code into every page of your site because you will want to gather tracking data for your entire eCommerce site. This code usually goes into the header portion of your pages, so it loads before any other website content.
It’s important to keep in mind that editing a core file has its risks, too. The main one is that there’s the potential to generate coding errors that could cause your site to crash or become unavailable. This is why, if you choose to do it manually, you should always back up your site first in case anything goes wrong and you need to revert back to a previous version.
Once you’ve made a copy of your WooCommerce site (or at least of the header.php file), you can follow the following steps:
- Go to Google Analytics and copy the GA4 tracking code. To do this, you just need to go to Admin > Data Streams and click the arrow by Global Site Tag in the tab called “Add New On-Page Tag.”
- With the code copied, open the header.php file on your WooCommerce. You can find this file by going to your Dashboard > Appearance > Theme File Editor > Header.php.
- Add the GA4 code above the closing tag </head>.
- Click Update File.
Just like before, that is all you need to do. Your GA4 code will now be present in all your pages’ headers and will gather data as visitors go through them while visiting your eCommerce site.
What to Do After Integrating GA4
Regardless of how you choose to do your WooCommerce Google Analytics integration (whether you use a plugin or do manually inserting the GA4 snippet on your page headers), you should make sure you are actually making full use of your analytics integration. The best two ways to do these are setting goals and testing your data streams regularly.
1. Set Up Goals and Funnels
GA4 funnels optimize steps taken to a Goal, while Goals measure how many customers take action leading to a purchase. Before (with Universal Analytics), you had to set these up using a limited set of criteria for conversions. With the new Google Analytics 4, though, mobile app events are considered conversions (the default is four, but you can mark up to 30 if you want to).
Funnels in Universal Analytics were also completely revamped for GA4 and made easier to navigate. All users now have access to the funnel exploration technique, which allows you to apply them to historical data, customize them based on events, and create sequences.
2. Test your Integration
When you first set up Google Analytics 4 for WooCommerce, you may not see traffic data for about 24 to 48 hours. However, you can test whether the integration is working correctly by going to the Dashboard on Google Analytics and choosing the Real Time tab. If you see data, it means the code has worked, and you’re all done!
Choose A Codeable Expert to integrate GA4 for you
As we’ve seen in this article, setting up Google Analytics 4 is relatively straightforward if you follow the steps we detailed above. However, integrating the tool is just the first step in learning more about your site’s performance.
Google Analytics 4 is a powerful solution you can use to understand your customers’ behavior and their interactions with your website across different devices, including when they click “add to cart” or “go to checkout.” Compared to Universal Analytics, reporting on GA4 has been made vastly more accessible. However, all the power of machine learning and predictive analytics will do little for your business if you don’t know how to utilize this information to improve your customer journey.
If you want to make the most of GA4, you should always understand what the things you want to measure are and how you will utilize this gathered data to improve your eCommerce site.
If you’re hesitant to add code to your website yourself or want a more bespoke option, you always have the option of hiring a Codeable specialized Google Analytics developer to do a one-time task, work on a project, or as needed in order to take care of it for you.
All Codeable developers are vetted and monitored to ensure the best quality. It only takes a few minutes to find the perfect expert for your project. Try Codeable today!