Analytics
2.3K members online now
2.3K 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

Product Revenue much higher than Total Revenue - Custom Setup

[ Edited ]
Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi, 

 

I've recently been working on implementing Enhanced eCommerce on a website, and after launching in GTM last night all seems to be well, except product revenue is much higher than total revenue. 

 

For example, widget A costs $25, and 4 widget A's were purchased. The revenue total shows $100, but when I check product revenue, the line total is for some reason multiplied by the quantity, so that product revenue is $100x4=$400. 

 

Why would this happen? Below is part of the code we use to send everything to GA. Thanks to anyone who can help.

Note: yes, id and product name are the same, that is purposeful at this time.

 

//Send product and purchase details to ga
  function ga_t_vpvs_c_cc() {

      //Track the purchase information
      var $orderConfirmation = jQuery('#orderConfirmation');

      if ($orderConfirmation.length) {

        var regex = /[+-]?\d+(\.\d+)?/g;

        var currency = window.Cookies.get("arrowcurrency").split('&')[0].split('=')[1] || '';

        var id = $orderConfirmation.find('.u-grid-6 h2').text().split(" ")[2];

        var revenue = $orderConfirmation.find('.orderConfirmationTotalCost').text().trim().match(regex).map(function(v) { return parseFloat(v); });

        var $orderItems = $orderConfirmation.find('.orderSummaryGrid li');

        var shipping = $orderItems.eq(1).find('.value').text().trim().match(regex).map(function(v) { return parseFloat(v); });
        var tax = $orderItems.eq(2).find('.value').text().trim().match(regex).map(function(v) { return parseFloat(v); });

        //wireFire - checking if element exists
        var coupon = '';
        if ($orderItems.eq(3).length) {
          coupon = $orderItems.eq(3).find('.value').text().match(regex).map(function(v) { return parseFloat(v); });
        }

      }


      //Track each product
      var $confirmText = jQuery(".OrderConfirmation-textBody");

      $confirmText.each(function() {

          var $this = jQuery(this);
          var $descriptiontexts = $this.find('.CartSummary-descriptionContainer').find('.CartSummary-textBody--small');
          var $pricetexts = $this.find('.CartSummary-priceContainer').find('.CartSummary-textBody--small');

          var name = $this.find('.CartSummary-catalogPart').text().trim();
          var prod_manufacturer = $descriptiontexts.eq(0).text().trim();
          var category = $descriptiontexts.eq(1).text().trim();

          var quantity = $pricetexts[0].innerText.trim().match(regex).map(function(v) { return parseFloat(v); });
          var price = $pricetexts[2].innerText.trim().match(regex).map(function(v) { return parseFloat(v); });


          ga('ec:addProduct', {
            'id': name,
            'name': name,
            'category': category,
            'brand': prod_manufacturer,
            'price': price,
            'quantity': quantity
          });
      });
    
     ga("set", "&cu", currency);
      ga("ec:setAction", "purchase", {
          id: id,
          revenue: revenue,
          shipping: shipping,
          tax: tax,
          coupon: coupon
      });
    
    ga('send','event','Checkout','Checkout','',0);

  }

 

1 Expert replyverified_user
1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by topic author Chris R
October 2016

Re: Product Revenue much higher than Total Revenue - Custom Setup

Top Contributor
# 2
Top Contributor
Hi Chris,

Google Analytics calculates the product revenue as price x quantity. Make sure you are sending the price for a single item to GA. You can use the GA debugger or Google Tag Assistant Chrome extensions to see what data is being sent to GA. Hope this helps.

Arnold Majlath, Google Analytics Top Contributor
Was my response helpful? If yes, please accept it as solution.
Circle Me On Google+ | Visit me @ Redfly Digital

View solution in original post

Marked as Best Answer.
Solution
Accepted by topic author Chris R
October 2016

Re: Product Revenue much higher than Total Revenue - Custom Setup

Top Contributor
# 2
Top Contributor
Hi Chris,

Google Analytics calculates the product revenue as price x quantity. Make sure you are sending the price for a single item to GA. You can use the GA debugger or Google Tag Assistant Chrome extensions to see what data is being sent to GA. Hope this helps.

Arnold Majlath, Google Analytics Top Contributor
Was my response helpful? If yes, please accept it as solution.
Circle Me On Google+ | Visit me @ Redfly Digital