Shopify GA4 view_item_list tracking with GTM
Track Shopify collection views with GA4 view_item_list, map the list name and items in GTM and check the actual products included.
Shahzada Ali Hassan, founder of Crisperchecked against 15 sources
Tools
The short answer
Track Shopify collection views by sending GA4 view_item_list with the displayed products and list name through GTM. Google's ecommerce guidedevelopers.google.com uses this event when a list of items is presented. This guide is for implementers maintaining a theme-based collection data layer and checking which products its payload actually includes.
- If the app already sends view_item_list, inspect it before adding a tag.
- Use
custom_view_item_listin GTM andview_item_listin GA4. - The collection snippet belongs on collection pages, not product pages.
- Steps and settings checked against Google and Shopify 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 14 sections
- What does GA4 view_item_list measure?
- When should I use this collection snippet?
- How do I prepare the Shopify theme?
- How do I check the storefront container?
- Which Google tag should send data to GA4?
- How do I check the base tag before product lists?
- What code sends the collection to the data layer?
- How do I check that the right products are included?
- How do I configure the GA4 view_item_list tag?
- How do I test the collection tag in GTM?
- How do I verify view_item_list in GA4?
- Why does view_item_list show the wrong products?
- What should I verify after collection tracking?
- What changed in this guide
01What does GA4 view_item_list measure?
Record the collection name and the products shown before testing its event. Compare that list with items and item_list_name in Google's view_item_list referencedevelopers.google.com.
The video shows the older tag setup; use the current written steps for the exact event names and Google tag configuration.
02When should I use this collection snippet?
Use it for a storefront theme whose rendered collection matches the snippet's product list. Google's current Shopify app guidesupport.google.com includes view_item_list, so first check the native GA4 integration.
This walkthrough uses GTM installed in the storefront theme. It does not feed a GTM container loaded inside a custom pixel; Shopify's migration tutorialhelp.shopify.com uses a subscription or an explicit published custom event to cross that boundary. Keep these theme snippets with the storefront container.
This example reads the collection during page rendering. It is the wrong fix for a list that changes through filtering or infinite scrolling without a new page load; those changes need their own event-time mapping.
03How do I prepare the Shopify theme?
Use a development theme with the test storefront container installed.
1. Prepare the test theme
- Work on a development store.
- Duplicate the theme before editing, as Shopify's code-editing guidehelp.shopify.com advises.
- Confirm the storefront has the intended test GTM container.
Done when Preview connects to that container in the development theme.
04How do I check the storefront container?
Connect GTM Preview to the development storefront. Done when the expected container appears, using Google's Preview proceduresupport.google.com.
05Which Google tag should send data to GA4?
Use the Google tag for the intended web stream.
2. Confirm the destination
Google's setup guidesupport.google.com documents the Google Analytics destination and the alternate Google tag method.
- Reuse the store's Google tag and GA4 web stream.
- For Google's alternate methodsupport.google.com, enter the stream's Measurement ID as Tag ID.
- Give that Google tag an Initialization trigger.
Done when the saved ID matches the intended stream.
06How do I check the base tag before product lists?
Open a collection in Preview and check the Google tag's configured destination. Done when it fires with the intended stream ID before you test the list mapping.
07What code sends the collection to the data layer?
Render datalayer-collection from head-datalayer only on collection templates. Shopify's template referenceshopify.dev exposes template.name separately from an alternate template's suffix.
3. Create head-datalayer.liquid
- Copy the code below.
- Save it as snippets/head-datalayer.liquid.
<script>
window.dataLayer = window.dataLayer || [];
</script>
{%- if template.name == 'collection' -%}
{%- render 'datalayer-collection', collection: collection -%}
{%- endif -%}
Done when its guard checks template.name for collection.
4. Create datalayer-collection.liquid
- Copy the next snippet.
- Save it as snippets/datalayer-collection.liquid.
<script> console.log("datalayer-collection snippet is loaded") dataLayer.push({ ecommerce: null }); dataLayer.push({ event: "custom_view_item_list", ecommerce: { currency: {{ cart.currency.iso_code | json }}, item_list_name: {{ collection.title | json }}, items: [{%- for product in collection.products -%}
18 more lines of Liquid
- 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 it pushes custom_view_item_list, the collection title and product objects.
5. Render the head snippet once
- Copy the next line.
- Insert it once in the development theme's theme.liquid.
{% render 'head-datalayer' %}
Done when the collection page source contains one list payload.
08How do I check that the right products are included?
Compare the pushed array with the products actually shown on the collection page.
6. Inspect the collection payload
- Open the collection in Preview.
- Inspect custom_view_item_list.
- Check an alternate collection template too.
Do not test a product page for this event.
Done when items and item_list_name match the rendered list.
Shopify defines variant.price in the customer's presentment currencyshopify.dev, while shop.currency is the store currencyshopify.dev. Use cart.currencyshopify.dev, which follows presentment currency, and its iso_codeshopify.dev to label the rendered prices. The snippet keeps product IDs; compare them with the variant IDs in the product-view guide if your reports need one identifier convention.
09How do I configure the GA4 view_item_list tag?
Map the items array, event currency and list name into a GA4 Event tag.
7. Create the variables and trigger
- Create Data Layer Variablessupport.google.com, which read named values from the data layer.
- Choose Version 2 for nested fieldssupport.google.com.
- Enter the paths below.
- Create a Custom Event trigger for custom_view_item_list with regular-expression matching off.
- Create a Google Analytics: GA4 Eventsupport.google.com tag.
- Enter the intended Measurement ID.
- Set Event Name to
view_item_list. - Map each table row in Event Parameters.
- Attach the
custom_view_item_listCustom Event trigger. A trigger is the condition that runs a tag. - Save the tag.
items
- Data Layer Variable path
- ecommerce.items
- Check
- Products shown in this list
currency
- Data Layer Variable path
- ecommerce.currency
- Check
- Presentment currency matching item prices
item_list_name
- Data Layer Variable path
- ecommerce.item_list_name
- Check
- Collection title
Done when each saved variable has the correct path, the trigger's saved name matches the collection snippet, and reopening the tag shows that event name, stream, parameters and trigger.
Google's event referencedevelopers.google.com defines currency at event level and item prices in that currency. Map ecommerce.currency in Event Parameters, even though the snippet also retains item currency. This list snippet does not calculate a value, so do not add one.
10How do I test the collection tag in GTM?
Inspect the event and fired tag in the development storefront.
8. Test the list tag
Google's Preview guidesupport.google.com explains how to inspect fired tags and their data.
- Connect GTM Preview.
- Open the test collection.
- Inspect
custom_view_item_listand its ecommerce payload.
Done when the expected GA4 tag fires with the product fields from this visit.
11How do I verify view_item_list in GA4?
- Enable debug modesupport.google.com.
- Inspect the list event in GA4 DebugView.
- Switch the development storefront to a second presentment currency different from the shop currency.
- Reload the collection page.
- Confirm that no list value was added.
Done when the received item_list_name and items match the collection you opened, and in the second currency the event currency, item currencies and rendered unit prices agree in GTM Preview and the fresh GA4 DebugView event.
12Why does view_item_list show the wrong products?
Check the rendered list, template guard and saved snippet name.
- Saving the code as datalayer-product leaves the collection render pointing at the wrong file. Use datalayer-collection.liquid.
- Firing custom_view_item tests a different action. Inspect custom_view_item_list on the collection page.
- A collection loop may not match a paginated or filtered grid. Compare the actual visible products before accepting the event.
13What should I verify after collection tracking?
Test Shopify product views and cart additions next. Keep the identifier convention deliberate across those events.
14What changed in this guide
- 25 October 2026: Corrected collection setup that named a product snippet/event, made the template guard work with alternate collection templates, added GA4 list parameters and documented rendered-list scope. Corrected Liquid prices to use presentment currency, mapped currency at event level and added a second-currency check without inventing a list value. Replaced the repeated opening with an event-specific test instruction.
Sources
15 sources
- 1Google's ecommerce guidedevelopers.google.com↩
- 2Google's view_item_list referencedevelopers.google.com↩
- 3Google's current Shopify app guidesupport.google.com↩
- 4Shopify's migration tutorialhelp.shopify.com↩
- 5Shopify's code-editing guidehelp.shopify.com↩
- 6Google's Preview proceduresupport.google.com↩
- 7Google's setup guidesupport.google.com↩
- 8Shopify's template referenceshopify.dev↩
- 9Shopify defines variant.price in the customer's presentment currencyshopify.dev↩
- 10shop.currency is the store currencyshopify.dev↩
- 11cart.currencyshopify.dev↩
- 12iso_codeshopify.dev↩
- 13Data Layer Variablessupport.google.com↩
- 14Google Analytics: GA4 Eventsupport.google.com↩
- 15debug modesupport.google.com↩

