How to set up Shopify app
Updated Jul 17, 2026
Note
The standard configuration of server-side tagging for Shopify is straightforward with Stape's Conversion Tracking app. The app will help you implement a modified gtm.js script to the Shopify store, send data to sGTM using webhooks, and transmit data layer pushes to the web container.
Step 1. Set up the server Google Tag Manager container on Stape
Expand the collapse element below for the detailed guide on how to do it.
How to configure the server GTM container
Step 1. Create a Google Tag Manager server container
➡️ Note
Before setting up your server-side Google Tag Manager container, it’s important to have web GTM container configured, because:
- The web container collects events, parameters and user interactions on your website.
- And sends this data to your server-side container.
Please follow the official Google documentation.
1. Select your GTM account → Click Admin → Click + next to the Container name.

2. Add Container Name → Under Target platform, choose Server. Click Create.

3. Choose Manually provision tagging server. Copy your container config. We will need it in the following steps.

Step 2. Create a Stape account to host your server GTM container
1. Go to stape.io and create an account or log in.

2. Click Create sGTM container on the main page.

3. Enter your container details.
- Container name - give your container a name (for convenience, we recommend using the same name you gave to the server container in GTM).
- Container configuration - paste the Container Config data that you copied from the Install Google Tag Manager pop-up. If you lost it, go to Google Tag Manager → click Admin → click Container settings → copy the string under Container Configuration.
- Server location - for best performance, choose the server location that’s closest to where most of your clients are. See the list of available server locations here. Also, you can opt for the Global multi-zone server location option if you have traffic from different regions. It will automatically route incoming requests to the nearest available zone based on the user’s IP address.
Then click Create Container.

4. Choose a plan for your container. You can start with a Free plan. Click Continue with a Free plan.

5. You will see the status of your container, container config, and plan name. It takes around 5 minutes to deploy a server container.
Please reload the page to update the status. If the Google Tag Manager server-side setup was done correctly, you should see the status Running.

Step 2. Add and configure Stape's Conversion Tracking app for Shopify
2.1 Install the Stape Conversion Tracking app in the store
The Stape's Conversion Tracking app for Shopify can be installed for free from the Shopify marketplace

2.2 Configure General tab
In the Generate tab are all the settings related to adding the GTM snippet on all pages of your Shopify shop in a way that makes it resistant to ad blockers / ITP / cookie lifetime limitations before installing it on all pages of your Shopify shop.

- Use Shopify Markets
Check the box if you have multiple Shopify markets. Using the feature, you can configure GTM injection separately for each Shopify market. If the feature is disabled, all markets use the default setup.
When enabled, you will see the fields required to configure for each market:
- Insert GTM - if checked, the GTM snippet is added to each website page.
- GTM container ID - the ID from your web GTM container.

- Customer privacy API - if enabled, the app holds GTM loading until the visitor accepts cookies through Shopify's Customer Privacy banner. By default, the option isn't recommended.
- Custom domain, Stape container ID, and Cookie Keeper - the fields are associated with server-side tracking; you need to configure them if you use/going to use the server-side setup. Below, we explain where to find values for each field.

- GTM web container ID
Here, you need to specify your GTM web container ID.

- Custom domain
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 follow the guide on custom domains to add it.
- Custom Loader
Its use is highly recommended to increase protection against ad blockers.
Click on the corresponding check box and specify your Stape container identifier. To find it, log in to your Stape account, select the sGTM container, and find the container identifier in the Settings section.

- Cookie Keeper
The power-up allows you to minimize the impact of the latest ITP restrictions. Before activating this feature via the app, make sure you have it enabled in Stape in your container. To configure Cookie Keeper, click on the collapse element below and follow the instructions:
How to configure Cookie Keeper
1. Log in to your Stape account and select your sGTM container from the dashboard.

2. Go to Power-ups and click Use next to the Cookie Keeper panel.

