Google Analytics 4 will be an industry standard for web analytics within the next few months since Google is sunsetting Universal Analytics. So if you had planned on implementing GA4 on your Shopify store, setting up server-side Google Analytics 4 might be an excellent choice since server-side tracking is more adapted to modern tracking restrictions.
Server-side Google Analytics 4 will help trace user behavior more accurately and, in turn, make better decisions geared toward improved customer experience and eCommerce success.
This blog post will walk you through setting up server-side Google Analytics 4 using the Stape server GTM app.
Google will stop supporting Universal Analytics from 1 July 2023. As a result, all users will be forced to switch to a newer version - Google Analytics 4.
Google has already started automatically converting GA3 (or Universal Analytics) properties to GA4, forcing their clients to begin adapting GA4.
The difference between new and old versions of Google Analytics is huge since Universal Analytics is sessions based, while Google Analytics is event-based. And underway the feedback of users who started implementing GA4 could be better since the product is relatively new, which means it needs some features and has some bugs.
Together with the new version of Google Analytics, another main change in the world of tracking is server-side tracking. Server-side Google Analytics 4 (GA4) has several benefits over traditional client-side tracking.
Here are some of the key benefits of server-side tracking:
Overall, server-side Google Analytics 4 provides more accurate, secure, and customizable tracking options that can help you improve your analytics insights and make better business decisions.
The first step when setting up Google Analytics 4 for Shopify is setting up the server Google Tag Manager container and installing Stape Server GTM App. Our app helps to:
1. Add Stape Server GTM App.
2. Enable the checkbox Insert GTM snippet. When enabled, the app will add a web Google Tag Manager script to every website page.
Proceed with further configuration:
Once done, you will have a web GTM script added to all pages of the Shopify store, server GTM container set up, and use a custom domain and custom loader if you’ve configured those.
3. On the second tab of the Stape Server GTM App, you can configure it to send e-commerce events and user data to the Data Layer. Unfortunately, the app can not send e-commerce events on the checkout since Shopify does not allow access to the checkout.
The list of e-commerce events:
User data:
4. On the third tab, you can configure the app to send purchase and refund webhooks to the server GTM container. Using webhooks is an excellent way of configuring pure server-side tracking without relying on web scripts, data layers, etc. For example, you can track purchases server-side vs. web in parallel. Check this guide for more detailed information on configuring webhooks in sGTM.
That’s it with configuring the stape app for Shopify and cloud servers for sGTM. Next, let’s move to configure Google Analytics 4 for Shopify.
1. Inside the WEB Google Tag Manager container, set up the GA4 configuration tag. Add your GA4 ID, enable the checkbox Send to server container, and add your tagging server URL. The tag should trigger on all page views.
You can send a pageview event with the configuration tag. However, from my experience setting up a separate tag for the pageview event works more accurately.
2. Set up a pageview event.
3. Set up e-commerce events. To ensure e-commerce events, product, and user data are set up correctly, open a web GTM container and check the data layer for each e-commerce event. For example, you might need to configure a data layer variable for an event or user data you must send to GA4.
You must create custom triggers for each e-commerce event based on the data layer event.
Below is an example of the tag and trigger for the Add to cart event. The process of setting up all other e-commerce events is similar.
4. Open Server Google Tag Manager container. Add Google Analytics 4 client or ensure one is added.
5. In the server GTM container create a GA4 tag. Add your GA4 ID, set the event name, and trigger. In my example, an event is variable, and GA4 server-side tag triggers whenever GA4 claims a request.
That’s it with configuring server-side Google Analytics 4 for Shopify. Next, let’s move to testing and troubleshooting the setup.
1. Open the web and server GTM containers debugger and click through your site. Inside the web GTM container, you should see that GA4 tags trigger; in the server GTM container, you should see GA4 requests claimed by GA4 tags.
If you do not see GA4 requests inside the sGTM, check that you’ve correctly added tagging server URL inside the GA4 configuration tag in the web GTM container.
You can also open the website console and check GA4 requests. The correct scenario is when GA4 sends requests to your tagging the server URL. You can check it by filtering requests by GA4 ID in the network tab and ensuring the request URL contains your tagging server URL.
2. Another way is to open the GA4 debugger and check what event and user data GA4 sees.
If web + server GTM and Google Analytics 4 debuggers show correct data, publish the configuration.
Implementing server-side Google Analytics 4 for Shopify is an effective method to enhance your business’s online presence. It offers many exciting features that allow you to understand and track user behavior more accurately.
With this blog post, setting up the connection between Google Analytics 4 and Shopify via the server GTM app can be quickly achieved. The few simple steps outlined here make this process both easy and efficient.
Doing so will allow you to take careful advantage of all its benefits with minimal effort. So why wait? Start optimizing your store today - feel free to reach out if you need help understanding or implementing how to set up server-side Google Analytics 4 for Shopify using the server GTM app.
We've got you covered! Click Get assistance, fill-up the form, and we will send you a quote.
Shopify allows changing “transportUrl” in GA settings. It means that you can set up a Google Tag Manager Server container on Shopify instead of a GTM Web container. I hope that this will help you solve all your tracking problems.
Mar 10, 2023Learn how to easily set up and manage server-side tagging for your Shopify store using the powerful features of the Stape Server GTM app.