Shopify is the top e-commerce 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 server GTM app for Shopify.
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.
Below are some situations where server-sid tracking can help to increase the accuracy of tracking:
2.1. Install Stape Server GTM App in store.
Activate the app in Sales channels → Online Store → your active theme → Customize button → App embeds tab → activate Stape server GTM app and click Save.
2.2. In the Generate tab are all the settings related to installing the GTM snippet on all pages of your Shopify shop.
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 use this guide to add it.
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.
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.
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. In the Data Layer tab you can find the data layer events to activate and configure.
Here you can find a complete list of events and their payload which is added via the Stape app.
Data layer activation:
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.
2.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:
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 the official documentation: https://developers.google.com/tag-platform/gtagjs/reference/events
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.
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!
All it takes is a few simple steps. Click Try for Free , and configure your server Google tag Manager container with Stape in just 3 minutes.