Google Ads9 min read1 view

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.

Watch on YouTube

Jump to the code

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_checkout in GTM; send begin_checkout to Ads.
  • Use a development store and a dedicated test container.
  • Steps and settings checked against Google and Shopify 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 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.

Is 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.

How 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

  1. In your development store, open Settings > Customer events.
  2. Name the custom pixel and select Add pixel.
  3. Review Customer privacy using Shopify's permission and data-sale settingshelp.shopify.com.
  4. 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

  1. Copy the GTM head installation snippet and remove its HTML script tags, following Shopify's GTM tutorialhelp.shopify.com.
  2. Paste the JavaScript into the pixel.
  3. Use the ID of a test container that only your development store loads.
  4. Append the subscription below in the same pixel.
  5. Set up consent defaults and updates for the Google tags using Google's consent-mode instructionsdevelopers.google.com.
  6. Save the pixel.
  7. 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.

Which 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.

  1. Append this subscription once after the GTM loader.
  2. Verify that your variant IDs exactly match your feed before connecting the dynamic tag.
javascript27 lines
// 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.

We email you a copy.

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.

  1. 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.

Do 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:

  1. Select Tags > New > Google tag.
  2. Enter its Tag ID.
  3. 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.

How 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.

  1. For each variable in the table below, open Variables > New and select Data Layer Variable, following Google's variable referencesupport.google.com.
  2. Enter its data layer variable name from the table, using Version 2 for nested paths, and save.
  3. Create a Custom JavaScript variable named CJS - Remarketing items with the first function below.
  4. Create another Custom JavaScript variable named CJS - Has remarketing items with 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
Read values from the event that will fire the tag.

The CJS - Remarketing items function keeps existing retail IDs and drops blank ones; it does not guess a feed ID.

javascript11 lines
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.

javascript
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.

  1. Create a Custom Event trigger named for custom_begin_checkout.
  2. Enter custom_begin_checkout as its event name.
  3. Leave regular-expression matching off.
  4. Select Some Custom Events.
  5. Require CJS - Has remarketing items equals true and save.
  6. Create a Google Ads Remarketing tag and enter the intended Conversion ID.
  7. Leave Conversion Label blank.
  8. Enable Send dynamic remarketing event data.
  9. Set Event Name to begin_checkout.
  10. Set Event Items to CJS - Remarketing items.
  11. Set Event Value to DLV - Value.
  12. 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.

How 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.

  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.

Follow the event through Shopify and Google

  1. Open the connected pixel's Test action, following Shopify's Pixel Helper procedurehelp.shopify.com.
  2. Exercise the store's consent choice and check that Pixel Helper opens with the expected consent status.
  3. Enter checkout with products in the cart.
  4. In Pixel Helper, expand checkout_started and check that its data matches the test and its indicator is green, which Shopify defines as a successful subscription and callbackhelp.shopify.com.
  5. In browser developer tools, select the custom pixel's frame and inspect window.dataLayer: custom_begin_checkout should contain the expected currency, value and only identified items.
  6. Test a null-variant line without removing the event value.
  7. Enable Network recording and repeat the action.
  8. 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.

Should 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.

liquid
 
      <script>
          window.dataLayer = window.dataLayer || [];
      </script>
    
      {%- render 'datalayer-checkout' -%}
html42 lines
<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

liquid
{% render 'head-datalayer' %}

When 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.

What 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.

What 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
  1. 1Shopify exposes checkout_started for this action↩
  2. 2Google's recommended remarketing-event list↩
  3. 3Shopify's tutorial↩
  4. 4Shopify's permission and data-sale settings↩
  5. 5Google's consent-mode instructions↩
  6. 6Shopify's testing instructions↩
  7. 7remarketing tag sends audience data↩
  8. 8conversion tag records a separately configured conversion action↩
  9. 9Google's setup instructions↩
  10. 10Google says a separate Conversion Linker is unnecessary↩
  11. 11Google's variable reference↩
  12. 12Google's GTM configuration example↩
  13. 13Google says↩
  14. 14GTM Preview↩