3. Toggle the Cookie Keeper switch to enable it.

4. Under Standard cookies, select which cookies to extend.

Custom cookies
If the cookies you need aren't in the standard list, you can configure custom cookies. Enter the cookie name and optionally set an expiration in days (leave blank to keep indefinitely).

5. Click Save changes.
Test the setup
The steps below use the Google Analytics _ga cookie as an example, but you can apply the same flow for any platform. To test the flow, make sure you've set up at least one GA4 tag.
- Open the Safari browser. The version shouldn't be older than 16.4. To confirm the version, click Safari in the menu bar and select About Safari.
- Enter your site's URL with the appended
query parameter to set the?galid=test123cookie. For example, yourwebsite.com/?galid=test123._ga - Right-click the page → Inspect Element → Storage tab → Cookies.
- Locate
, copy and paste its value somewhere, then delete the cookie (right-click on the cookie → Delete)._ga - Refresh the page twice.
- Confirm the
cookie has reappeared with the same value. If yes, Cookie Keeper is working correctly._ga

- GTM snippet block
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).
2.3 Set up Data Layer tab
In the Data Layer tab, you can find the data layer events to activate and configure. The second box gives you control over whether event names get the _stape suffix to prevent any clashes in GTM. If it's off, events keep their normal names.

Data layer activation:
- Activate the Add ecommerce Data Layer events checkbox.
- Save changes.
- Copy the code for the custom pixel in the box below on the data layer tab and follow the instructions to add and activate it.
In the Customer privacy section, under Permission spoiler, please make sure to select Not required. The code snippet only generates the Data Layer; it does not set any cookies or report any data to third parties.
In the Data Layer tab of the app, there is also an option Log events to console (Dev), which is a debugging option for developers and store admins. When enabled, it logs eCommerce events in the browser console, shows event payloads sent to the GTM/Stape server container for verification, and helps debug Data Layers.
This option is for development only and should be disabled in production to avoid unnecessary console logging.

2.4 Configure Webhooks tab
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:
2.5 The Customer Match tab
It allows you to automatically populate and update the Customer Match lists in Google Ads.
Skip the configuration in this tab if you don't run Google Ads campaigns or don't use Customer Match lists.
Step 3. Send data to the server Google Tag Manager container
The server container has no direct access to browser-side data – such as the data layer, cookies, or page context – so this data must be explicitly sent from the web container. Two methods are available for this:
- Data Tag, paired with Data Client in the server container to receive and parse its requests, sends data layer variables and other parameters independently of any specific platform;
- Google Analytics 4, which sends data via a Google Tag configured with the server container's URL. Both methods are covered below.
Send data from web to server container via Data tag
Step 1. Install the Data Tag template:
- Click on the Tags menu.
- Click New.
- Open your web Google Tag Manager container's Templates section → add Data Tag from the template gallery.
- Click on the Tag Configuration tab.
- Click Discover more tag types in the Community Template Gallery → search for Data Tag → click Add to workspace → click Add.

Step 2. Next, we’ll configure Data Tag for the pageview event:
- Under Event Name, you can select a standard event name, add a custom event name, or add a dynamic event name using {{Event}} variable.
- Enter your GTM Server Side URL (you can find your GTM server-side URL inside the stape.io account by opening the sGTM container and checking the Domain section.)
- Tick how you would like the data to be sent:
- Send all from the DataLayer - will send all the information you have in the web GTM data layer to server GTM events data.
- Send common data - adds to the request page_location, page_path, page_hostname, page_referrer, page_title, page_encoding, screen_resolution, viewport_size.
- Add consent state - adds consent_state object to the request. Including following properties: ad_storage, analytics_storage, functionality_storage, personalization_storage, security_storage.
- Add Common Cookie - the tag will send common cookies in eventData to avoid some e-commerce platform’s limitations. For example, this is required for events that work on Shopify checkout pages.
- Under Event Data, you can add any manual data to the request. You can also apply transformation (like hashing, trimming, etc) or store data.
- Under User Data, you can send user parameters and apply transformation or store data.
- Under Settings and Advanced Settings, you will find exactly that - advanced configuration options. Unless you know what you’re doing, it’s best not to modify these settings.
- Give your tag a descriptive name and click Save.
Step 3. Next, you can configure the Data Tag for other events. The example below shows how to configure e-commerce events when Data Layer is available.

