HOW TO CONFIGURE GOOGLE ANALYTICS 4 (GA4) WITH GTM SUPPORT.
- August 15, 2024
- Categories: Adobe Commerce, eCommerce, Magento 2
Post Contents:
- What is Google Analytics 4?
- Benefits of Google Analytics 4.
- How to Set up Google Analytics 4 in Magento 2.
- Create GA4 Property
- Get your Measurement ID
- Set up a Google Tag Manager Account and Container
- Get your Public ID, Account ID, and Container ID
- Install Magento 2 Google Analytics 4 Extension
- Paste your GTM and GA4 IDs into the Magento Admin
- Generate GTM Tags
- Test the GTM Connection
- Check Google Analytics 4 in real-time.
What is Google Analytics 4?
After being put through public testing since 2020, Google Analytics 4 (GA4) is a next-generation measuring system based upon the foundation of Universal Analytics (GA3). It has extensive interactions with Google advertising platforms and uses machine intelligence. It provides you with information about how clients use various platforms and gadgets.
Furthermore, the GA4 measurement mechanism is based on events and parameters, whereas Universal Analytics (GA3) monitors data based on page views and sessions.
GA4 takes eCommerce tracking to a new dimension. And now, due to better integration with Google Ads, you can segment your website visitors using these events and retarget them.
Benefits of Google Analytics 4
Since we now know that it represents a significant advancement in data tracking, let us focus on GA4’s best features.
1. Data Streams
Google Analytics 4’s ability to track data on your website, mobile app, or both in a single property is one of its greatest features. One property can contain several data streams, such as iOS, Web, and Android.
2. Customer Journey Tracking
With the GA4 edition, Google Analytics has undergone fundamental changes. Instead of focusing on sessions, the focus is now on users and their interactions with your store, as documented by events.
Even if a consumer views your business from a mobile device, returns later on a desktop, and completes a purchase using an app, you can still create a customer journey for them.
3. Focus on User Management
GA4 enables you to concentrate on user-centric reports because it has the capacity to gather more data and feature report menu parts that are in line with the customer journey. The lifecycle and user part now includes a study of Acquisition, Engagement, Monetization, and Retention along with demographic and technological information.
Right after you create a GA property, you’ll be redirected to the Web stream details where you can find the Measurement ID you’ll need later.
However, if you already have your property set up, go to your Google Analytics account > Admin > Data Streams and click on the data stream you need to collect the Measurement ID from.
4. More Segmented Audiences
More audience segments are possible with more potent analytics and reporting, which you can utilize to develop marketing campaigns that are more successful.
With dynamic remarketing, you can target people based on a variety of criteria, such as those who add items to their wishlists, make purchases, and abandon their carts. Not to mention its capacity to compile information from many browsers and devices.
With Google Analytics 4, your e-commerce store has countless opportunities. You, therefore, do not need to wait for it to expire on July 1, 2025. Make the switch to GA4 right away to enjoy these advantages.
How to Set Up Google Analytics 4 in Magento 2?
Typically, a Google Analytics tracking code must be inserted into the <head> section of your website to add Google Analytics to Magento 2. It is not only inefficient but also inconvenient for anyone without technological expertise.
Using Google Tag Manager (GTM) is the most effective method for adding Google Analytics 4 to Magento. With GTM, you can track client journeys by adding various e-commerce events with flexibility. You will not even have to perform the task by hand.
1. Create GA4 Property
You must first establish a GA4 property before you can begin adding GA4 to Magento. Proceed to the next step if you already have one.
Go to Google Analytics and select Get Started Now to begin setting up a GA4 property. You must choose the Account Data Sharing Settings and provide your account name.
Then move to the property setup and set the property name and some additional information, like the reporting time zone and currency.
Next, you need to provide information about your business category, size, and purpose. It is used by the platform to tailor your experience.
Once you agree to Google Analytics terms, you’re almost set up. The last thing you need is to create a data stream, meaning tell GA4 where to track data from. So you choose the Web as a platform.
Then provide the website URL and Stream name. Don’t forget to click on the Create stream button, and that’s it—you’ve created the Google Analytics 4 property.
2. Get your Measurement ID
Right after you create a GA property, you’ll be redirected to the Web stream details where you can find the Measurement ID you’ll need later.
However, if you already have your property set up, go to your Google Analytics account > Admin > Data Streams and click on the data stream you need to collect the measurement ID from.
3. Set Up a Google Tag Manager Account and Container
Since we added Google Analytics 4 to Magento through Google Tag Manager, you need to set it up too. As with the GA account, if you’ve already set up the GTM account, move on to the next step.
Go to the GTM homepage and press the Create Account button. Then, set the account Name, Country, and Container name, and choose the target platform.
4. Get your Public ID, Account ID and Container ID
Apart from Google Analytics Measurement ID, you also need to get some tracking IDs from GTM. Go to the GTM homepage and choose the container you want to use for tracking.
- Public ID
Go to the Admin tab to find the public ID near the container name.
- Account ID
You can find the account ID on the container page when you’re in the Workspace tab. It is in the browser address after /accounts/.
- Container ID
The container ID is located in the container page address as well but after /containers/.
5. Install Magento 2 Google Analytics 4 Extension
As we’ve mentioned before, Google Analytics 4 integration with Magento is much easier and less technical if you use the right solution. So the next step is to install the Magento 2 Google Analytics 4 extension and manage it from the admin panel.
6. Paste your GTM and GA4 IDs into the Magento Admin
Then unfold the Google Analytics 4 section and paste your Measurement ID there. Don’t forget to Save the settings.
7. Generate GTM Tags
You can create different custom events like add_to_cart or initiate checkout in your GTM account manually if you like. However, if you have a Google Analytics 4 extension, you don’t need to.
When you’re still on the extension configuration page, scroll down to the Export Web Container section and press on the Generate JSON Container & Download File button to get the file with all the essential tags.
8. Test the GTM Connections
GTM allows you to check if Google Tag Manager is working correctly right from the workspace. While you’re on the container page workspace, click Preview and enter your Website URL in a popup.
Click on the Preview and then Paste the website to check the GTM Connection.
9. Check Google Analytics 4 in Realtime
If the GTM tags work properly then they are collecting some data about your website visitors. So, you can go to GA4 > Reports > Realtime and monitor the activity on your store. You have added Google Analytics 4 to Magento 2!
Additionally, you can debug GA4 to make sure the data is received properly by your property.
Though it might look too complicated compared to Universal Analytics, you’ll grow to love it for all the perks it offers. Track almost any action customers take on your store and use the collected data for dynamic remarketing campaigns or conversion tracking.
Conclusion:
Universal Analytics is on its way out. Google Analytics 4 is the future of e-commerce analytics, offering unparalleled insights into your customers and their behavior. Don’t miss out on this game-changing opportunity to boost your sales and outshine your competition.
Ready to take the leap? Implement Google Analytics 4 on your Magento 2 store today and start reaping the rewards. Our guide has shown you how easy it can be!
Contact us to start your GA4 journey now!