Created
July 10, 2018 22:16
-
-
Save jacobdubail/21d95aad15017fdf85d6773bc75db4db to your computer and use it in GitHub Desktop.
GA Ecommerce Snippet
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
<script type="text/javascript"> | |
ga('require', 'ecommerce'); | |
ga('ecommerce:addTransaction', { | |
'id': '1234', // Transaction ID. Required. | |
'affiliation': 'Acme Clothing', // Affiliation or store name. | |
'revenue': '11.99', // Grand Total. | |
'shipping': '5', // Shipping. | |
'tax': '1.29' // Tax. | |
}); | |
ga('ecommerce:addItem', { | |
'id': '1234', // Transaction ID. Required. | |
'name': 'Fluffy Pink Bunnies', // Product name. Required. | |
'sku': 'DD23444', // SKU/code. | |
'category': 'Party Toys', // Category or variation. | |
'price': '11.99', // Unit price. | |
'quantity': '1' // Quantity. | |
}); | |
ga('ecommerce:send'); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment