Stape

Server-side Google Ads conversion tracking in Shopify

Published
Oct 24, 2023

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

Why transitioning to server-side tracking is importantCopy link to this section

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:

  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 over the last few years. 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.

How to set up Google Ads conversion tracking for your Shopify storeCopy link to this section

shopify app Stape Server GTM

3. Configure the app.

You can use Stape Server GTM app with stape.io hosting for server Google Tag Manager or any other hostings. However, the plugin’s custom loader and cookie keeper features are exclusively functional when using stape.io.

3.1 Add web Google Tag Manager script onto every page of the website. Enable the checkbox Insert GTM snippet and add WEB Google Tag Manager ID. Once done, the stape app will insert a web GTM script into every website page.

Add web Google Tag Manager script onto every page of the website.

3.2 Add a custom domain. It's strongly advised to set up a custom domain for your tagging server because it allows the establishment of first-party cookies. Using a default domain for server GTM will result in tracking platforms, such as Google Analytics, placing cookies from the domain google-analytics.com, which are considered 3rd party cookies. Browsers with Intelligent Tracking Prevention, including Safari and Firefox, limit the lifespan of 3rd party cookies to a maximum of 7 days. However, when Google Analytics operates through a custom domain, it generates 1st party cookies, which have a potential lifespan of up to 2 years.

To set up a custom domain enable a checkbox add a custom domain and write a subdomain you’ve added to your stape account. If you have any issues with the verification of the custom domain, please use this guide to troubleshoot custom domain verification

Add a custom domain in shopify

3.3 Add a custom loader. The custom loader is a feature that conceals Google Tag Manager and Google Analytics scripts from ad blockers. This function is exclusive to those using stape.io hosting for sGTM. To activate the custom loader, simply check the designated box and input the stape container ID.

Add a custom loader in shopify

3.4 Add e-commerce events and user data to the data layer. Stape server GTM app can add user and ecommerce event data to the data layer. To enable this feature simply turn on the checkboxes Add ecommerce and user data to the Data Layer. 

The list of e-commerce events:

  • Collection view
  • View Item
  • Add to cart
  • Begin checkout
  • Add payment info
  • Purchase

User data:

  • Email
  • First name
  • Last name
  • Customer ID
Add e-commerce events and user data to the data layer in shopify

3.5 Send webhook to the server GTM container. This functionality forwards purchase and refund webhooks to the server Google Tag Manager container. For more insights on how to use webhooks in sGTM, check out our blog post. To activate webhooks, just insert your tagging server URL followed by the path where the webhook should be directed, and then choose the event you wish to transmit.

Send webhook to the server GTM container

4. Send data to the server Google Tag Manager container. In this guide we will use Google Analytics 4.

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 tagging server URL you've created in the stape container.
tagging server url in stape admin

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

Add trigger to GA4 tag. 

Optional: You can also create a Google tag: Configuration settings variable that will predefine Google Tag settings if you need to use multiple Google Tags on your website and do not want to add settings for each of the tags manually. These parameters can be, for example, a setting that defines whether you want to send a page view event every time a Google Tag triggers, set UTM parameters, client ID, etc. There is a list of standard Google Tags configuration parameters.    

5. To configure the GA4 event, navigate to the tags section and initiate a new tag, selecting the tag type as Google Analytics: GA4 Event. Input your GA4 ID along with the event name; a list of default event names is available for reference.

You also have the option to create a Google Tag: Event Settings variable. This aids in distributing event parameters among multiple GA4 event tags or Google Tags. These parameters might pertain to user attributes or product details, and a list of typical parameters for event settings is provided as well.

google analytics ga4 event
variable configuration of google tag event settings

6. Open Google Tag Manager Server container -> click Client -> create GA4 client and save it -> go to Tags and set up GA4 tag. Remember that GA4 automatically sends not only pageview but some other events. Inside Event Name choose variable {{Event Name}}. -> add trigger Client Name equals GA4.

google analytics 4 configuration
google analytics 4 trigger configuration

7. In the Server container set up the Conversion Linker tag. This tag should trigger on all pageviews. 

onversion linker tag

8. In the Server container of Google Tag Manager click New Tag -> click Tag configuration -> find 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. (looks very similar to how Facebook conversion API works). 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. My Adwords server conversion triggers on the purchase event. 

google ads conversion tracking

ConclusionCopy link to this section

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!

Need help with the setup?

Don't worry, we've got you covered! Click on Get help and we will send you a free quote.

Get help
Tagged with:Google AdsShopify

Host your GTM server at Stape