Shopify Google Ads checkout remarketing with GTM
Set up Shopify checkout remarketing in GTM with Customer events, feed-matched item IDs and development-store checks.
Shahzada Ali Hassan, founder of Crisperchecked against 14 sources
The short answer
Track Shopify checkout activity for Google Ads remarketing with a Customer events subscription and a GTM tag. Shopify exposes checkout_started for this actionshopify.dev. This guide is for store owners and implementers replacing the older script while checking the event value, currency and feed identifiers.
- If an app already sends this event correctly, inspect it before adding another sender.
- Listen for
custom_begin_checkoutin GTM; sendbegin_checkoutto Ads. - Use a development store and a dedicated test container.
- Steps and settings checked against Google and Shopify 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 checkout activity for remarketing?
Check entry into checkout, rather than a click on the storefront checkout button: Shopify emits checkout_started on the checkout page when a customer starts checkoutshopify.dev. Put products in the cart, enter checkout, and compare the event's line items with the checkout you opened.
The video above shows the older theme-script method; follow the current written steps below for Customer events.
02Is begin_checkout a standard Google Ads remarketing event?
It is a custom choice in this guide. Google's recommended remarketing-event listsupport.google.com includes add_to_cart and purchase, but does not list begin_checkout. Keep the checkout name if you need this distinct audience signal; do not describe it as one of Google's recommended names.
03How do I load GTM through Shopify Customer events?
Put the GTM loader and subscription in the same custom pixel. Shopify's tutorialhelp.shopify.com describes this installation and suggests checking available apps before choosing custom code.
1. Create the pixel and check its permissions
- In your development store, open Settings > Customer events.
- Name the custom pixel and select Add pixel.
- Review Customer privacy using Shopify's permission and data-sale settingshelp.shopify.com.
- Choose settings that match the store's consent requirements.
Done when the pixel editor is open and its Customer privacy settings match your consent plan.
2. Add the loader and event subscription
- Copy the GTM head installation snippet and remove its HTML script tags, following Shopify's GTM tutorialhelp.shopify.com.
- Paste the JavaScript into the pixel.
- Use the ID of a test container that only your development store loads.
- Append the subscription below in the same pixel.
- Set up consent defaults and updates for the Google tags using Google's consent-mode instructionsdevelopers.google.com.
- Save the pixel.
- Connect the pixel when you are ready to test.
Shopify says its sample consent settings might not match your store's requirementshelp.shopify.com; do not copy its granted values without your consent implementation.
Done when Customer events shows Connected, the status required by Shopify's testing instructionshelp.shopify.com, and your test plan covers acceptance and refusal.
04Which Shopify fields belong in the checkout event?
Use checkout.subtotalPrice.amount for value, checkout.currencyCode for currency, and identified variants from checkout.lineItems, as defined in the Shopify event referenceshopify.dev.
3. Add the event mapping
The subscription uses raw variant IDs only when those IDs exactly match your feed.
- Append this subscription once after the GTM loader.
- Verify that your variant IDs exactly match your feed before connecting the dynamic tag.
// Append after the GTM loader in the same custom pixel.// Use raw variant IDs only if they exactly match your Merchant Center feed.window.dataLayer = window.dataLayer || [];analytics.subscribe("checkout_started", (event) => { const checkout = event.data.checkout; const amount = checkout.subtotalPrice?.amount; const currency = checkout.currencyCode; const items = checkout.lineItems .filter((line) => line.variant?.id != null && String(line.variant.id).trim() !== "") .map((line) => ({ id: String(line.variant.id), google_business_vertical: "retail", })); if (amount == null || !Number.isFinite(Number(amount)) || !currency) { throw new Error("Event mapping needs a valid amount and currency"); } window.dataLayer.push({ ecommerce: null });
9 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.
The function passed to analytics.subscribe is a callback: Shopify runs it when the subscribed event arrives. The code keeps the event value even if no usable item identifier exists; the GTM item condition below prevents an empty dynamic remarketing request.
Shopify allows a checkout line item's variant to be nullshopify.dev and defines subtotal as the amount before duties, shipping and taxes. The filter skips lines without variant IDs. If every line lacks an ID, the event remains in the data layer and the dynamic tag does not fire.
- Run a test with a null-variant fixture.
Done when the saved pixel contains one subscription for this event, and the null-variant fixture still pushes custom_begin_checkout and its original value, with that line absent from items.
05Do I need a conversion action for checkout remarketing?
No. Configure a separate conversion action only if you also need conversion reporting for this step.
A remarketing tag sends audience datasupport.google.com; a conversion tag records a separately configured conversion actionsupport.google.com. Google makes the remarketing label optionalsupport.google.com and warns that a conversion-action label in that field inflates conversion counts.
Use the intended account's Conversion ID from its Google Ads tag setupsupport.google.com. Add or reuse the associated Google tag, following Google's setup instructionssupport.google.com:
- Select Tags > New > Google tag.
- Enter its Tag ID.
- Choose Initialization - All Pages.
Google says a separate Conversion Linker is unnecessarysupport.google.com when that destination's Google tag loads on every page.
Done when the saved Google tag has the intended Tag ID and trigger, with your consent defaults and updates configured.
06How do I configure the begin_checkout remarketing tag?
Use custom_begin_checkout as the trigger name and begin_checkout as the outgoing Ads event. Keep the data-layer name and destination name separate.
Create the variables and item filter
A Data Layer Variable reads a named value from the data layer, the event data your site gives GTM.
- For each variable in the table below, open Variables > New and select Data Layer Variable, following Google's variable referencesupport.google.com.
- Enter its data layer variable name from the table, using Version 2 for nested paths, and save.
- Create a Custom JavaScript variable named
CJS - Remarketing itemswith the first function below. - Create another Custom JavaScript variable named
CJS - Has remarketing itemswith the second function below.
DLV - Value
- Data layer variable name
- ecommerce.value
- Use
- Remarketing Event Value
DLV - Items
- Data layer variable name
- ecommerce.items
- Use
- Source items for the filter below
DLV - Currency
- Data layer variable name
- ecommerce.currency
- Use
- Compare with the displayed amount
The CJS - Remarketing items function keeps existing retail IDs and drops blank ones; it does not guess a feed ID.
function() { var items = {{DLV - Items}}; if (!Array.isArray(items)) return []; return items.filter(function(item) { return item && item.id != null && String(item.id).trim() !== "" && item.google_business_vertical === "retail";
4 more lines of JavaScript
- Copy and download
- Emailed to you
Unlock this snippet
One form opens every snippet on the blog
The second function is CJS - Has remarketing items.
function() {
return {{CJS - Remarketing items}}.length > 0;
}
Done when the saved paths match the table, the saved CJS - Remarketing items code references DLV - Items, and CJS - Has remarketing items returns false for an empty item list and true for a list with a valid retail ID.
Save the trigger and remarketing tag
A trigger tells GTM when to run a tag.
- Create a Custom Event trigger named for
custom_begin_checkout. - Enter
custom_begin_checkoutas its event name. - Leave regular-expression matching off.
- Select Some Custom Events.
- Require
CJS - Has remarketing itemsequalstrueand save. - Create a Google Ads Remarketing tag and enter the intended Conversion ID.
- Leave Conversion Label blank.
- Enable Send dynamic remarketing event data.
- Set Event Name to
begin_checkout. - Set Event Items to
CJS - Remarketing items. - Set Event Value to
DLV - Value. - Attach the trigger above and save the tag.
These are the fields in Google's GTM configuration examplesupport.google.com.
Done when the saved trigger has both the exact event name and item condition, and reopening the tag shows these settings.
Keep ecommerce.currency available for the amount check. Google's dynamic-tag examplesupport.google.com maps Event Name, Event Value and Event Items; it does not map currency. The separate conversion tag has a Currency Code fieldsupport.google.com. Do not assume that a currency stored in the data layer was sent by a tag.
07How do I test Shopify checkout remarketing?
Use Shopify Pixel Helper for the customer event, then inspect the outgoing Google request. Shopify says Tag Assistant's Troubleshoot tag feature is incompatible with custom pixelshelp.shopify.com. A successful local callback is not proof of Google Ads receipt or feed matching.
Publish the version in the test container
Changes saved in a workspace do not run yet. Google sayssupport.google.com you need to publish workspace changes to make them operational.
- 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.
Follow the event through Shopify and Google
- Open the connected pixel's Test action, following Shopify's Pixel Helper procedurehelp.shopify.com.
- Exercise the store's consent choice and check that Pixel Helper opens with the expected consent status.
- Enter checkout with products in the cart.
- In Pixel Helper, expand
checkout_startedand check that its data matches the test and its indicator is green, which Shopify defines as a successful subscription and callbackhelp.shopify.com. - In browser developer tools, select the custom pixel's frame and inspect
window.dataLayer:custom_begin_checkoutshould contain the expected currency, value and only identified items. - Test a null-variant line without removing the event value.
- Enable Network recording and repeat the action.
- Inspect the Google Ads request's destination, event name, amount and item IDs: they should match the data-layer event and the intended feed entry, with no unexplained duplicate sender.
Done when every comparison above matches. Record any missing request as a failed check, not a completed setup.
08Should I keep the older theme click script?
Use the Customer events setup above for the current procedure. The older code below is kept only to identify an existing installation; do not install both senders. It listens for a button click rather than the customer event used above.
For this older normal-page installation, inspect its event in GTM Previewsupport.google.com without publishing. Done when you can identify whether the theme code or the custom pixel produced the event before retiring the older sender.
The old checkout handler fetches the cart after a click without waiting before navigation. Its async request can finish too late; the current subscription reads checkout data when Shopify emits checkout_started.
<script>
window.dataLayer = window.dataLayer || [];
</script>
{%- render 'datalayer-checkout' -%}
<script> document.addEventListener('DOMContentLoaded', () => { const checkoutButtons = document.querySelectorAll('[name="checkout"]'); checkoutButtons.forEach(button => { button.addEventListener('click', () => { fetch('/cart.js') .then(response => response.json()) .then(cartData => { const productDetails = cartData.items.map(item => ({ item_id: item.id, id: item.id, item_name: item.product_title, item_brand: item.vendor, item_category: item.product_type, quantity: item.quantity, currency: cartData.currency,
24 more lines of HTML
- Copy and download
- Emailed to you
Unlock this snippet
One form opens every snippet on the blog
{% render 'head-datalayer' %}
09When is another checkout tag the wrong fix?
Do not add a second sender when an existing integration already supplies this event. Fix the missing data or feed mapping first.
- Blank or invented IDs prevent a reliable feed match. Skip those entries and investigate the source; do not substitute a product title or made-up prefix.
- Testing only the granted-consent path leaves the refusal path unchecked. Repeat the test with both choices and record the expected tag behavior.
- A storefront data layer and a custom-pixel data layer are separate. Keep this subscription with its loader; use the theme code only to identify the older sender.
10What should I check after this event?
Compare the adjacent funnel step using the purchase remarketing guide. Save the container version, event values and request checks for the normal release review.
11What changed in this guide
- 25 October 2026: Added Customer events mapping, feed-ID filtering and test-container publishing; corrected the distinction between remarketing and conversions. Retained the older theme snippets only for identifying an existing installation. The video still shows the older method. Replaced the repeated opening with the checkout-entry distinction and a line-item comparison.
Sources
14 sources
- 1Shopify exposes checkout_started for this actionshopify.dev↩
- 2Google's recommended remarketing-event listsupport.google.com↩
- 3Shopify's tutorialhelp.shopify.com↩
- 4Shopify's permission and data-sale settingshelp.shopify.com↩
- 5Google's consent-mode instructionsdevelopers.google.com↩
- 6Shopify's testing instructionshelp.shopify.com↩
- 7remarketing tag sends audience datasupport.google.com↩
- 8conversion tag records a separately configured conversion actionsupport.google.com↩
- 9Google's setup instructionssupport.google.com↩
- 10Google says a separate Conversion Linker is unnecessarysupport.google.com↩
- 11Google's variable referencesupport.google.com↩
- 12Google's GTM configuration examplesupport.google.com↩
- 13Google sayssupport.google.com↩
- 14GTM Previewsupport.google.com↩


