5.2K members online now
Learn how to set up goals and Ecommerce tracking, verify accuracy of attribution traffic sources, and discuss funnel visualization, Multi-Channel Funnels, the Goal Flow Report, and Enhanced Ecommerce
 
Guide Me
star_border
Reply

Transaction Revenues

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hello, I suppose there has been similiar problems, but none of the suggestions seems to work for me - GA records number of transactions just fine, but can't seem to track their revenue. My code is practically copy pasted from documentation ->

        (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-45065943-1', 'auto');
        ga('require', 'ecommerce');
        ga('send', 'pageview');

 

          ga('ecommerce:addTransaction', {
          'id': '<%= order.order_number %>',                     // Transaction ID. Required.
          'revenue': '<%= order.total_price %>'             // Grand Total.
          });
          ga('ecommerce:addItem', {
          'id': '<%= order.order_number %>',
          'name': 'Přeprava zásilky',
          'price': '<%= order.total_price %>',
          'quantity': '1'
          });
          ga('ecommerce:send');

1 Expert replyverified_user

Re: Transaction Revenues

Top Contributor
# 2
Top Contributor
Hi Jan,

Can you post an example of the code for actual shopping-cart data? So then we can see the real data that is being transmitted to Google Analytics from a sample shopping cart.

Christoph