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.
Shahzada Ali Hassan, founder of Crisperchecked against 15 sources
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_completedas the Shopify subscription. - Use
custom_purchaseas 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.
FREE CALL
30 MINMeta stopped counting your leads? Get them counted again.
- Pick a time
Check your Meta account with Hassan- 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.
Not ready to talk? Run a free check
01How 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.
02When 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.
03How 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
- In Settings > Customer events, select Add custom pixel.
- Give the pixel a clear name.
- 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
- Copy the head snippet from your test GTM container. Use the ID of a test container that only your development store loads.
- Remove the HTML script tags, following Shopify's GTM tutorialhelp.shopify.com.
- Paste that JavaScript into the custom pixel.
- Append the subscription below.
- Save the pixel.
- Connect it when you are ready to test.
Done when Customer events shows Connected, the status required by Shopify's testing instructionshelp.shopify.com.
04Which 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.
- Append this JavaScript after the GTM loader in the same custom pixel.
// 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.
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.
05Which 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.
- In Goals > Conversions > Summary, open the conversion action you intend to test.
- Open Tag setup > Use Google Tag Manager.
- 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.
- 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.
06How 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
- Reuse the Google tag connected to the intended Ads account.
- If it is missing, create Google tag, following Google's setup instructionssupport.google.com.
- In that new tag, enter the account's Google tag ID.
- Select Initialization - All Pages.
- 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.
- Add a Custom Event trigger, which tells GTM when to run the tag, using
custom_purchasewith 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
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
- Create a Google Ads Conversion Tracking tag for this action in Tags > New > Google Ads Conversion Tracking.
- Enter the fields below. Google supports value, currency and transaction ID in addition to the required ID and labelsupport.google.com.
- 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
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.
07Does 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.
08How 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.
- Open the test container that only your development store loads.
- Select Submit, then choose Publish and Create Version.
- 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
- In Customer events, open the connected pixel.
- Select Test, following Shopify's Pixel Helper procedurehelp.shopify.com.
- Complete a test order.
- Revisit the completion page.
- Complete a different order.
- Compare each order's subtotal, currency and stable order ID.
- Open browser developer tools and keep the Network log.
- Repeat the action.
- Inspect the outgoing Google Ads conversion request for the intended account and action label, amount and currency, plus the order ID.
- 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
- Repeat the action under each consent choice.
- Compare behavior with the store's configured privacy plan.
- 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.
09What 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.
10Which 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.
11What 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.
12What 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
- 1Shopify emits checkout_completed once per checkout, sometimes on the first upsell pageshopify.dev↩
- 2Shopify calls custom pixels an advanced, unsupported feature and advises reviewing available apps firsthelp.shopify.com↩
- 3Shopify has retired checkout.liquid and Additional Scripts on Thank you and Order status pagesshopify.dev↩
- 4Shopify's settings instructionshelp.shopify.com↩
- 5Shopify's testing instructionshelp.shopify.com↩
- 6Google documents the ID as account-specific and the label as action-specificsupport.google.com↩
- 7Google's transaction-value guidesupport.google.com↩
- 8Google's setup instructionssupport.google.com↩
- 9Data Layer Variablesupport.google.com↩
- 10Google says a separate Conversion Linker is unnecessary when the container loads a Google tag on every pagesupport.google.com↩
- 11Google deduplicates repeat conversions with the same action and transaction IDsupport.google.com↩
- 12A dynamic Google Ads Remarketing tag has separate Event Name, Event Value and Event Items fieldssupport.google.com↩
- 13Retail items need id values matching a Merchant Center feed identifier; google_business_vertical identifies the retail feedsupport.google.com↩
- 14Remarketing labels are optional and only belong to tag-based lists; conversion-action labels can inflate conversion countssupport.google.com↩
- 15Google says you need to publish workspace changes to make them operationalsupport.google.com↩


