This guide will walk you through the process of implementing server-side tracking for your Shopify store using Stape's pre-built GTM container template. This template simplifies and speeds up the server-side tracking setup for Meta, GA4 and Google Ads.
Before we start, make sure you have:
More information on how to set up server-side tagging on your Shopify store can be found in our blog.
1. Download templates on our GitHub.
2. Once you unzip the downloaded file an open the folder it contains, make sure you see the following:
For the purposes of this article we’ll be using highlighted templates which include Meta, GA4 and Google Ads setup.
1. You should import the templates in both your web and server container on GTM (process is the same across the two). You need to go Admin → Import Container:
2. Select your template file (make sure the template matches the container type - web/server).
3. Pick a workspace for this import (you can create a new one for this specific purpose).
4. Select Overwrite or Merge.
“Overwrite” option should only be used in a fresh, empty container or if you are absolutely certain you want to do it. For this demo I’m using Merge, with ‘Rename conflicting tags, triggers and variables’ option selected. This way, if there are any conflicts - GTM will just rename the tags, thus not touching any of the existing entities you have in your container. |
1. Templates are fully built, so triggers, payloads, and event names are all taken care of for you. You just need to input your specific destinations, ids, API keys etc. We’ve tried to make it as comfortable as possible, so in both containers (web and server), you will find a folder called [Stape] _Settings.
Web:
Server:
All these variables are already referenced in tags that use them; you just need to give them proper values, for example:
1.1. Pixel ID and API token can found in your pixel settings:
1.2. To find GA4 Measuremend ID: go to Admin → Data collection and modification → Data Streams.
1.3. Google Ads conversion ID and conversion label can be found when creating/editing a conversions goal in Google Ads.
Don’t forget to save your changes!
2. Once you’ve changed all these variables and saved them, your last step (assuming this a new container) is to add a preview URL in your server container by going to Admin → Container Settings. If the container is not new, just skip this step.
3. From here on you can test and publish your new setup! Yes, it’s that easy.
We have a detailed blog post on how to debug and monitor server-side tracking configuration.
Now that you have implemented and tested your setup, you might want to consider improving your tracking accuracy. For each Stape's app you can:
This power-up will help you maintain the functionality of your marketing cookies, even if they are deleted for any reason.
This feature helps make Google Tag Manager and Google Analytics 4 scripts more resistant to ad blockers and ITPs by modifying gtag.js and gtm.js loading path.
With custom domain, you can increase cookie lifetime by setting first-party cookies instead of third-party cookies.
They can significantly impact the effectiveness and flexibility of your server-side tracking.
Pre-built container templates are a fast and easy way to implement your tracking and we urge you to use them if you’re just starting or need a good skeleton for your future setup. You can and should expand on them, add custom events and tailor your setup to your specific needs. Happy Tagging!
We are happy to hear that! Click on Try for free to register and check all the possibilities.