Created
January 24, 2016 18:57
-
-
Save chandima/85527aa54a02310d320f to your computer and use it in GitHub Desktop.
ASU RFI E-Commer push JS code
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
// create named tracker | |
ga('create', 'UA-141599-1', 'auto', {'name': 'commerceTracker'}); | |
ga('commerceTracker.require', 'ecommerce'); | |
// push custom dimensions | |
ga('commerceTracker.set', { | |
'ASUOID': <asuoid>, // Push ASUOID | |
'RFI': 'asuo-rfi' // Push For segmenting on users who have submitted an RFI. | |
}); | |
// push e-commerce | |
ga('commerceTracker.ecommerce:addTransaction', { | |
'id': <asuoid>, // Transaction ID. Required. | |
'affiliation': <affiliate>, // Affiliation or store name. | |
'revenue': 100, // Grand Total. | |
'shipping': 0, // Shipping. | |
'tax': 0 // Tax. | |
}); | |
ga('commerceTracker.ecommerce:addItem', { | |
'id': <asuoid>, // Transaction ID. Required. | |
'sku': <progplancode-w-stub>, // SKU/code. | |
'name': <progname-w-stub>, // Product name. Required. | |
'category': <crmdestination>, // Category or variation. | |
'price': 100, // Unit price. | |
'quantity': 1 // Quantity. | |
}); | |
ga('commerceTracker.ecommerce:send'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment