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. |
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:
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.
Expand the collapse element below for the detailed guide on how to do it.
Step 1. Create a Google Tag Manager server container
1.1 Open your web Google Tag Manager container. Click Admin. Under the container column, click +

1.2 Type the container name, choose Server, and click Create.

1.3 Choose Manually provision tagging server, copy your container config, and paste it into any text editor. We will need it for the next steps.

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

2.2 Click Create sGTM container on the main page.

2.3. Enter your container details:
Then click Create Container.

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

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

The Stape's Conversion Tracking app for Shopify can be installed for free from the Shopify marketplace

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.

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:


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 follow the guide on custom domains to add it.
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.

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:
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.
?galid=test123 query parameter to set the _ga cookie. For example, yourwebsite.com/?galid=test123._ga, copy and paste its value somewhere, then delete the cookie (right-click on the cookie → Delete)._ga cookie has reappeared with the same value. If yes, Cookie Keeper is working correctly.
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).
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:
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.

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:
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.
There are two most popular ways to do that:
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.
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:

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

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

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

b. Create GA4 tag on server GTM container.
Go to Tags and click New.

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.

Create triggers for the tag.
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.

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.

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:
Add trigger to GA4 tag. Normally it should trigger on all page views.

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:
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:

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:

Similarly, configure any other events you want to track in your GA4.
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.

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
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!
Comments