I'm using Google Tag Manager to deploy Google Analytics 4. I want to use view_list_items. If I follow this Google example and push the following JSON with a variable ecommerce.items mapped to the items parameter of a view_item_list event:
dataLayer.push({
'event': 'view_item_list',
'ecommerce': {
'items': [
{
'item_name': 'Triblend Android T-Shirt', // Name or ID is required.
'item_id': '12345',
'price': '15.25',
'item_brand': 'Google',
'item_category': 'Apparel',
'item_category2': 'Mens',
'item_category3': 'Shirts',
'item_category4': 'Tshirts',
'item_variant': 'Gray',
'item_list_name': 'Search Results',
'item_list_id': 'SR123',
'index': 1,
'quantity': '1'
},
{
'item_name': 'Donut Friday Scented T-Shirt',
'item_id': '67890',
'price': '33.75',
'item_brand': 'Google',
'item_category': 'Apparel',
'item_category2': 'Mens',
'item_category3': 'Shirts',
'item_category4': 'Tshirts',
'item_variant': 'Black',
'item_list_name': 'Search Results',
'item_list_id': 'SR123',
'index': 2,
'quantity': '1'
}]
}
});
Then in the GA4 debugger instead of showing 2 items it show up 4. 2 products and 2 list items as below:
- Triblend Android T-Shirt (12345) item_id: 12345 quantity: 1 item_name: Triblend Android T-Shirt item_brand: Google item_category: Apparel item_category2: Mens item_category3: Shirts item_category4: Tshirts variant: Gray price: 15250000
- Donut Friday Scented T-Shirt (67890) item_id: 67890 quantity: 1 item_name: Donut Friday Scented T-Shirt item_brand: Google item_category: Apparel item_category2: Mens item_category3: Shirts item_category4: Tshirts variant: Black price: 33750000
- Item item_list_id: SR123 item_list_name: Search Results index: 1
- Item item_list_id: SR123 item_list_name: Search Results index: 2
How do I manager to map the item_list_name and item_list_id to their corresponding products?