How to Setup Google Ads API Server-Side Tracking for Shopify

How do you setup conversion tracking for E-commerce websites while running Google Ads?

There’s an e-commerce client selling 100s of products on their Shopify store. I have primarily run lead generation ads where there were a handful of landing pages so conversion tracking was easy.
How would you setup conversion tracking in this case when the landing page and thank you page are different?

The short answer is:

How does using the Google Ads API improve conversion tracking accuracy for e-commerce stores?

The most robust and scalable solution for your high-volume Shopify store is to implement server-side conversion tracking leveraging the Shopify API/webhooks and the Google Ads API.

This moves purchase event data off the client’s browser, bypassing ad-blockers and privacy-driven browser restrictions, which is critical for accurate reporting on hundreds of products.

The process involves using Shopify’s webhooks or its API to securely send post-purchase data to a server-side environment like a Google Tag Manager (GTM) Server Container hosted on Google Cloud Platform (GCP) or Stape.

This server environment then forwards the cleaned and enriched data, including the critical Google Click ID (gclid) captured from the landing page, directly to the Google Ads API’s Conversion Service, ensuring near-perfect attribution and allowing for the implementation of Enhanced Conversions for superior match rates.

The long answer is:

Your challenge is moving from a simple lead generation setup to tracking complex e-commerce purchase funnels with variable landing pages and a definitive thank-you page.

The traditional method of placing a browser-side Google Ads conversion pixel on the thank-you page is unreliable for a high-volume Shopify store due to data loss from client-side factors like cookie expiration and ad-blockers.

The correct technical approach is to implement a robust server-side tracking architecture using platform APIs.

The Shopify API/webhooks are the secure, authoritative source for purchase data.

Specifically, you would configure a webhook, triggered by the orders/create event, to fire an event payload upon a successful purchase.

This payload, containing the order ID, revenue, products, and customer data (hashed for privacy), is sent to a dedicated server-side endpoint.

We recommend using a GTM Server Container for this, as it acts as a universal router for your marketing data.

Within this sGTM environment, you would use the data received from the Shopify webhook to construct a conversion event.

Crucially, you must also capture the Google Click ID (gclid) from the user’s initial ad click on the landing page via the client-side GTM container and persist it (e.g., in a first-party cookie) until the purchase occurs.

This gclid is the link that attributes the conversion to the original ad click.

The sGTM container then calls the Google Ads API’s Upload Click Conversions service, sending the gclid, conversion event data, and unique transaction ID.

This server-to-server connection is highly cost-effective because it uses your existing GTM and cloud infrastructure (GCP/Stape) to ensure maximum data accuracy for Google Ads’ Smart Bidding, leading to a much higher return on ad spend than a data-leaky client-side setup.

Furthermore, this method is privacy-compliant, as you control the data before it’s forwarded, allowing you to easily implement first-party data strategies like Enhanced Conversions to further improve match rates and bid optimization.

About The Author