Server-side Google Ads conversion tracking in Shopify

Ivanna Holubovska

Ivanna Holubovska

Author
Updated
Jun 9, 2026

Shopify is the top eCommerce platform that lots of business owners use to build and run their online shops. Many Shopify store owners count on Google Ads to boost their online store sales as a crucial way to connect with potential customers.

The main factor for a successful online advertising campaign is precise conversion tracking. Server-side tracking is a great way to capture accurate and comprehensive data about user interactions on your website, minimizing the impact of cookie restrictions and ad blockers.  

In this article, we will show how to implement server-side Google Ads conversion tracking for Shopify stores using Stape’s Conversion Tracking app for Shopify

Use Stape Conversion Tracking for Shopify with Setup Assistant to make tracking simple. Install server-side GTM in minutes, get eCommerce events created automatically, and load tags for Google, Meta, TikTok, and more. Events flow through Stape’s server-side tracking platform, so you capture more conversions and improve ROAS.

Why transitioning to server-side tracking is important

Server-side tracking technology has become increasingly popular in recent years, and there are several reasons for this trend. The primary factor is that server-side tracking is well-suited to the evolving landscape of tracking regulations and restrictions, making it a better choice than traditional web tracking methods. For example, the Transparent Digital Services Google Ads setup with Stape helped lower cost per purchase and keep conversion data stable across campaigns.

Below are some situations where server-sid tracking can help to increase the accuracy of tracking:

  1. Limitation on the use of third-party cookies. All popular browsers except Chrome are already limiting the use of third-party cookies. On the other hand, marketing and analytics platforms rely on third-party cookies when tracking user conversions and behaviors. Recently, Safari even started to block first-party cookies set from third-party IPs. Chrome will begin phasing out of third-party cookies in 2024. With the help of the server-side tracking, you can set first-party cookies instead of third-party or set first-party cookies from the first-party IP.
  2. Use of AdBlockers. Over the last few years the number of people who installed AdBlcokers has multiplied. With the help of server-side tracking, you can still accurately track people with adblockers.
  3. Blocking of Google Tag Manager, Google Analytics, and other tracking scripts. Safari and Brave are blocking web Google Tag Manager, GA and some other tracking scripts. When web GTM is blocked, all tracking that is supposed to trigger inside the web GTM is blocked as well. The good news is that gtm script is not blocked when you use server-side GTM with a custom domain.

One more important thing about cookies

There are cases when first-party cookies may disappear from the server response. Server-side tracking Shopify's most prominent example is its Checkout Extensibility. When used, it strips the cookie header from network requests, making it impossible to track the customer’s origin or referral source. This issue can be fixed by manually sending the cookie values to the payload, where they can later be transformed back into a format that vendor tags can read. Those who use Stape’s Data Tag can consider themselves lucky, as instead of all that manual work, they only need to tick “Send common cookies” in the settings and get everything into the payload automatically.

How to set up Google Ads conversion tracking for your Shopify store

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 

There are two most popular ways to do that:

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

Send data to Google Analytics 4 with the server Google Tag Manager container

There can be two scenarios:

If you already have GA4 events configured in your web GTM container and you just want to switch them to work through the server side

a. Open your server GTM container. In the 'Clients' section, check if you have a GA4 client there. If not, create new one:

GA4 client
GA4 client

Choose Google Analytics: GA4 (web) and click Save.

GA4 client
GA4 client

b. Create GA4 tag on server GTM container.

Go to Tags and click New.

Create GA4 tag on server GTM container
Create GA4 tag on server GTM container

Choose Google Analytics: GA4.

Choose Google Analytics: GA4
Choose Google Analytics: GA4

Standard tag settings:

Measurement ID - Leave blank, the same measurement id that is in your web events will be used

Event Name - leave blank, the same event name you use in web tags will be used.

c. Add trigger.

Click Triggering. 

Adding trigger to GA4 tag
Adding trigger to GA4 tag

Create triggers for the tag.

Client name should equal GA4. Click +

