Shopify GA4 view_item_list tracking with GTM
Set up Shopify view_item_list tracking through Customer events and GTM, with the event payload, GA4 parameters and test checks.
Shahzada Ali Hassan, founder of Crisperchecked against 14 sources
Tools
The short answer
Track Shopify collection views by mapping collection_viewed to a GA4 view_item_list tag in GTM. Googledevelopers.google.com documents an items array for ecommerce events. This guide is for store owners and implementers maintaining a custom pixel, with a development store available for testing.
- Use
collection_viewedas the Shopify sourceshopify.dev. - Set the GTM trigger to
view_item_listin this example. - If an app already sends
view_item_list, inspect it before adding a second sender. - Steps and settings checked against Shopify and Google documentation on 25 October 2026.
FREE AUDIT
NO LOGINCheck what Meta and Google can count on your site
- Your site
Crisper- Meta and Google count it
Enter your website to see how good its tracking is, and whether Meta is likely restricting it.
On this page 11 sections
- How do I track Shopify collection views in GA4?
- What do I need before adding a custom pixel?
- How do I add the custom pixel in Shopify?
- What code sends Shopify collection views to GTM?
- Which Google tag should I use?
- How do I configure view_item_list in GTM?
- How do I test view_item_list without changing live tracking?
- When is this setup the wrong fix?
- What should I compare in GA4 view_item_list?
- What should I check after this event works?
- What changed in this guide
01How do I track Shopify collection views in GA4?
Open a known collection and compare its products with collection.productVariants in Shopify's event payloadshopify.dev. Keep search results and recommendation widgets outside this collection-page test.
The video shows the older configuration and testing method; the written steps below use the current Google tag and Shopify Pixel Helper workflow.
Use a development store, a dedicated GTM test container and a test GA4 web stream. Shopify suggests testing pixels on a dev storehelp.shopify.com before adding them to a live store. Use page_view setup when checking the rest of this tracking setup.
02What do I need before adding a custom pixel?
Have access to Shopify Customer events, your GTM test container and your test GA4 web stream. Shopify warns that overlapping pixels can count events twicehelp.shopify.com; record which app or script already sends view_item_list.
1. Check the existing sender
- Before changing anything, inspect the installed apps and custom pixels.
Done when you can name the intended sender of view_item_list and the test stream that will receive it.
03How do I add the custom pixel in Shopify?
Create or extend one custom pixel under Settings > Customer events, following Shopify's setup instructionshelp.shopify.com.
2. Create the pixel in your development store
- Give the pixel a clear name and choose Add pixel.
- Review Customer privacy.
- Select permissions and data-sale settings that match the store's consent plan, using Shopify's settings guidehelp.shopify.com.
Done when the editor is open and those choices are recorded.
04What code sends Shopify collection views to GTM?
Keep the GTM loader and event subscription in the same custom pixel. Shopify's GTM tutorialhelp.shopify.com uses the head loader with its HTML script tags removed.
3. Add the loader and subscription
A callback is the function inside analytics.subscribe that runs when Shopify emits the named event.
- Add the code below to the pixel. If this pixel already loads your test container, append only the subscription and its logging helper.
- Replace
GTM-EXAMPLEwith the ID of a test container that only your development store loads. - Save the code in the development store.
// Initialize the dataLayerwindow.dataLayer = window.dataLayer || [];(function (w, d, s, l, i) { w[l] = w[l] || []; w[l].push({ "gtm.start": new Date().getTime(), event: "gtm.js" }); var f = d.getElementsByTagName(s)[0], j = d.createElement(s), dl = l != "dataLayer" ? "&l=" + l : ""; j.async = true;
79 more lines of JavaScript
- Copy and download
- Emailed to you
Unlock this snippet
Three details, and the full code is yours
No account needed. Unlock once and every snippet on the blog opens.
Done when the saved code contains your test container ID and the collection_viewed subscription.
Shopify's payload referenceshopify.dev allows null product and variant IDs. The snippet omits a missing item_id and keeps the real item_name, which Google accepts as the item identifierdevelopers.google.com. It also omits a missing auxiliary product_id; that field holds the variant ID in this example. Keep product IDs as item_id throughout the journey. If neither a usable ID nor a name is available, the snippet skips that entry, logs a diagnostic and keeps the available event amounts.
Done when a local synthetic payload with a null product ID still emits view_item_list with the real item name and no item_id property. Repeat with a null variant ID: no blank auxiliary product_id is sent. Available amounts, numeric zero and the other item fields must stay unchanged.
Read the event payload before choosing the GTM variables. Shopify's referenceshopify.dev defines this event's fields; the table shows how this example maps them.
item_list_id
- Data Layer Variable name
- ecommerce.item_list_id
- Shopify field or calculation
- data.collection.id
item_list_name
- Data Layer Variable name
- ecommerce.item_list_name
- Shopify field or calculation
- data.collection.title
items
- Data Layer Variable name
- ecommerce.items
- Shopify field or calculation
- data.collection.productVariants, mapped to GA4 items
currency
- Data Layer Variable name
- ecommerce.currency
- Shopify field or calculation
- First variant price.currencyCode, when present
page_location
- Data Layer Variable name
- page_data.url
- Shopify field or calculation
- context.document.location.href
page_title
- Data Layer Variable name
- page_data.page_title
- Shopify field or calculation
- context.document.title
page_referrer
- Data Layer Variable name
- page_data.referrer
- Shopify field or calculation
- context.document.referrer
Use the collection ID, title and product variants from Shopify's collection payloadshopify.dev. Google's view_item_list referencedevelopers.google.com defines list fields and items; this example does not invent a combined monetary value for viewing a collection.
The page fields use Shopify event context. Google configuration referencedevelopers.google.com defines page_location, page_title and page_referrer; the snippet leaves browser history alone.
05Which Google tag should I use?
Use the current Google tag for your test web stream. Google's setup guidesupport.google.com describes the Google Analytics destination and the alternate Google tag setup.
4. Confirm the base Google tag
Reuse the intended test stream configuration. For the alternate setup, as described in Google setup guidesupport.google.com:
- Choose Google tag.
- Enter its tag ID.
- Use the Initialization - All Initialization Events trigger and save.
Keep pageview setup separate from this event tag; follow the Shopify page_view guide if you need manual page context.
Done when the saved tag points to the test stream and initializes before the event tag, and the view_item_list tag has its own event trigger rather than an All Pages trigger.
06How do I configure view_item_list in GTM?
Create a Data Layer Variable for each path in the mapping table. A variable reads the value from the event object; Shopify's GTM guidehelp.shopify.com describes mapping those values into tag parameters.
5. Map the event parameters
- For each path in the mapping table, create a Data Layer Variable.
- Use Version 2support.google.com for the nested paths.
- Give each variable a clear label, such as
DLV - page_data.url. - Enter the exact field path in Data Layer Variable Name, not the display label.
Done when every parameter in the table has a matching variable.
Use a Custom Event trigger, which tells GTM when to run the tag. Its Event name must match the pushed event key, as Shopify's GTM instructionshelp.shopify.com explain.
6. Create the event trigger
- Create a Custom Event trigger.
- Enter
view_item_listexactly in Event name, with regular-expression matching off. - Select All Custom Events for this exact event name and save.
Done when the saved trigger matches the view_item_list key in the snippet.
Send view_item_list with a Google Analytics: GA4 Event tag, following Google's event-tag instructionssupport.google.com.
7. Save the GA4 Event tag
- Enter the test stream's Measurement ID.
- Set Event Name to
view_item_list. - Under Event Parameters, add the table's parameter names, using their Data Layer Variables.
- Attach the
view_item_listtrigger and save.
Done when the saved event name, destination and variable mappings match the table.
Keep items as an array of item objects, not a text string. Use the explicit parameter mappings in this guide without adding a second automatic ecommerce mapping.
07How do I test view_item_list without changing live tracking?
Check the source event and GA4 receipt in the same test session. Google's DebugView guidesupport.google.com lets you inspect received events and their parameters.
Shopify sayshelp.shopify.com Tag Assistant's Troubleshoot tag feature is incompatible with custom pixels. Use Pixel Helper for the source and DebugView for receipt; a console log alone does not show GA4 receipt.
8. Prepare the test tag for DebugView
- Add
debug_mode: trueto this test GA4 Event tag using Google's debug instructionssupport.google.com. - Save the tag.
Done when the saved test tag includes that parameter.
9. 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.
Shopify's Test control opens the pixel for testinghelp.shopify.com. It does not replace the GTM publication step above.
10. Run the event through the test container
- Open Test from the connected custom pixel.
- Grant the planned analytics consent.
- Open a collection page with known products.
- Check that Pixel Helper shows
collection_viewedwithout an error. - Open the test property's Admin > Data display > DebugView.
- Select your test device and check that
view_item_listappears with parameters that match the source values. - Repeat with a different product, quantity or page.
- Exercise the denied-consent path.
- Remove
debug_modefrom the finished configuration after testing.
Google sayssupport.google.com setting debug_mode to false does not disable debug mode.
Done when every check above passes, your notes show both results and whether they match the consent plan, and debug_mode is absent from the saved configuration.
08When is this setup the wrong fix?
A second sender, a mismatched trigger or the wrong payload needs a different fix. Check the failing stage before adding tags.
- Another app already sends the same event: Shopify warnshelp.shopify.com that overlapping pixels can double-count it. Identify the existing sender before adding this one.
- The trigger uses a friendly label rather than
view_item_list: it will not match the snippet's event key. Copy the key into the trigger. - Contact details are mapped into GA4 parameters: Google prohibits sending personally identifiable informationsupport.google.com such as email addresses and personal phone numbers. Map only the fields listed here, and review URLs and titles for personal data.
09What should I compare in GA4 view_item_list?
Compare the destination values with the action you just performed, using the fields in the mapping table.
11. Record the received event
- In DebugViewsupport.google.com, open
view_item_list. - Record its time, stream and parameters.
Done when the notes identify the tested action and explain every difference between the source payload and GA4.
10What should I check after this event works?
Compare the begin_checkout guide with the same test journey. Keep the source-event and GA4 receipt notes together so another implementer can repeat the check.
11What changed in this guide
- 25 October 2026: Corrected the view_item_list mapping, consent settings, Google tag setup and test procedure. Updated the code and completion checks; the video still shows the older method. Made test-container publication mandatory and replaced the repeated intro with the event-specific next step. Corrected nullable item IDs and added synthetic null-case completion checks without reducing event amounts.
Sources
14 sources
- 1Shopify sourceshopify.dev↩
- 2Googledevelopers.google.com↩
- 3Shopify suggests testing pixels on a dev storehelp.shopify.com↩
- 4Shopify warns that overlapping pixels can count events twicehelp.shopify.com↩
- 5Shopify's GTM tutorialhelp.shopify.com↩
- 6Google accepts as the item identifierdevelopers.google.com↩
- 7Google configuration referencedevelopers.google.com↩
- 8Google's data-layer guidedevelopers.google.com↩
- 9Google's setup guidesupport.google.com↩
- 10Version 2support.google.com↩
- 11Google's event-tag instructionssupport.google.com↩
- 12Google's DebugView guidesupport.google.com↩
- 13Google sayssupport.google.com↩
- 14Google prohibits sending personally identifiable informationsupport.google.com↩


