Subversion Repositories SmartDukaan

Rev

Rev 15740 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 15740 Rev 17738
Line 717... Line 717...
717
	storeName = 'Saholic';
717
	storeName = 'Saholic';
718
    }
718
    }
719
    var orders = orderConfirmation['result']['orders'];
719
    var orders = orderConfirmation['result']['orders'];
720
    for(i=0;i<orders.length;i++){
720
    for(i=0;i<orders.length;i++){
721
      var amount = orders[i].totalAmount.replace(',','');
721
      var amount = orders[i].totalAmount.replace(',','');
-
 
722
      var unitPrice = orders[i].unitPrice;
722
      amount = parseFloat(amount).toFixed(2);
723
      amount = parseFloat(amount).toFixed(2);
-
 
724
      unitPrice = parseFloat(unitPrice).toFixed(2);
723
      var orderId = orders[i].orderId;
725
      var orderId = orders[i].orderId;
724
/*
726
/*
725
      _gaq.push(['_addTrans',
727
      _gaq.push(['_addTrans',
726
          orderId,                     // Transaction ID. Required.
728
          orderId,                     // Transaction ID. Required.
727
          storeName,   // Affiliation or store name.
729
          storeName,   // Affiliation or store name.
Line 752... Line 754...
752
	ga('ecommerce:addItem', {
754
	ga('ecommerce:addItem', {
753
	  'id': orderId,                     // Transaction ID. Required
755
	  'id': orderId,                     // Transaction ID. Required
754
	  'name': orders[i].itemName,                // Product name. Required
756
	  'name': orders[i].itemName,                // Product name. Required
755
	  'sku': orders[i].itemName,                    // SKU/code
757
	  'sku': orders[i].itemName,                    // SKU/code
756
	  'category': 'Physical',       // Category or variation
758
	  'category': 'Physical',       // Category or variation
757
	  'price': amount,                 // Unit price
759
	  'price': unitPrice,                 // Unit price
758
	  'quantity': orders[i].quantity                   // Quantity
760
	  'quantity': orders[i].quantity                   // Quantity
759
	});
761
	});
760
    }
762
    }
761
//    _gaq.push(['_trackTrans']); //submits transaction to the Analytics servers
763
//    _gaq.push(['_trackTrans']); //submits transaction to the Analytics servers
762
	ga('ecommerce:send');      // Send transaction and item data to Google Analytics.
764
	ga('ecommerce:send');      // Send transaction and item data to Google Analytics.