Created
April 3, 2020 01:31
-
-
Save simonbreton/2f204ca96c5aba91346f2c3d14ae71ef to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Measures product impressions and also tracks a standard | |
// pageview for the tag configuration. | |
// Product impressions are sent by pushing an impressions object | |
// containing one or more impressionFieldObjects. | |
window.dataLayer = window.dataLayer || []; | |
dataLayer.push({ | |
'event':'impressions' | |
'currencyCode': 'EUR', | |
'impressions': '3', // number of impressions | |
'product_impressions': [ | |
{ | |
'product_name': 'Triblend Android T-Shirt', // Name or ID is required. | |
'product_id': '12345', | |
'product_price': '15.25', | |
'product_brand': 'Google', | |
'product_category': 'Apparel', | |
'product_variant': 'Gray', | |
'list': 'Search Results', // where product impressions occured. | |
'product_position': 1 // Position of the product within the list. | |
}, | |
{ | |
'product_name': 'Donut Friday Scented T-Shirt', | |
'product_id': '67890', | |
'product_price': '33.75', | |
'product_brand': 'Google', | |
'product_category': 'Apparel', | |
'product_variant': 'Black', | |
'list': 'Search Results', | |
'product_position': 2 | |
}] | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment