1

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

2

Go to your Google analytics Admin page and check if your VIEW(s) has ecommerce enabled (Set to ON). Also make sure you have created a Goal to track conversion to that "thank you" Page.

If you use a destination goal to the "thank you" page remember to leave the goal Value field blank.

  • got the e-comm enabled. Did not know that I need to couple the e-comm tracking with a goal. Trying this now. Thanks! – Dimitry_N Mar 6 '16 at 23:15
  • still not seeing a conversion. I added a goal with a funnel and was able to verify it with conversion rate approximation. Maybe its because I'm running in development? – Dimitry_N Mar 7 '16 at 0:24
  • ok, turned out to be the 24-hour delay in data processing, which is weird since I'm running the server locally. Thanks for your help! – Dimitry_N Mar 10 '16 at 3:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.