Assuming that I need to send some dataLayer info to Google Tag Manager, I will need this:
dataLayer.push({
'ecommerce': {
'currencyCode': 'EUR', // Local currency is optional.
'impressions': [
{
'name': 'Triblend Android T-Shirt', // Name or ID is required.
'id': '12345',
'price': '15.25',
'brand': 'Google',
'category': 'Apparel',
'variant': 'Gray',
'list': 'Search Results',
'position': 1
},
{
'name': 'Donut Friday Scented T-Shirt',
'id': '67890',
'price': '33.75',
'brand': 'Google',
'category': 'Apparel',
'variant': 'Black',
'list': 'Search Results',
'position': 2
}]
}
});
The question is: do I need to manually write the JSON into my page or the gtm will do this for me after inserting the gtm tracking code into my page?
After searching some tutorials online, all the helpful info I found was how to configure the TagManager account but nobody talks about how the script is generated.
question from:
https://stackoverflow.com/questions/65933006/question-about-google-tag-manager-and-enhanced-ecommerce 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…