How to Set Up Google Tag Manager in Shopify
If you have own or manage a Shopify store, you’ll know how important data is.
Whether you want to optimise the user experience to keep customers happy and more likely to purchase or run effective and efficient digital ads, data is at the core of those efforts.
This requires tracking on the store, to transfer the data to places like Google Analytics, Google Ads and Meta Ads.
Many stores do this through Google Tag Manager, the big G’s no-code solution for all tracking needs.
But there’s a problem. And it’s in the checkout. Shopify has recently made tracking purchases in Google Tag Manager very difficult.
Why have they done this?
Shopify Data Security
In 2000, Shopify had a major issue on their hands.
Two rogue employees breached the security of 200 stores to steal customers’ names, postal addresses, email and item purchase details.
While Shopify assured store owners that “this incident was not the result of a technical vulnerability,” this clearly highlighted an issue with how data could be accessed.
Store owners also need to be aware of the dangers of unknown apps – the hacking of a compromised third-party app in 2024 exposed 180,000 users’ data.
Regulators are also demanding greater protection for customers. Version 4 of the Payment Card Industry Data Security Standard comes into effect on 31 March 2025, and mandates enhanced security, particularly against “digital skimming” – the stealing of payment details like credit card numbers.
Shopify had to response, and a ‘sandbox’ was their solution.
Shopify Checkout Sandbox
Shopify now restricts what script can run in the checkout by isolating it in a ‘sandbox’.
A sandbox is effectively a website within a website, where only specific types of data can be tracked and sent outside the sandbox.
This is a problem for Google Tag Manager because it means only the sandbox can send data outside itself, while it’s impossible to inject scripts into the sandbox using third-party tools.
This is how preview mode and tagging work in Google Tag Manager, which is why this is no longer possible.
This seems like an impossible circle to square, or at least very expensive. But there is a solution.
Server-side Tracking for Shopify
Server-side tracking is becoming the new standard for tracking, for all websites as well as Shopify stores.
How does server-side tracking work?
Normal tracking (client-side) transfers the data straight from the user’s device to destinations like Google Analytics and the ad platforms.
This is problematic because it is vulnerable to blocking mechanisms like those found on Apple phones. It also depends on the device to correctly process the data to transfer, which can reduce your website's load speed and harm the user experience.
With server-side tracking, the initial tracking still takes place on the device, but the processing and transfer occur on a server instead.
This leads to better quality data for Google Analytics and ads and improved load speed for users.
Crucially, the ability to view and manipulate Shopify checkout data before it is transferred is restored. Fantastic!
If this still sounds expensive, fear not…
Stape for Shopify
Stape is an Estonian server-side tagging company offering EU and global cloud servers to organisations of all sizes.
Stape has built a whole system, especially for Shopify owners looking to set up server-side tracking for their stores. It includes easy-to-set-up templates and an app.
They also have advanced tools to recover more data lost to blocking mechanisms like Apple’s.
It’s also incredibly affordable. The €200 per year package will be more than enough for many businesses.
Overall, Stape’s route to server-side and checkout tracking for Shopify stores is easier to implement, more advanced, and cheaper than Google’s native solution or the many other third-party solutions on the Shopify app marketplace.
We have a solution to the checkout tracking problem. Here’s how to get it done.
How to Install Stape on Shopify
Set up Google Tag Manager web and server containers using Stape’s ready-made importable templates.
Create a new Stape account and set up a Stape server container.
Install the Stape Server GTM app in your Shopify store.
Add the website container ID to the store app and set up the custom domain and loader.
Copy the code in the app and follow the instructions to create a custom pixel in the Customer Event section in Shopify.
Done For You
Setting up server-side tracking and managing Google Tag Manager can be complex and time-consuming.
If you want to ensure everything is set up correctly and efficiently, consider hiring a professional.
As a seasoned Shopify and Google Tag Manager expert, I offer comprehensive services to handle all your tracking needs. I can help you optimise your store’s performance and data accuracy from initial setup to ongoing management.
Contact me today to get started and take the hassle out of your tracking setup!
The information provided in this article is for general informational purposes only and does not constitute legal advice. For specific legal advice, please consult your legal representative.