Shopify server-side tracking setup

Ivanna Holubovska

Ivanna Holubovska

Author
Updated
Jun 9, 2026
Also available in

Server-side tracking (SST) is an excellent data collection method for Shopify stores, since it ensures accurate conversion tracking and compliance with privacy regulations like GDPR. With challenges such as ad blockers, browser restrictions, and cookie limitations, SST provides a more reliable solution.

Unlike traditional client-side tracking, which collects data from the user's browser via JavaScript tags, server-side tracking moves this process to your server. For anyone running a Shopify store, this means you can avoid data loss and get a clearer, more secure picture of what's happening, which ultimately helps you make better business decisions and improve your store's performance.

Related: Advertising monitoring guide in 2026.

What is server-side tracking

Server-side tracking is a modern approach to data collection that shifts the tracking process from a user's browser to a secure server. Instead of sending information like pageviews, conversions, or clicks directly from the browser to analytics and advertising platforms, this data is first routed through your own cloud server. This extra step helps ensure more accurate data by reducing the impact of browser restrictions, third-party cookie limitations, and ad blockers. It also allows you to extend cookie lifetimes and streamline data delivery to platforms like Google Analytics, Meta, TikTok, and others.

It provides a stronger foundation for privacy compliance and lets you customize the data flow to match your business needs. Tools like Google Tag Manager's server container make it easier to implement, especially when combined with services like Stape that handle the server setup. Overall, server-side tracking is a powerful way to future-proof your analytics and improve the reliability of your marketing data.

Benefits of using server-side tagging for Shopify

Server-side tagging can turbocharge the success of your marketing campaigns with precise conversion tracking and user analysis. However, taking full advantage requires a meticulous setup - something nobody should overlook.

1. Better data accuracy. Server-side tagging can help ensure more accurate data collection by reducing the risk of data loss or errors caused by ad blockers, browser extensions, or other client-side factors.

2. Accurate conversion attribution. Due to increased cookie lifetime and user data sent through the server, advertising networks can more accurately attribute conversions to marketing campaigns. This is especially useful when sending server-side events to Facebook Conversion API for Shopify, improving ad targeting, conversion attribution, and campaign ROI.

3. More flexibility in data handling and privacy management. Server-side tagging gives you more control over how data is processed and shared. You can apply filters, modify event data, and ensure that only necessary information is sent to third parties — all from a centralized tagging server. This flexibility makes it easier to align with privacy regulations like GDPR and CCPA while maintaining data quality and customer trust.

4. Consolidated data management. Route all your marketing and analytics data through one central server endpoint. This centralization reduces debugging and troubleshooting time by up to 50%, managing multiple integrations, reduces complexity from numerous tags, and ensures consistent, accurate information flows to all your advertising partners.

5. Enhanced data enrichment. Unlike browser-side tracking, server-side tagging lets you add more valuable data to your conversion events from sources like your CRM or inventory systems. Combining online and offline insights helps you build stronger audience segments and personalize your marketing more effectively.

6. Minimized risk of data manipulation. Since conversion events transmit directly from your secure server, they're far less vulnerable to external manipulation by malicious scripts or browser extensions. This direct, secure channel ensures the integrity and trustworthiness of your tracking data, providing a clean and reliable dataset for all your needs.

How to set up server-side tagging on your Shopify store

Via Stape's Conversion Tracking app

One of the most efficient ways to implement server-side tracking on Shopify is by using Stape's Conversion Tracking app. Its main purpose is to simplify the setup by injecting the Custom Loader and Cookie Keeper, and by configuring a reliable Data Layer based on native Shopify events. While the app itself doesn't send data directly to the server container, it lays the groundwork for accurate tracking by enabling your web container to capture events and pass them to server-side GTM. This reduces manual coding, speeds up implementation, and helps ensure tracking works correctly even in environments with browser restrictions - improving data quality and conversion attribution.

Case study: 36% more conversions with server-side Google Ads tracking for Shopify | Lars Friis

  • ​​Challenge: a doubt about the value of upgrading to server-side tracking from a standard client-side Shopify setup.
  • Solution: running a comparative experiment between the default Shopify app and the server-side configuration using Stape Conversion Tracking app for Shopify and Client simulator to capture orders directly from Shopify backend.
  • Results: 36% more Google Ads conversions tracked in the server-side setup thanks to recovered data from Safari users and missed receipt pages.

Read more about Google Ads Conversion Optimisation for Shopify Store in our blog article.

Start tracking in minutes. Stape Conversion Tracking for Shopify with Setup Assistant sets up server-side GTM, creates key eCommerce events automatically, and loads ready-made tags for Google, Meta, TikTok, and more. Events run through Stape’s server-side tracking platform, so you record more conversions and improve ROAS.

Via Shopify directly

A slightly more advanced method for Shopify server-side tracking is using Shopify's native capabilities like webhooks and Shopify Flow. This approach gives more flexibility for tracking backend-triggered events that may not be captured by browser-based tracking. However, both this method and solutions like Stape ultimately require server infrastructure and similar sGTM configuration.

The main difference lies in how events are triggered - with Shopify Flow or webhooks, events originate from Shopify's backend, while with tools like Stape, events are still triggered in the browser but routed through your tagging server. Both options involve configuring server-side GTM and ensuring proper formatting, deduplication, and consistency of the data.

