I'd like to track pledges with GA-EC, however, since these are not purchases, some fields have to be used in a rather creative fashion. Nevertheless, the following tracker code does work in parts:
(function(i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r;
i[r] = i[r] || function() {
(i[r].q = i[r].q || []).push(arguments)
}, i[r].l = 1 * new Date();
a = s.createElement(o),
m = s.getElementsByTagName(o)[0];
a.async = 1;
a.src = g;
m.parentNode.insertBefore(a, m)
})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
ga('create', "UA-XXXXXXXX-X", 'auto');
ga('require', 'displayfeatures');
ga('require', 'ec');
(...)
ga('ec:addProduct', {
"id":"Reward@123",
"name":"50",
"category":"music",
"currency":"EUR",
"price":"50"
});
ga('ec:setAction', 'purchase', {
"id":"Payment@123",
"affiliation":"Project@123",
"coupon":"prepaid"
});
(...)
ga('send', 'pageview');
I do see the affiliation or the coupon, but the amount is always 0, no matter which currency is selected.
Any idea what's I'm doing wrong here?