Created
June 30, 2018 14:42
-
-
Save marcusRB/cb9b9bddddaceaff57b6f4a9b6342cb2 to your computer and use it in GitHub Desktop.
Adding a Product to a Shopping Cart EEC dataLayer
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
// Measure adding a product to a shopping cart by using an 'add' actionFieldObject | |
// and a list of productFieldObjects. | |
dataLayer.push({ | |
'event': 'addToCart', | |
'ecommerce': { | |
'currencyCode': 'EUR', | |
'add': { // 'add' actionFieldObject measures. | |
'products': [{ // adding a product to a shopping cart. | |
'name': 'Triblend Android T-Shirt', | |
'id': '12345', | |
'price': '15.25', | |
'brand': 'Google', | |
'category': 'Apparel', | |
'variant': 'Gray', | |
'quantity': 1 | |
}] | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment