Ready-to-use GTM setup: server-side tracking for Shopify

Ivanna Holubovska

Ivanna Holubovska

Author
Updated
Dec 8, 2025

In this article, you will find step-by-step instructions for installing the Stape Conversion Tracking app for Shopify and configuring server-side tracking using the Setup Assistant.

How to set up server-side conversion tracking on Shopify 

➡️ Step 1. Create web and server GTM containers

1. To configure a web container in GTM, you first need a Google Tag Manager account. If you don’t have one:

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.

Create a Google Tag Manager account

2. Under Container setup, give your web container a name → under Target platform, click the Web option → click Create.

Configure your container setup

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.

Information to install Google Tag Manager

1. Go to https://tagmanager.google.com/ → click Admin → under the container column, click +.

Add an sGTM container

2. Give your container a name → under Target platform, select Server → click Create.

Configure your container settings

3. On the Install Google Tag Manager pop-up, select the option Manually provision tagging server and copy the provided Container Config.

Copy the provided Container Config

You’ll need this Container Config to further configure an sGTM container in Stape. 

➡️ Step 2. Create a Stape account and host your server container on Stape

1. Sign up at stape.io and click the Create container button.

Log in to your stape.io account and click the Create container button

2. Enter the following container information:

  • 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 https://tagmanager.google.com/ → click Admin → click Container settings → copy the string under Container Configuration.)
Paste the Container Config data
  • 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.

Enter the container information

3. Find your container on the Stape Dashboard page. Once its status changes to Running, your Stape sGTM container has been successfully deployed.

Wait until your container is verified

1. Open your sGTM container on Stape, scroll down to Domains and click Add custom domain

2. Input a custom domain.

3. Choose if you want to use CDN for the custom domain, there are three options:

  • Disable CDN - choose not to use any type of CDN.
  • Stape Global CDN - loads scripts from a server closer to a user visiting your website.
  • Own CDN - helps to route sGTM custom domain and proxy sGTM traffic through the same IP as your website. It gives the ability to set cookies that Safari cannot shorten.

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, enter 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.

➡️ Step 3. Add and set up Stape Conversion Tracking app for Shopify 

  1. Install Stape Conversion Tracking App in store. 

2. In the Generate tab are all the settings related to installing the GTM snippet on all pages of your Shopify shop.

  • 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 use this guide to add it.

  • Custom Loader

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.

  • Cookie Keeper

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.

  • 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).

3. In the Data Layer tab you can find the data layer events to activate and configure.

Data layer activation:

  • Activate the 'Add ecommerce Data Layer events' checkbox.
  • Save changes.
  • Copy the code for custom pixel in the box below on data layer tab and follow the instructions to add and activate it.

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:

➡️ Step 4. Configure Setup Assistant

Where to find the Setup Assistant?

In the Stape admin, click on the sGTM section in the menu and locate Setup Assistant.
Then, click on Got it, let's go! to start answering the questionnaire.

Setup Assistant in the menu

Step 1. Choose type

Step 1. Choose type

Type - indicate your setup type. eCommerce setups focus on product tracking, while Lead Generation setups focus on form submissions and conversions.

Platform (if you select eCommerce as a type) - specify the CMS platform you are using (e.g., Shopify, WordPress, etc.). Setup Assistant can provide the appropriate templates and settings for your site, ensuring that everything works seamlessly with your CMS. If your platform is not on the list, select Other.

Consent settings - check the box if you have a consent provider. Then, select one from the list.

Note: If you choose Other as your consent provider, you need to specify an additional event in the dataLayer that signals a change in consent status. You can usually find this information from your consent provider or by checking the dataLayer when the consent status changes.

Step 2. Select destinations

Step 2. Select destinations

Select 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.

i

Please note

Google Ads can only be selected along with Google Analytics 4.

Step 3. Add IDs details

Lead and Schedule events (for lead generation only)

If you selected the "Lead generation" type, enter the URLs of the "thank you" pages that users reach after completing the lead form (Lead event "Thank you" page URL) and/or after scheduling a call (Schedule event "Thank you" page URL).

Use the following format:

https://yourdomain.com/thank-you-page

To proceed, you must configure at least one field.

Lead and Schedule events

Please contact your developers and request the creation of a separate thank-you page.

IDs for platforms you want to configure

Step 3. Add IDs

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. Additionally, you can add IDs directly in your web and server containers at any time.

Regardless of the platform you need to configure, the Server Container URL field is required for any.

Server Container URL in Setup Assistant

To find Server GTM container URL, log in to your Stape account → navigate to the sGTM section of the menu → choose your containerDomains (Tagging Server URLs) → copy domain name.

Server container URL

Step 4. Import templates

Step 4. Import templates

Choose how you want to import templates: automatically or manually. Click on Next.

LinkedIn

The configuration will slightly differ based on the type you’ve chosen (eCommerce or lead generation). Here, we show how to set up both.

  • Insight Tag ID - also called Partner ID is a 6-digit code that links your Ad Account and allows conversion tracking in tag managers. To get it, log in to LinkedIn Campaign Manager → Analyze → Signals manager → click on Insight Tag → Choose option: I will use a tag manager.
LinkedIn Partner ID

