Skip to content

Instantly share code, notes, and snippets.

@kylefox kylefox/snippet.js
Created Dec 22, 2017

Embed
What would you like to do?
Google Analytics Ecommerce Tracking for Podia
// https://developers.google.com/analytics/devguides/collection/analyticsjs/ecommerce
ga('tutorTracker.require', 'ecommerce');
var price = (Coach.Conversion.revenue_cents/100).toFixed(2);
var txID = Coach.Conversion.object.order_id.toString();
ga('tutorTracker.ecommerce:addTransaction', {
'id': txID,
'affiliation':
'Podia Storefront',
'revenue': price
});
ga('tutorTracker.ecommerce:addItem', {
'id': txID,
'name': Coach.Conversion.object.name,
'sku': Coach.Conversion.object.id.toString(),
'price': price,
'quantity': '1'
});
ga('tutorTracker.ecommerce:send');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.