Shopify server-side tracking with Stape's Conversion Tracking app step-by-step setup

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. 

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

Stape Conversion Tracking app in the Shopify store

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.

General tab settings
  • 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.
Container ID in GTM
  • 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 injection config
  • GTM web container ID

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

Web container ID in GTM
  • 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.

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:

  • 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" tab

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.

"Log events to console (Dev)" checkbox

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.

"Webhook" tab

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

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:

  1. Click on the Tags menu.
  2. Click New.
  3. Open your web Google Tag Manager container's Templates section → add Data Tag from the template gallery.
  4. Click on the Tag Configuration tab.
  5. Click Discover more tag types in the Community Template Gallery → search for Data Tag → click Add to workspace → click Add.
Install the Data Tag template

Step 2. Next, we’ll configure Data Tag for the pageview event:

  1. Under Event Name, you can select a standard event name, add a custom event name, or add a dynamic event name using {{Event}} variable. 
  2. 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.)
  3. Tick how you would like the data to be sent:
    1. Send all from the DataLayer - will send all the information you have in the web GTM data layer to server GTM events data.
    2. Send common data - adds to the request page_location, page_path, page_hostname, page_referrer, page_title, page_encoding, screen_resolution, viewport_size.
    3. Add consent state - adds consent_state object to the request. Including following properties: ad_storage, analytics_storage, functionality_storage, personalization_storage, security_storage.
    4. 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.
  4. Under Event Data, you can add any manual data to the request. You can also apply transformation (like hashing, trimming, etc) or store data.
  5. Under User Data, you can send user parameters and apply transformation or store data.
  6. 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.
  7. 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. 

Configure the Data Tag for other events

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. 

 In this example, all e-commerce events end with _stape

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

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

Step 4. Next, download Data Client from the GitHub:

  1. Follow this link.
  2. Click Code Download ZIP.
Download Data Client from the GitHub

Step 5. Now to import the Data Client:

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

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

Open the Clients tab and choose Data Client

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.

Open web and server GTM preview screens and test the setup

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:

  1. Click on the Variables menu.
  2. Click New under the User-Defined Variable bar. 
  3. Click on the Variable Configuration bar.
  4. Select the type Google tag: Configuration settings.
  5. Click Add parameter.
  6. Enter the following parameters:
    1. Config Parameter: server_container_url.
    2. Value: the URL of your Tag Manager server container.
  7. Give your variable a descriptive name and click Save.
Create a configuration variable for the server container URL

Step 2. Create a Google Analytics 4 tag:

  1. Click on the Tags menu.
  2. Click New.
  3. Click on the Tag Configuration tab.
  4. Select Google Analytics Google Tag.
  5. 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.)
  6. Under Configuration settings, select the server container variable you created earlier.
  7. Under Triggering, make sure the option Initialization - All pages trigger is selected.
  8. Give your tag a descriptive name and click Save.
  9. Click Publish for the container to go live.
Create a Google Analytics 4 tag

Step 3. Next, let’s see how to create a GA4 event, using the All Clicks event as an example:

  1. Click on the Tags menu.
  2. Click New.
  3. Click on the Tag Configuration tab.
  4. Select Google Analytics Google Analytics: GA4 Event.
  5. Enter your Measurement ID (from the GA4 Data streams menu.)
  6. Give your event a descriptive name.
  7. Click Triggering All Clicks.
  8. Give the tag a descriptive name.
  9. Click Save.
Example of how to create a GA4 event

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. Configure tracking inside the server Google Tag Manager container 

Most popular marketing and analytics tools already support server-side tagging and have tags for sGTM. You can find guides on our site to implement those, for example, Facebook CAPI, TikTok events API, Snapchat Conversions API, Google Ads server-side tracking, etc.

Step 5. 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:

"Network" tab in browser console

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:

Events in the web GTM Preview mode

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.
Inserting the snippet on the checkout page manually

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

Checkout page events in the web GTM Preview mode

Shopify server-side tracking: real Stape users' problems solved

A user running Shopify server-side tracking with Stape noticed one store’s Google Ads server-side purchase conversions were underreporting compared to the client-side setup, while another identical store performed correctly. In the full thread, possible causes included parallel GA4 tags sending events directly to GA, consent management issues, or Google Ads account restrictions. The solution was to check GA4 initialization, consent settings, and data mapping in triggers and lookup tables, ensuring server-side tags fire correctly for each domain. Using a single server container for multiple stores works if mapping is configured properly.

FAQ

Conclusion

Server-side tagging is quickly becoming an essential tool, making your conversion tracking and analytics much more precise. For Shopify users, the Conversion Tracking App makes this powerful setup surprisingly straightforward. It helps you get tracking running fast, even with custom domains, and ensures your data moves smoothly.

By extending cookie life and pushing back against browser privacy features, these tools guarantee your advertising and marketing platforms get truly dependable information. If you're looking for an easy, quick way to get better tracking insights on Shopify, Stape is a solid choice. Test it out yourself now - we know you won't be disappointed!

Want to start on the server side? Register now!

author

Ivanna Holubovska

Author

Ivanna is a Lead Content Manager at Stape and a certified author on Clutch and KyivPost. She writes high-quality content on server-side tracking to help businesses optimize strategies and analytics.

Comments

Try Stape for all things server-side