This tag triggers each e-commerce event in the Data Layer. In this example, all e-commerce events end with _stape, so we’re using a regex that includes all events that contain _stape.

Example of the variable that extracts user data from the Data Layer.

Step 4. Next, download Data Client from the GitHub:
- Follow this link.
- Click Code → Download ZIP.

Step 5. Now to import the Data Client:
- Open your server Google Tag Manager container.
- Click Templates.
- Under Clients, click New.
- Click three dots in the top right corner.
- Click Import and select the Data Client you downloaded from GitHub (you may have to unzip the archive first.)
- Once the import is done, click Save.

Step 6. Open the Clients tab and click New → choose Data Client → click Save.

Step 7. Open web and server GTM preview screens and test the setup. You should see Data Tag triggered in the web GTM container and Data Client parsed Data Tag requests in the sGTM.

How to send data from web to server container via Google Analytics 4
Step 1. Create a configuration variable for the server container URL. To do that:
- Click on the Variables menu.
- Click New under the User-Defined Variable bar.
- Click on the Variable Configuration bar.
- Select the type Google tag: Configuration settings.
- Click Add parameter.
- Enter the following parameters:
- Config Parameter: server_container_url.
- Value: the URL of your Tag Manager server container.
- Give your variable a descriptive name and click Save.

Step 2. Create a Google Analytics 4 tag:
- Click on the Tags menu.
- Click New.
- Click on the Tag Configuration tab.
- Select Google Analytics → Google Tag.
- Under Tag ID, enter the ID from your GA4 account (to find it, go to your GA4 → click Admin → Data streams → select the stream → see Measurement ID.)
- Under Configuration settings, select the server container variable you created earlier.
- Under Triggering, make sure the option Initialization - All pages trigger is selected.
- Give your tag a descriptive name and click Save.
- Click Publish for the container to go live.

Step 3. Next, let’s see how to create a GA4 event, using the All Clicks event as an example:
- Click on the Tags menu.
- Click New.
- Click on the Tag Configuration tab.
- Select Google Analytics → Google Analytics: GA4 Event.
- Enter your Measurement ID (from the GA4 Data streams menu.)
- Give your event a descriptive name.
- Click Triggering → All Clicks.
- Give the tag a descriptive name.
- Click Save.

Setting up conversion tracking with various platforms
Next, you'll need to configure sending your event data to your marketing / analytics platform. Exact steps will depend on your choice of platform. Check out our guides on the popular platforms for more information:
Step 4. Test the app configuration
Debugging a GTM download
After activation or any changes, it is recommended to check if your container is actually uploaded to the site.
To do this, go to any page on your site, open your browser console, and in the network tab, filter by your subdomain/tagging server URL. You should see a request like in the following screenshot with a response status 200:

Debugging data layer checkout events
With events that happen before the checkout page, everything works like on any other platform - you can launch a preview of your GTM web container and find all the events you do:

The checkout events won't be displayed in GTM Preview due to the isolated environment on these pages that blocks unrestricted DOM manipulation or script injection, including the GTM snippet.
But you can manually insert the snippet on the checkout page using the Stape GTM Helper Chrome extension:
- After running Preview Mode in GTM, turn on the toggle Shopify Sandbox dataLayer in the Settings tab of the extension.
- In the tab Inject GTM, click Enable injection, add your domain name, and GTM ID. Save changes.

Now, the events on the checkout page will display in GTM Preview.

Was this article helpful?
Comments