Google ads event on thank you page after checkout

Implement google ads events on thank you page after successful checkout.

can anyone know how we can ensure the session is maintained and we can trigger the final purchase event from the middleware thank you page to complete the user journey ?

@saurabhv ,
If you are redirecting users to a middleware Thank You page the key is to preserve the Google Click ID (gclid) or Client ID (GA4) throughout the checkout flow. Most implementations store these values in a cookie session or pass them as metadata/order attributes before redirecting.

On the middleware Thank You page fire the Google Ads purchase event using the same Client ID/Conversion Linker data so Google can attribute the conversion to the original session. If the session isnt preserved, you’ll likely see unattributed conversions.

If you are using Shopify Checkout its generally recommended to fire the purchase event from Shopifys native Thank You page or via the Web Pixels API whenever possible as its the most reliable approach.

Hey @saurabhv,

If you’re on standard Shopify checkout, the easiest way is to skip manual code and use the built-in Google & YouTube channel (or add your tag via Customer Events / Web Pixels). Shopify fires the purchase event and passes the order value for you, so you don’t have to worry about the checkout scripts being locked down.

If you’re using a custom Thank You page, just make sure the Google Click ID (gclid) carries through the whole flow (cookie or order attribute) so Google can match the sale to the original click. If that ID gets lost, conversions show up as untracked.

All in all, let Shopify’s native tools do the job, if possible. Only go custom if you really need to.

Hope that helps :slight_smile:

Hey @Priyasha I’m using custom checkout built on backend using django.

Hey @saurabhv
hope you doing well!

Are you using Checkout Extensibility or a custom Thank You page? Knowing your setup will help determine the best way to preserve the session and fire the google adds purchase event correctly.

I’m using custom thank you page.

Thanks for confirming this is a custom thank-you flow. I can’t confirm the root cause from this post alone, so use a controlled test first. These are three separate hops: (1) Shopify checkout_completed event generation, (2) app/custom pixel transport, (3) Google Ads destination ingestion. Run one fresh test order and do not change anything during the test. Record the order timestamp, checkout path, whether consent was granted, and the transaction_id, value, and currency. Step 1: validate checkout_completed fires for that order in your event output. Step 2: validate the app/custom pixel callback receives the same transaction_id, value, and currency values. Step 3: validate Google Ads receives the same values from the destination path; for Google Ads de-duplication, the same transaction_id keeps one purchase as one conversion. Then compare session continuity (gclid/client-related identifiers) across middleware redirect. A session break there often explains why Google Ads shows missing purchases even when checkout is completed. If you can share one redacted payload sample plus redacted screenshots for each hop, I can help pinpoint the break in sequence. I cannot confirm a single final cause without that evidence. Useful references: https://help.shopify.com/en/manual/promoting-marketing/pixels/overview/ and https://help.shopify.com/en/manual/promoting-marketing/pixels/custom-pixels/manage

If you’re using Shopify’s Thank You or Order Status page, the recommended approach is to trigger the Google Ads purchase conversion from that page using Shopify’s customer events or a supported integration, rather than relying on a middleware page to preserve this session.

If a middleware page is required, You’ll need to ensure that:

  • The Google click ID (GCLID) and any required identifiers are preserved from the landing page through checkout.
  • The purchase event is fired only once to avoid duplicated conversions.
  • The conversion includes the correct transaction ID and order value, so Google Ads can deduplicate events if needed.

If you’re finding that the session is being lost after checkout, it’s often because the middleware is on a different domain or the required identifiers aren’t being passed through the redirect. In those cases, using first-party cookies, URL parameters, or server-side conversion tracking can provide a more reliable solution than client-side session storage.

Could you share a bit more about your setup?

  • Are you using Checkout Extensibility with the new Thank You page?
  • Is the middleware hosted on the same domain or a different domain?
  • Are you implementing Google Ads, GA4, or Google Tag Manager for the purchase event?

That will help determine the most reliable way to maintain attribution and fire the final purchase event.

Hello there @saurabhv
For Google Ads purchase tracking, the best practice is to use Shopify’s customer events & pixels rather than relying on session persistence via a middleware thank you page. You have the ability to create the purchase event under Customer Events or if you have your own pixel that you prefer to use to track checkout completion. Use middleware only if you must, and transmit a unque order identifier which you validate server side to avoid duplicate conversions.