Shopify6 min read2 views

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.

Watch on YouTube

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_list in GTM and view_item_list in GA4.
  • The collection snippet belongs on collection pages, not product pages.
  • Steps and settings checked against Google and Shopify documentation on 25 October 2026.

Ask an assistant

ChatGPTClaudePerplexity

FREE AUDIT

NO LOGIN

Check what Meta and Google can count on your site

  1. Your site
  2. Crisper
  3. Meta and Google count it

Enter your website to see how good its tracking is, and whether Meta is likely restricting it.

Run a free audit

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

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

How do I prepare the Shopify theme?

Use a development theme with the test storefront container installed.

1. Prepare the test theme

  1. Work on a development store.
  2. Duplicate the theme before editing, as Shopify's code-editing guidehelp.shopify.com advises.
  3. Confirm the storefront has the intended test GTM container.

Done when Preview connects to that container in the development theme.

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

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

  1. Reuse the store's Google tag and GA4 web stream.
  2. For Google's alternate methodsupport.google.com, enter the stream's Measurement ID as Tag ID.
  3. Give that Google tag an Initialization trigger.

Done when the saved ID matches the intended stream.

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

What 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

  1. Copy the code below.
  2. Save it as snippets/head-datalayer.liquid.
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

  1. Copy the next snippet.
  2. Save it as snippets/datalayer-collection.liquid.
liquid27 lines
<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.

We email you a copy. We may follow up on WhatsApp.

Done when it pushes custom_view_item_list, the collection title and product objects.

5. Render the head snippet once

  1. Copy the next line.
  2. Insert it once in the development theme's theme.liquid.
liquid
 
       {% render 'head-datalayer' %}

Done when the collection page source contains one list payload.

How 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

  1. Open the collection in Preview.
  2. Inspect custom_view_item_list.
  3. 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.

How 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

  1. Create Data Layer Variablessupport.google.com, which read named values from the data layer.
  2. Choose Version 2 for nested fieldssupport.google.com.
  3. Enter the paths below.
  4. Create a Custom Event trigger for custom_view_item_list with regular-expression matching off.
  5. Create a Google Analytics: GA4 Eventsupport.google.com tag.
  6. Enter the intended Measurement ID.
  7. Set Event Name to view_item_list.
  8. Map each table row in Event Parameters.
  9. Attach the custom_view_item_list Custom Event trigger. A trigger is the condition that runs a tag.
  10. 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
These paths must match the event payload.

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.

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

  1. Connect GTM Preview.
  2. Open the test collection.
  3. Inspect custom_view_item_list and its ecommerce payload.

Done when the expected GA4 tag fires with the product fields from this visit.

How do I verify view_item_list in GA4?

  1. Enable debug modesupport.google.com.
  2. Inspect the list event in GA4 DebugView.
  3. Switch the development storefront to a second presentment currency different from the shop currency.
  4. Reload the collection page.
  5. 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.

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

What should I verify after collection tracking?

Test Shopify product views and cart additions next. Keep the identifier convention deliberate across those events.

What 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
  1. 1Google's ecommerce guide↩
  2. 2Google's view_item_list reference↩
  3. 3Google's current Shopify app guide↩
  4. 4Shopify's migration tutorial↩
  5. 5Shopify's code-editing guide↩
  6. 6Google's Preview procedure↩
  7. 7Google's setup guide↩
  8. 8Shopify's template reference↩
  9. 9Shopify defines variant.price in the customer's presentment currency↩
  10. 10shop.currency is the store currency↩
  11. 11cart.currency↩
  12. 12iso_code↩
  13. 13Data Layer Variables↩
  14. 14Google Analytics: GA4 Event↩
  15. 15debug mode↩