Google Ads9 min read1 view

Shopify Google Ads purchase tracking with GTM

Track Shopify purchase conversions through Customer events and GTM, with verified Google Ads fields and a development-store testing workflow.

Watch on YouTube

Jump to the code

The short answer

Track Shopify purchase activity in Google Ads by connecting Customer events to a GTM conversion tag. Shopify emits checkout_completed once per checkout, sometimes on the first upsell pageshopify.dev. This guide is for store owners and implementers who need a custom event mapping and can test it in a development store before planning a release.

  • Use checkout_completed as the Shopify subscription.
  • Use custom_purchase as the GTM trigger.
  • If an existing integration sends this action correctly, inspect it before adding another.
  • Steps and settings checked against Shopify and Google documentation on 25 October 2026.

Ask an assistant

ChatGPTClaudePerplexity

FREE CALL

30 MIN

Meta stopped counting your leads? Get them counted again.

  1. Pick a time
  2. Check your Meta account with Hassan
  3. See what to do next

On a free 30-minute call, Hassan checks your Meta account with you and shows you what to do next.

Book my free recovery callFree 30-minute call with Hassan.

Not ready to talk? Run a free check

How do I track Shopify purchase events in Google Ads?

This version sets the transaction ID from checkout.order.id. If your earlier setup sent the order number instead, check any report or import that matches conversions to orders before you compare old and new data.

The video above shows the older Additional Scripts checkout method; follow the current written steps below for Customer events.

When is this custom GTM setup the wrong fix?

Choose this route when you need to maintain the mapping yourself. Shopify calls custom pixels an advanced, unsupported feature and advises reviewing available apps firsthelp.shopify.com. If your current integration already sends this action correctly, adding another sender is the wrong repair.

Use a development store and a GTM test container that only that store loads. Have the intended Ads conversion action ready, along with access to Shopify Customer events and the store's consent configuration.

Shopify has retired checkout.liquid and Additional Scripts on Thank you and Order status pagesshopify.dev. Replace that route with Customer events; do not paste the old Liquid or Shopify.checkout script into the pixel editor.

How do I load GTM in Shopify Customer events?

Create a custom pixel containing the loader and this event subscription together.

1. Create the development-store pixel

  1. In Settings > Customer events, select Add custom pixel.
  2. Give the pixel a clear name.
  3. Review Customer privacy permissions using Shopify's settings instructionshelp.shopify.com and keep them aligned with the store's consent plan.

Done when the editor is open with the intended permissions.

2. Add the test-container loader

  1. Copy the head snippet from your test GTM container. Use the ID of a test container that only your development store loads.
  2. Remove the HTML script tags, following Shopify's GTM tutorialhelp.shopify.com.
  3. Paste that JavaScript into the custom pixel.
  4. Append the subscription below.
  5. Save the pixel.
  6. Connect it when you are ready to test.

Done when Customer events shows Connected, the status required by Shopify's testing instructionshelp.shopify.com.

Which Shopify fields should I send for purchase?

Use checkout.subtotalPrice.amount, checkout.currencyCode and checkout.order.id from the checkout_completed event referenceshopify.dev. This example sends the completed checkout subtotal; it does not read prices from page text.

3. Add the event subscription

The callback is the function Shopify runs when the subscribed event arrives.

  1. Append this JavaScript after the GTM loader in the same custom pixel.
javascript23 lines
// Append after the GTM loader inside the same Shopify custom pixel.window.dataLayer = window.dataLayer || []; analytics.subscribe("checkout_completed", (event) => {  const checkout = event.data.checkout;  const amount = checkout.subtotalPrice?.amount;  const currency = checkout.currencyCode;  const orderId = checkout.order?.id;   if (amount == null || !Number.isFinite(Number(amount)) || !currency || !orderId) {    throw new Error("custom_purchase needs an order ID, a valid amount and currency");  }   window.dataLayer.push({ ecommerce: null });  window.dataLayer.push({    event: "custom_purchase",    ecommerce: {      transaction_id: String(orderId),

5 more lines of JavaScript

  • Copy and download
  • Emailed to you

Unlock this snippet

Two details, and the full code is yours

