Ivanna Holubovska
AuthorIn this article, you will find step-by-step instructions for installing the Stape Server GTM app for Shopify and configuring server-side tracking using the Setup Assistant.
1. To configure a web container in GTM, you first need a Google Tag Manager account. If you don’t have one:
1) Go to https://tagmanager.google.com/
2) Click Accounts.
3) Click Create account (if you already have a GTM account, simply click Create container under the Container column and move to step 2).
4) Give your account a name.
2. Under Container setup, give your web container a name → under Target platform, click the Web option → click Create.
3. You’ll be given the information to install Google Tag Manager on your Shopify.
Please save this information to add it later to your Stape Server GTM app.
1. Go to https://tagmanager.google.com/ → click Admin → under the container column, click +.
2. Give your container a name → under Target platform, select Server → click Create.
3. On the Install Google Tag Manager pop-up, select the option Manually provision tagging server and copy the provided Container Config.
You’ll need this Container Config to further configure an sGTM container in Stape.
1. Sign up at stape.io and click the Create container button.
2. Enter the following container information:
Then click Create Container.
3. Find your container on the Stape Dashboard page. Once its status changes to Running, your Stape sGTM container has been successfully deployed.
1. Open your sGTM container on Stape, scroll down to “Domains” and click Add custom domain.
2. Write a custom domain.
3. Choose if you want to use CDN for the custom domain, there are three options:
By default, subdomain verification is performed by CNAME records, but if you want to verify your subdomain by A and AAAA records, select Advanced settings when adding the custom domain and tick the "Use A records instead of CNAME record" checkbox.
The DNS records you should configure vary depending on the server location and your selected CDN settings. You will see DNS records that you should add inside your stape.io container.
4. Log in to your DNS account and add the records you see in your stape.io account. Below is an example of the DNS setup for CloudFlare (check this blog post to see configuration details for other DNS providers). Open the DNS setting of the required domain and click Add record.
Then, write the records you see in your stape.io account. Ensure that the proxy is turned off.
Usually, it takes 2-3 hours to verify the custom domain. For some DNS providers, verifying records might take up to 72 hours. We will email you once the custom domain is verified or any error is detected. If there is an error with the verification, please follow this instruction on how to verify custom domain verification.
5. Once the custom domain is verified, go back to the Google Tag Manager Server container → Choose your server container → Admin → container settings → paste tagging server URL.
6. Updating the Web GTM script on your website is highly recommended. This tweak will load gtm.js from your domain. To do so, replace the default domain googletagmanager.com with the custom domain you set up in the previous step.
2. In the Generate tab are all the settings related to installing the GTM snippet on all pages of your Shopify shop.
Here you need to specify your GTM WEB container ID.
It is extremely important to use your own subdomain for first party cookies to work correctly and for tracking to work in general. If you do not already have a subdomain added to your sGTM container, you can use this guide to add it.
An optional parameter, but its use is highly recommended to increase protection against ad blockers. Specify here your Stape container identifier. Follow this guide to find Stape container identifier.
You can learn more about Cookie Keeper power-up on this page. This allows you to minimize the impact of the latest ITP restrictions. Before activating this feature, make sure you have it enabled in Stape, in your container.
Here you can take the GTM snippet to install it on pages that are outside of your Shopify theme (such as pages made by third-party apps like Zipify).
3. In the Data Layer tab you can find the data layer events to activate and configure.
Here you can find a complete list of events and their payload which is added via the Stape app.
Data layer activation:
In Customer privacy section, under Permission spoiler, please make sure to select ‘Not required’. The code snippet only generates dataLayer, it does not set any cookies or report any data to third-party.
4. Webhook events are configured in the Webhook tab.
Note: the problem with webhooks on Shopify is that they don't contain any cookie data which is crucial for tracking any platform, so using webhook events is only recommended as a last resort if you for some reason can't track it online.
This tab is where the webhook events are configured.
To activate a webhook you need to activate the checkbox, specify the url of the server GTM container and /path where the webhooks should be sent.
You can subscribe to webhooks when a new order is created or when a refund is made on an order.
Here are some useful blog posts we have about using and debugging webhooks:
Go to the “Setup Assistant” section on the menu in the Stape admin account.
Then, click on “Got it, let’s go!” to start answering the questionnaire.
Type - indicate your setup type. At the moment, only E-commerce is available. For example, eCommerce setups will focus on product tracking, while Lead Generation setups will focus on form submissions and conversions.
Platform - in our case, please select “Other”. Setup Assistant can provide the appropriate templates and settings for your site, ensuring that everything works seamlessly.
Consent settings - check the box if you have a consent provider. If yes, select one from the list.
Choose the advertising and analytics platforms you want to track (e.g., Google Ads, Meta, GA4, etc.).
Different platforms require specific tags and tracking settings. By selecting the platforms you want to track, the Setup Assistant customizes your GTM container with the necessary tags. This step ensures that your tracking setup aligns with the platforms you want to use.
Please note
Google Ads can only be selected along with Google Analytics 4.
Enter the tracking details such as your Pixel ID, Analytics ID, or other required credentials.
This information is essential for the Setup Assistant to link your site to the respective platforms. It ensures that data is sent accurately from your website to the right destination and helps you to track conversions, user interactions, and more.
Without this step, the necessary data cannot be captured and sent to your platforms. Also, you can add IDs directly in your web and server containers at any time.
API Token - in Campaign Manager, → click Data on the left menu → click Sources → Select Google Tag Manager → click Generate token.
Here is an example of Snapchat fields configuration:
Here is an example of a field configuration for TikTok:
Here is an example of Google Ads fields configuration:
Here is an example of Microsoft fields configuration:
Here is an example of Pinterest fields configuration:
1. Authorize with a Google account that has access to the GTM account you want to import templates into.
Please note
Make sure you’ve checked all the boxes — if not, the auto-import won’t work.
2. Select containers and corresponding workspaces into which you want to import templates and click “Import templates”.
Please note
An automatic import may take some time - you will receive an email notification once it’s completed. We recommend not interacting with containers until full completion to avoid interfering with the import process.
3. Make sure the templates are in your web and server GTM containers. The imported templates will be neatly organised into folders starting with “[Stape]”.
If the templates weren’t imported automatically, please try importing them manually by following the instructions.
1. Click on the green buttons to download the templates.
2. Open the Web or Server GTM container, go to the Admin tab, and click Import Container.
3. Select the file you recently downloaded from Stape.
For example, the JSON file “gtm-web-template” you downloaded (make sure you upload the correct file that matches the container type - web or server).
Select the workspace for this import - new or existing.
4. Select Overwrite or Merge.
The "Overwrite" option should only be used with a new or empty container. For this demo, we are using the Merge option with the "Rename conflicting tags, triggers, and variables" setting enabled. This ensures that GTM will simply rename the tags without altering existing entities in your container if any conflicts arise. |
5. Click “Add to workspace”.
6. Do the same within the server GTM container, making sure you import the JSON file named “gtm-server-template”.
Simply open the tags to make sure they include all the necessary data and run Preview in both web and server GTM containers.
Trigger the events on your website and check whether tags work successfully. Once confirmed, publish the changes to activate the setup.
For more details on debugging and monitoring your server-side tracking setup, refer to our guide. |
Subscribe for updates:
we don’t spam!Blog
Ensure 100% tracking accuracy on Shopify with sGTM and Stape. Don’t miss a conversion + improve attribution for better marketing insights.
Blog
Server-side tracking helped Lars Friis’ client track 36% more conversions in Google Ads compared to Shopify's Google App. Check how the result was achieved.
Comments