Client name should equal GA4. Click +
Client name should equal GA4. Click +

d. Choose Custom type →  click Some events →  choose Client Name in built-in variables →  set Equals GA4 (the name of your GA4 client) →  click Save. 

Equals GA4 (the name of your GA4 client)
Equals GA4 (the name of your GA4 client)

e. Add your server container URL to Google Tag settings. In the configuration settings, add the configuration parameter server_container_url and add your tagging server URL as a value. 

Server container URL
Server container URL

If you do not have GA4 configured

a. Inside the Web container, create a new tag of the tag Type Google Tag. Add your Google Tag ID.

In the section Configuration settings add the following parameters:

  • Name: server_container_url
  • Value: Enter the URL you've created

Add trigger to GA4 tag. Normally it should trigger on all page views.

Create a new tag of the tag type Google Tag
Create a new tag of the tag type Google Tag

Google tag itself will generate standard GA4 events like page_view, session_start, user_engagement, etc.

b. Setting up additional eCommerce events. 

Each event you want to configure must be configured with a separate GA4 event tag, use its own trigger and have its own payload.

Below is an example of configuring the tag for the add_to_cart event with standard parameters. You can repeat this for any other events you want to configure.

You can also use any custom events if you want to track them in your GA4.

c. Set up trigger.

d. Set up variables for GA4 events payload.

You can find the standard and mandatory payload eCommerce GA4 events in Google's official documentation.

A minimum of three parameters need to be sent with each eCommerce event:

  • value
  • currency
  • items

To add these parameters to an event, you must first create variables for them.

To do this, go to 'Variables' section in your web container → create a new one → select 'Data Layer Variable' type → specify the path to the required value as per how they are in the data layer. 

for value path: ecommerce.value

for currency: ecommerce.currency

for items: ecommerce.items

Сreate these three variables:

Data Layer variable

e. Set up GA4 event tag.

Go to the tags section in your web GTM container  and create a new tag with the tag type Google Analytics: GA4 Event

In the tag, specify:

  • Measurement ID: your GA4 measurement id
  • Event name: add_to_cart (or other if you are setting up another event)
  • On GA4 event tag ‘Event parameters’ section add three parameter: value, currency and items. Use the variables you created in the previous step as the value for them.
  • Add to the tag the add_to_cart_stape trigger we created earlier.
Google Analytics: GA4 Event
Google Analytics: GA4 Event

Similarly, configure any other events you want to track in your GA4.

Set up Conversion Linker tag + Google Ads Conversion Tracking tag

In the Server container set up the Conversion Linker tag. This tag should trigger on all events claimed by the GA4 client (the same trigger that is used for GA4 server tag, on the screenshot above).

In the Server GTM container click New Tag → click Tag configuration → Google Ads → Google Ads Conversion Tracking tag. Add Conversion ID and Conversion Label similarly to the web Adwords tag setup.

Then you have an option to add product and user data. If you send user and product data from the web to the server, then you can enable these checkboxes and select event data as a data source. If product and user info are properly sent from the web using standard dimensions and are available in the event data - the tag will parse this information automatically and report to Google Ads. You also have an ability to override the data sent from the web if needed. My Adwords server conversion triggers on the purchase event.

Google Ads Conversion Tracking tag
Google Ads Conversion Tracking tag

At this stage, you can also set up POAS Data Feed if you want Google Ads to use profit instead of only revenue. It maps margin data by product and adds profit-based values to your conversion setup

Conclusion

Setting up Google Ads conversion tracking in your Shopify store is an indispensable step for anyone aiming to harness the full potential of online advertising. As the digital marketplace becomes increasingly competitive, such insights are invaluable in staying ahead of the curve and maximizing your ROI. 

Whether you're a seasoned advertiser or just beginning your journey, ensure that your Shopify store is equipped with Google Ads conversion tracking to truly capitalize on every advertising dollar spent.

If you have any questions about the setup - don’t hesitate to leave a ticket. And if you’d like a setup from us - here’s a free quote!

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