Tracking Ecommerce Events
Ecommerce events are normal events where you specify attributes that define either a purchase transaction or an item detail. For example, the simplest
way to define a purchase is to pass in the
revenue
attribute:
gator.logEvent('Purchase', { revenue: 119.95 } );
This will automatically be added to all ecommerce reports that show revenue. The name of the event (in this case, 'Purchase') is not relevant. It could be 'Order' or 'Donation' or anything else.
Ecommerce attributes:
If you are tracking ecommerce events, like purchases, you can pass in the following attributes and they will be automatically included in our ecommerce reporting:
For transaction level tracking, pass in (all are optional):
id | The unique id of the purchase. Duplicate calls with the same id will be ignored. |
revenue | The total purchase amout. |
tax | The name of the item or product purchased. |
shipping | The name of the item or product purchased. |
For example:
gator.logEvent('Order', { id: 'TX00001', revenue: 119.95, tax: 9.91, shipping: 18.41 });
You can also track items (products) independently from transactions.
For item level tracking, you can pass in (all are optional):
id | The unique id of the purchase. This should match the id on the purchase transaction, if you are tracking purchases separately from items. |
itemNo | This is the line item number for this item on the purchase. It is used only to prevent duplicates. If an item is passed in with a duplicate transaction id and item number, it will be ignored. |
itemName | The name of the item or product purchased. |
itemCategory | The category of the item or product purchased. For example, 'electronics'. |
sku | The SKU of the item or product purchased. |
itemPrice | The price of the item or product purchased. |
itemQuantity | The quantity purchased. |
Do not pass revenue in from both the transaction and the items, or else it will be double counted.
For example:
gator.logEvent('Item Sold', { id: 'TX00001', itemNo: 1, itemName: 'widget', itemCategory: 'widgets', itemPrice: 9.99, itemQuantity: 3 });
The name of the event (in this case, 'Item Sold') is not relevant. It could be anything. The ecommerce attributes passed are what indicate that it is an item event.
Reporting
After issuing calls with ecommerce data, you will be able to see the results in the 'Conversions' reporting.