Introduction
In this guide, you'll learn how to configure the "View Item List" event on Shopify using Google Tag Manager (GTM) and Google Analytics 4 (GA4). This setup is essential for tracking which product lists users are viewing on your Shopify store.
We'll walk you through the steps from verifying access permissions to setting up tags, triggers, and variables within GTM. By the end, you'll be able to ensure accurate event tracking in GA4.
Prerequisites
Before starting, ensure that you have:
- Admin access to your GA4 property and GTM container.
- Access to the Shopify backend, specifically to manage Customer Pixels.
Accessing Shopify and Google Tag Manager Setup
First, verify that you have the necessary permissions:
-
Google Analytics 4: Go to the Admin section of your GA4 property. Click on Property Access Management to check your access level. You need admin access to make changes.
-
Google Tag Manager: In GTM, navigate to the Admin section of your container. Ensure you have Published access under User Management to make live changes on the website.
-
Shopify: Access the Customer Pixels settings in the Shopify backend. Ensure you can create, connect, and delete pixels as required.
DataLayer code for View Item List event
To start, ensure that your GTM container is properly installed on your Shopify store:
- Copy the GTM container code provided in the video description.
- In Shopify, go to Settings > Customer Pixels.
- Click on Add Custom Pixel, name it something like "Data Layer Code", and add the pixel.
- Set permissions to "Not Required" and ensure the "Data Sale" setting is marked as "This does not qualify as a data sale".
- Paste the GTM container code, replace the placeholder with your GTM container ID, and save it.
After saving, connect the pixel to Shopify. This setup will allow you to track the "View Item List" event in GA4.
Creating the GA4 Configuration Tag
To set up the "View Item List" event, you first need to create a GA4 configuration tag in GTM:
- Go to Tags in GTM and create a new tag.
- Name it something like "GA4 Configuration Tag".
- Select Google Analytics: GA4 Configuration as the tag type.
- Enter your GA4 Measurement ID. (You can find this in your GA4 property under Admin > Data Streams.)
- Save the tag.
This tag will initialize GA4 tracking on your Shopify store.
Setting Up the View Item List Event
Creating Variables
You'll need to create variables to capture key data from your Shopify store:
-
Currency:
- Go to Variables in GTM and create a new Data Layer Variable.
- Name it
dlv.ecommerce.currency
. - Set the data layer variable name to
ecommerce.currency
.
-
Value:
- Repeat the steps above, but name this variable
dlv.ecommerce.value
and useecommerce.value
.
- Repeat the steps above, but name this variable
-
Items Array:
- Similarly, create another variable named
dlv.ecommerce.items
usingecommerce.items
.
- Similarly, create another variable named
Creating the Trigger
Now, create a trigger that fires on the "View Item List" event:
- Go to Triggers in GTM and create a new trigger.
- Name it
Custom Event - View Item List
. - Set the trigger type to Custom Event and enter the event name as
view_item_list
.
Creating the Tag
Finally, create a tag that sends the "View Item List" event to GA4:
-
Go to Tags in GTM and create a new tag.
-
Name it
GA4 Event - View Item List
. -
Select Google Analytics: GA4 Event as the tag type.
-
Set the event name to
view_item_list
. -
Add the following event parameters:
- Value: Set to
{{dlv.ecommerce.value}}
. - Currency: Set to
{{dlv.ecommerce.currency}}
. - Items: Set to
{{dlv.ecommerce.items}}
.
- Value: Set to
-
Assign the
Custom Event - View Item List
trigger to this tag and save it.
Publishing and Testing the Setup
Since Customer Pixels in Shopify don’t support the debug mode in GTM, you'll need to publish and then test the setup:
- Click on Submit in GTM to publish your changes.
- Refresh your Shopify store page and open the Inspect tool in your browser.
- In the Network tab, verify that the
view_item_list
event is firing correctly.
You can also check real-time data in GA4 under Realtime to ensure the event is being tracked.
Conclusion
By following these steps, you've successfully configured the "View Item List" event in GA4 using Google Tag Manager on your Shopify store. This setup will help you better understand how users interact with product lists on your site, enabling more accurate analytics and better decision-making.
For further tracking, like setting up the "Add to Cart" event, continue following similar procedures in GTM. 6. Assign the Custom Event - View Item List
trigger to this tag and save it.
Publishing and Testing the Setup
Since Customer Pixels in Shopify don’t support the debug mode in GTM, you'll need to publish and then test the setup:
- Click on Submit in GTM to publish your changes.
- Refresh your Shopify store page and open the Inspect tool in your browser.
- In the Network tab, verify that the
view_item_list
event is firing correctly.
You can also check real-time data in GA4 under Realtime to ensure the event is being tracked.
Conclusion
By following these steps, you've successfully configured the "View Item List" event in GA4 using Google Tag Manager on your Shopify store. This setup will help you better understand how users interact with product lists on your site, enabling more accurate analytics and better decision-making.
For further tracking, like setting up the "Add to Cart" event, continue following similar procedures in GTM.
Need help implementing the tracking? Send us a message..!
Send a Message