I'm running a Rails (Ruby on Rails
) app and want to start collecting e-commerce conversion data. I have Google Analytics installed on a local server (development environment), and I am able to see the data from local visits (aliased / tunneled localhost:3000
), and track real-time Goal Conversions just fine. However, I am not able to see any e-comm conversions. Here is what the rendered JS snippet looks like:
<script>
...
// tacking code
// ga(create)
...
ga('send', 'pageview');
ga('require', 'ecommerce');
ga('ecommerce:addTransaction', {
'id' : '298',
'affiliation' : 'Tax',
'revenue' : '0.0',
'shipping' : '0.0',
'tax' : '0.0'
});
ga('ecommerce:addItem', {
'id' : '227',
'sku' : '227',
'name' : 'Alpha 0 featured listing',
'category': 'Appliances',
'price' : '23.34',
'quantity': '1'
});
ga('ecommerce:send');
</script>
The ecommerce
object calls are added on the thank-you
page. Otherwise, only the pageView
event gets sent. Am I doing it wrong by combining addItem
and addTransaction
?
EDIT:
I am able to see both hitType
vars being sent up via google_analytics_debug.js