Subversion Repositories SmartDukaan

Rev

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

Rev 12084 Rev 12524
Line 30... Line 30...
30
  var orderConfirmation = <?php echo json_encode($orderConfirmation);?>;
30
  var orderConfirmation = <?php echo json_encode($orderConfirmation);?>;
31
  if(orderConfirmation != undefined){
31
  if(orderConfirmation != undefined){
32
    var amount = parseFloat(orderConfirmation['response'].totalAmount).toFixed(2);
32
    var amount = parseFloat(orderConfirmation['response'].totalAmount).toFixed(2);
33
    var orderId = orderConfirmation['response'].rechargeDisplayId;
33
    var orderId = orderConfirmation['response'].rechargeDisplayId;
34
    var deviceNumber = orderConfirmation['response'].rechargeDeviceNumber;
34
    var deviceNumber = orderConfirmation['response'].rechargeDeviceNumber;
-
 
35
/*
35
    _gaq.push(['_addTrans',
36
    _gaq.push(['_addTrans',
36
      orderId,                     // Transaction ID. Required.
37
      orderId,                     // Transaction ID. Required.
37
      'Saholic',   // Affiliation or store name.
38
      'Saholic',   // Affiliation or store name.
38
      amount,               // Grand Total.
39
      amount,               // Grand Total.
39
      '0',                  // Shipping.
40
      '0',                  // Shipping.
Line 49... Line 50...
49
      'Digital',         // Category or variation.
50
      'Digital',         // Category or variation.
50
      amount,                 // Unit price.
51
      amount,                 // Unit price.
51
      '1'                   // Quantity.
52
      '1'                   // Quantity.
52
    ]);
53
    ]);
53
     _gaq.push(['_trackTrans']); //submits transaction to the Analytics servers
54
     _gaq.push(['_trackTrans']); //submits transaction to the Analytics servers
-
 
55
*/
-
 
56
	ga('ecommerce:addTransaction', {
-
 
57
	  'id': orderId,                     // Transaction ID. Required
-
 
58
	  'affiliation': 'Saholic',   // Affiliation or store name
-
 
59
	  'revenue': amount,               // Grand Total
-
 
60
	  'shipping': '0',                  // Shipping
-
 
61
	  'tax': '0'                     // Tax
-
 
62
	});
-
 
63
	// addItem should be called for every item in the shopping cart.
-
 
64
	ga('ecommerce:addItem', {
-
 
65
	  'id': orderId,                     // Transaction ID. Required
-
 
66
	  'sku': orderConfirmation['response'].rechargeProvider,                    // SKU/code
-
 
67
	  'name': deviceNumber,                // Product name. Required
-
 
68
	  'category': 'Digital',       // Category or variation
-
 
69
	  'price': amount,                 // Unit price
-
 
70
	  'quantity': '1'                   // Quantity
-
 
71
	});
-
 
72
	ga('ecommerce:send');      // Send transaction and item data to Google Analytics.
54
  }
73
  }
55
  var pheight = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
74
  var pheight = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
56
  var value = localStorage.getItem('rechargeValue');
75
  var value = localStorage.getItem('rechargeValue');
57
  if(parseInt(value) == 1){
76
  if(parseInt(value) == 1){
-
 
77
	ga('send', 'event', 'Recharge', 'Recharge Result','Mobile-Result');
58
    if(typeof _gaq != "undefined" && _gaq != null)  {
78
    	/*if(typeof _gaq != "undefined" && _gaq != null)  {
59
        _gaq.push(['_trackEvent', 'Recharge', 'Recharge Result','Mobile-Result']);
79
        _gaq.push(['_trackEvent', 'Recharge', 'Recharge Result','Mobile-Result']);
60
      } 
80
      } */
61
  }else if(parseInt(value) == 2){
81
  }else if(parseInt(value) == 2){
62
    if(typeof _gaq != "undefined" && _gaq != null)  {
82
    	/*if(typeof _gaq != "undefined" && _gaq != null)  {
63
        _gaq.push(['_trackEvent', 'Recharge', 'Recharge Result','Recharge-Result']);
83
        _gaq.push(['_trackEvent', 'Recharge', 'Recharge Result','Recharge-Result']);
64
      } 
84
      } */
-
 
85
	ga('send', 'event', 'Recharge', 'Recharge Result','Recharge-Result');
65
  }
86
  }
66
  // if(document.getElementsByClassName('order-conf')[0] != undefined){
87
  // if(document.getElementsByClassName('order-conf')[0] != undefined){
67
  //     document.getElementsByClassName('order-conf')[0].style.minHeight = pheight - 153 +'px';  
88
  //     document.getElementsByClassName('order-conf')[0].style.minHeight = pheight - 153 +'px';  
68
  // }
89
  // }
69
</script>
90
</script>
70
 
-