I am trying to track a custom PHP based donation form data using analytics.js
and ecommerce.js
from Google Analytics
Here is my Output
` (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('send', 'pageview'); ga('require', 'displayfeatures'); ga('require', 'ecommerce', 'ecommerce.js'); function trackEcommerce() { this._addTrans = addTrans; this._addItem = addItems; this._trackTrans = trackTrans; } function addTrans(orderID,store,total,tax,shipping,city,state,country) { ga('ecommerce:addTransaction', { '120573112734': orderID, 'Donation': store, '10.00': total, '': tax, '': shipping, 'test',: city, 'test': state, 'test': country }); } function addItems(orderID,sku,product,variation,price,qty) { ga('ecommerce:addItem', { '120573112734': orderID, 'Donate': sku, 'Donation': product, 'none': variation, '1.00': price, '1': qty }); } function trackTrans() { ga('ecommerce:send'); } var pageTracker = new trackEcommerce(); `
I am not sure why this data is not being captured in Google Analytics E-commerce section, While I can see the stats on my Thank You page in Google Analytics
Please help If I am not doing it correctly. Thanks Again.