No account needed. Unlock once and every snippet on the blog opens.

We email you a copy.

Done when the saved pixel contains this subscription once, with no Liquid or HTML script tags.

Shopify defines subtotalPrice as the price before duties, shipping and taxesshopify.dev. Keep that value basis when comparing reports. The snippet deliberately sends no item array: Shopify checkout line items can have variant: nullshopify.dev, and a basic conversion does not need invented product IDs.

Which Google Ads conversion action should receive this event?

Select a dedicated purchase action so its label identifies the intended behavior.

4. Record the ID and label

Use a dedicated website conversion action named for purchase.

  1. In Goals > Conversions > Summary, open the conversion action you intend to test.
  2. Open Tag setup > Use Google Tag Manager.
  3. Copy its Conversion ID and Conversion Label into your notes; Google documents the ID as account-specific and the label as action-specificsupport.google.com.
  4. Choose different values for each conversion if you want to send the order amount, as described in Google's transaction-value guidesupport.google.com.

Done when your notes contain this action's ID, label and chosen value setting.

How do I map purchase into the GTM conversion tag?

Use the snippet's trigger and nested fields exactly as written.

5. Confirm the base tag and event variables

  1. Reuse the Google tag connected to the intended Ads account.
  2. If it is missing, create Google tag, following Google's setup instructionssupport.google.com.
  3. In that new tag, enter the account's Google tag ID.
  4. Select Initialization - All Pages.
  5. Create each Data Layer Variablesupport.google.com in the table below, using Version 2 for nested paths. A Data Layer Variable reads a named value from the data layer, the data your store exposes to GTM.
  6. Add a Custom Event trigger, which tells GTM when to run the tag, using custom_purchase with regular-expression matching off.

DLV - Value

Data Layer Variable name
ecommerce.value

DLV - Currency

Data Layer Variable name
ecommerce.currency

DLV - Transaction ID

Data Layer Variable name
ecommerce.transaction_id
Variable names are local names you create; the right column must match the payload.

Google says a separate Conversion Linker is unnecessary when the container loads a Google tag on every pagesupport.google.com. If your installation still uses a Conversion Linker, check its landing-page coverage instead of adding another.

Done when the saved Google tag has the intended account ID and Initialization trigger, and the saved paths and trigger name match this table and the event payload.

6. Configure the conversion tag

  1. Create a Google Ads Conversion Tracking tag for this action in Tags > New > Google Ads Conversion Tracking.
  2. Enter the fields below. Google supports value, currency and transaction ID in addition to the required ID and labelsupport.google.com.
  3. Save the tag.

Tag type

Set it to
Google Ads Conversion Tracking

Conversion ID

Set it to
The intended Google Ads account's ID

Conversion Label

Set it to
The label from this event's conversion action

Conversion Value

Set it to
{{DLV - Value}}

Currency Code

Set it to
{{DLV - Currency}}

Transaction ID

Set it to
{{DLV - Transaction ID}}

Trigger

Set it to
Custom Event: custom_purchase
The conversion action is selected by its label, not by the GTM trigger name.

Done when reopening the tag shows the intended action, these mappings and the event-specific trigger.

An empty or undefined Conversion Value is sent as 0support.google.com. If the value variable is missing, fix the payload before proceeding. Google requires numeric conversion values and an ISO 4217 currency codesupport.google.com.

Google deduplicates repeat conversions with the same action and transaction IDsupport.google.com. This snippet uses Shopify's order ID, not the old order number. Review any downstream comparison that relied on the previous ID format.

Does this conversion tag also configure dynamic remarketing?

No product remarketing tag is configured by this minimal conversion example. A dynamic Google Ads Remarketing tag has separate Event Name, Event Value and Event Items fieldssupport.google.com. Retail items need id values matching a Merchant Center feed identifier; google_business_vertical identifies the retail feedsupport.google.com. Verify the actual feed before adding that mapping. Never send a blank ID or assume a Shopify variant ID matches the feed.

Remarketing labels are optional and only belong to tag-based lists; conversion-action labels can inflate conversion countssupport.google.com. Keep this action's label on the conversion tag only.

How do I test Shopify purchase tracking?

