Skip to content

Instantly share code, notes, and snippets.

@marcusRB
Created June 30, 2018 11:14
Show Gist options
  • Save marcusRB/775ce09c42ca08bc52c84d1e734f8b39 to your computer and use it in GitHub Desktop.
Save marcusRB/775ce09c42ca08bc52c84d1e734f8b39 to your computer and use it in GitHub Desktop.
Measuring Product Impressions EEC dataLayer
<script>
// 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.
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
}]
}
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment