Shopify Google Ads view-item tracking with GTM
Track Shopify product-view conversions through Customer events and GTM, with verified Google Ads fields and a development-store testing workflow.
Shahzada Ali Hassan, founder of Crisperchecked against 14 sources
The short answer
Track Shopify product-view activity in Google Ads by connecting Customer events to a GTM conversion tag. Shopify defines product_viewed as a visit to a product details 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
product_viewedas the Shopify subscription. - Use
custom_view_itemas 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 product-view events in Google Ads?
Plan two checks before you change the mapping: a product page, where you expect one product_viewed, and a collection page, where you expect none. Write down the product and variant you will open so you can match the values later.
The video above shows the older theme Liquid 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.
Use the Shopify Google Ads purchase guide for completed sales. This product-view action should keep its own label and event trigger.
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 product-view?
Use productVariant.price from the product_viewed event referenceshopify.dev. This example sends the viewed variant's price; 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("product_viewed", (event) => { const money = event.data.productVariant?.price; const amount = money?.amount; const currency = money?.currencyCode; if (amount == null || !Number.isFinite(Number(amount)) || !currency) { throw new Error("custom_view_item needs a valid amount and currency"); } window.dataLayer.push({ ecommerce: null }); window.dataLayer.push({ event: "custom_view_item", ecommerce: { value: Number(amount),
4 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.
The snippet sends a numeric amount and its currency without an item array. The basic conversion tag accepts value and currency without product itemssupport.google.com. Dynamic remarketing is a separate mapping, discussed below.
05Which Google Ads conversion action should receive this event?
Select a dedicated product-view action so its label identifies the intended behavior.
4. Record the ID and label
Use a dedicated website conversion action named for product-view.
- 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.
- For observation, choose Secondary.
- Keep the action out of custom bidding goals: secondary actions are still used for bidding when included in a custom goalsupport.google.com.
- Choose different values for each conversion for this event-value example, following Google's value settingssupport.google.com.
Done when your notes contain this action's ID, label and chosen value setting.
06How do I map product-view 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_view_itemwith regular-expression matching off.
DLV - Value
- Data Layer Variable name
- ecommerce.value
DLV - Currency
- Data Layer Variable name
- ecommerce.currency
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
- Leave empty; this event is not an order
Trigger
- Set it to
- Custom Event: custom_view_item
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.
07Should I use product views for bidding or remarketing?
Keep product-view conversions for observation in this example; add remarketing only after verifying the feed mapping. 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.
For product-view observation, keep the action Secondary and out of custom goals. Google uses secondary actions for bidding when they are included in a custom goalsupport.google.com. Do not change campaign goals merely to install a tag.
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 product-view 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.
- Open two different product pages.
- Compare the variant price and currency in each product_viewed payload.
- Visit a collection page as a negative check.
- 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.
- 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 product_viewed 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.
- Test a local payload with a missing amount or currency; the snippet should report its mapping error instead of substituting a value.
Done when the consent checks match the plan and the missing-data test produces the stated result.
09Which 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.
10What should I check after this event is verified?
Save the source event, outgoing fields, container version and consent results with your test notes. Use the Shopify purchase guide when you are ready to check the completed sale.
11What changed in this guide
- 25 October 2026: Replaced the theme Liquid 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
14 sources
- 1Shopify defines product_viewed as a visit to a product details pageshopify.dev↩
- 2Shopify calls custom pixels an advanced, unsupported feature and advises reviewing available apps firsthelp.shopify.com↩
- 3Shopify's settings instructionshelp.shopify.com↩
- 4Shopify's testing instructionshelp.shopify.com↩
- 5The basic conversion tag accepts value and currency without product itemssupport.google.com↩
- 6secondary actions are still used for bidding when included in a custom goalsupport.google.com↩
- 7Google's value settingssupport.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↩
- 11A dynamic Google Ads Remarketing tag has separate Event Name, Event Value and Event Items fieldssupport.google.com↩
- 12Retail items need id values matching a Merchant Center feed identifier; google_business_vertical identifies the retail feedsupport.google.com↩
- 13Remarketing labels are optional and only belong to tag-based lists; conversion-action labels can inflate conversion countssupport.google.com↩
- 14Google says you need to publish workspace changes to make them operationalsupport.google.com↩


