Can anyone help me with this issue?
I’m using Google Analytics eCommerce tracking using dataLayer push via Google Tag Manager events.
Pushing a single item to the data layer using Javascript Toolbox is fine, but how can it do this for a number of items that make up an order. This works for a single item:
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
‘event’:‘begin_checkout’,
‘ecommerce’:{
‘items’:[
{
‘item_name’:’[name]’,
‘item_id’:’[id]’,
‘price’:’[price]’,
‘item_brand’:’[brand]’,
‘item_category’:’[cat1’,
‘item_category_2’:’[cat2]’,
‘item_category_3’:’[cat3]’,
‘item_category_4’:’[cat4]’,
‘item_variant’:’[variant]’,
‘item_list_name’:’[list_name]’,
‘item_list_id’:’[list_id]’,
‘index’:[1],
‘quantity’:’[quantity]’
}]
}}
)
An order can contain several items, but I want to be able to capture all the items in order, not just one.
Thanks
Euan