API Token - in Campaign Manager, → click Data on the left menu → click Sources → Select Google Tag Manager → click Generate token.

GTM token
  • Server and web conversion IDs - each conversion ID can be found in Campaign ManagerMeasurement on the left menu → click Conversion tracking → click on the name of the required conversion or create a new one.

Here is an example of the fields configuration for the eCommerce type:

LinkedIn fields configuration for the eCommerce type

Here is an example of the fields configuration for lead generation type:

LinkedIn fields configuration for lead generation type

SnapChat

  • Pixel ID - to get it, log in to Snapchat Business ManagerAssetsPixels on the left-side menu → select the required pixel if you have several → copy Pixel ID.
Snapchat Pixel ID
  • API token - to find Conversions API Tokens, go to Business DetailsConversions API Tokens. Here you will find all API tokens; you can copy the existing or create a new one.
Snapchat Conversions API Tokens

Here is an example of Snapchat fields configuration:

Snapchat fields configurations

Google Analytics 4

  • Measurement ID - go to Data Streams → click on the Data Stream → copy Measurement ID.

TikTok

  • Pixel ID - to find the Pixel ID, log in to TikTok Ads Manager → choose the Ads Manager account → Click ToolsEvents → from the side bar select Data sources.
  • eAPI Token - to get an access token, click Assets → Web Events → open pixel → click Settings → copy an existing token or click "Generate Access Token".
Access Token in TikTok

Here is an example of a field configuration for TikTok:

TikTok fields configuration

Facebook (Meta)

  • Pixel ID - it can be found in your Meta Events ManagerData Sources menu → see the string next to the Pixel’s name.
Meta Pixel ID
  • CAPI Token - to get the value, choose the PixelSettings tab → find the Conversions API section → click on the Generate access token. For more details, check Meta’s documentation.
Meta fields configuration example

Google Ads & Remarketing

The configuration will differ based on the type you’ve chosen (eCommerce or lead generation). In this section, we show how to set up both, and we will start with the eCommerce fields.

  • Conversion ID - it can be found when creating/editing a conversion goal in Google Ads  → choose “Use Google Tag Manager” → copy ID.
  • Purchase conversion, BeginCheckout conversion, AddToCart conversion - here you should place conversion labels for corresponding conversion events. Conversion labels can be found in your Google Ads accountGoalsConversions → choose the required conversion → expand “Tag Setup”  → Select "Use Google Tag Manager"  → copy Conversion label.
  • Contact, lead & schedule conversion labels - the labels can be found, as well as the Conversion ID. Select/create the goal in Google Ads that corresponds to contact, lead, and/or schedule conversion tracking. When editing/creating a goal, choose “Use Google Tag Manager” → copy ID.
Conversion label in Google Ads

Here is an example of Google Ads fields configuration for the eCommerce type:

Google Ads fields configuration for the eCommerce type

Here is an example of Google Ads fields configuration for lead generation type:

Google Ads fields configuration for lead generation type

Microsoft Ads (Bing)

The configuration will slightly differ based on the type you’ve chosen (eCommerce or lead generation). Here, we show how to set up both. We will start with the eCommerce fields.

  • Microsoft UET Tag ID - the value can be found in the Microsoft Ads accountConversionsUET tag Tag ID.
Microsoft UET Tag ID
  • Purchase conversion action, Begin Checkout conversion action, AddToCart conversion action - these fields are required for the eCommerce type. Specify the conversion action you’ve chosen when creating the conversion.

Here is an example of Microsoft fields configuration for the eCommerce type:

Microsoft fields configuration for the eCommerce type
  • Contact, lead & schedule conversion action - the fields for lead generation type. Specify the conversion action you’ve chosen when creating the conversion.

Here is an example of Microsoft fields configuration for lead generation type:

Microsoft fields configuration for lead generation type

Pinterest

  • Tag ID - to find the value, log in to your Pinterest Ads Manager → click on “Conversions” from the “Manage Business” section in the menu → on the left side menu, click on “Pinterest tag” → click on “Tag Manager” → copy ID.
Tag ID Pinterest
  • Advertiser ID - to find this ID, log in to your Pinterest Ads Manager → click on “Business manager” from the “Manage Business” section in the menu → on the left side menu, click on “Assets” → click on “Ad account” → copy ID.
Pinterest Advertiser ID
  • API Token - to find the value, log in to your Pinterest Ads Manager → click on “Conversions” from the “Manage Business” section in the menu → on the left side menu, click on “Conversions API” → click on “Set up API” → Generate new token.
Access Token Pinterest

Here is an example of Pinterest fields configuration:

Example of Pinterest fields configuration

1. Authorize with a Google account that has access to the GTM account you want to import templates into.

i

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.

i

Please note

Make sure you've checked all the boxes — if not, the auto-import won't work.

3. Make sure the templates are in your web and server GTM containers. The imported templates will be neatly organized 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

➡️ Step 5. Test and publish GTM containers

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.

With automatic event creation and Stape’s Setup Assistant, you get a ready-to-use GTM setup for Google, Meta, TikTok and more platforms.
For more details on debugging and monitoring your server-side tracking setup, refer to our guide.

Want to switch to the server side?Sign up 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