Publish the test-container version first, then use Shopify Pixel Helper and inspect the Google request separately.

7. Publish the version in the test container

Changes saved in a workspace do not run yet. Google says you need to publish workspace changes to make them operationalsupport.google.com, and Tag Assistant's troubleshooting feature does not work inside Shopify custom pixelshelp.shopify.com.

  1. Open the test container that only your development store loads.
  2. Select Submit, then choose Publish and Create Version.
  3. Name the version and publish.

Do not publish to a container your live store loads; move the tested setup there through your normal release process.

Done when the test container's Versions list shows your version as published and the pixel code loads that container's ID.

8. Follow the event from Shopify to the outgoing tag

  1. In Customer events, open the connected pixel.
  2. Select Test, following Shopify's Pixel Helper procedurehelp.shopify.com.
  3. Complete a test order.
  4. Revisit the completion page.
  5. Complete a different order.
  6. Compare each order's subtotal, currency and stable order ID.
  7. Open browser developer tools and keep the Network log.
  8. Repeat the action.
  9. Inspect the outgoing Google Ads conversion request for the intended account and action label, amount and currency, plus the order ID.
  10. Record the request check separately.

A green Pixel Helper event means the pixel code ran without an errorhelp.shopify.com; it is not proof of Google Ads attribution.

Done when checkout_completed has a green dot, its source values agree with the test and the code has no error, and the outgoing fields agree with the Shopify payload with no unexplained duplicate request.

9. Check consent and missing data

  1. Repeat the action under each consent choice.
  2. Compare behavior with the store's configured privacy plan.
  3. Use a local test payload with a null-variant checkout line item; the conversion should still carry its valid subtotal and currency without any items.

Done when the consent checks match the plan and the missing-data test produces the stated result.

What else affects Shopify purchase events?

Why is there no new purchase event on the Thank you page after an upsell?

Shopify can emit checkout_completed on the first upsell offer page insteadshopify.dev. It does not repeat the event on the Thank you page, so inspect the earlier event before changing the trigger.

What if the completion page never loads?

Shopify says checkout_completed is not triggered if its relevant page fails to loadshopify.dev. Compare received events with store orders when checking coverage.

Which mistakes should I check first?

Check the event boundary, destination label and test version before adding more code.

  • Wrong action label: the request goes to a different conversion action. Copy the label from the exact action named in your test notes.
  • Unpublished test workspace: the sandbox still loads the previous version. Confirm the published test-container version and its ID.
  • Duplicate subscriptions or senders: the same action produces extra requests. Keep one deliberate sender for this conversion action.

What should I check after this event is verified?

Save the source event, outgoing fields, container version and consent results with your test notes. Compare earlier funnel stages using the Shopify checkout-start guide.

What changed in this guide

  • 25 October 2026: Replaced the Additional Scripts checkout method with Customer events, added event-specific value mappings and test-container publishing, and corrected conversion versus remarketing fields. The video still shows the older method.

Sources

15 sources
  1. 1Shopify emits checkout_completed once per checkout, sometimes on the first upsell page↩
  2. 2Shopify calls custom pixels an advanced, unsupported feature and advises reviewing available apps first↩
  3. 3Shopify has retired checkout.liquid and Additional Scripts on Thank you and Order status pages↩
  4. 4Shopify's settings instructions↩
  5. 5Shopify's testing instructions↩
  6. 6Google documents the ID as account-specific and the label as action-specific↩
  7. 7Google's transaction-value guide↩
  8. 8Google's setup instructions↩
  9. 9Data Layer Variable↩
  10. 10Google says a separate Conversion Linker is unnecessary when the container loads a Google tag on every page↩
  11. 11Google deduplicates repeat conversions with the same action and transaction ID↩
  12. 12A dynamic Google Ads Remarketing tag has separate Event Name, Event Value and Event Items fields↩
  13. 13Retail items need id values matching a Merchant Center feed identifier; google_business_vertical identifies the retail feed↩
  14. 14Remarketing labels are optional and only belong to tag-based lists; conversion-action labels can inflate conversion counts↩
  15. 15Google says you need to publish workspace changes to make them operational↩