Subversion Repositories SmartDukaan

Rev

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

Rev 10948 Rev 10953
Line 403... Line 403...
403
        return false;
403
        return false;
404
      }
404
      }
405
    }
405
    }
406
    var value = localStorage.getItem('rechargeValue');
406
    var value = localStorage.getItem('rechargeValue');
407
    if(parseInt(value) == 1){
407
    if(parseInt(value) == 1){
-
 
408
    	if(typeof _gaq != "undefined" && _gaq != null)	{
408
    	ga('send', 'event', 'Recharge', 'Confirm','Mobile');	
409
			_gaq.push(['_trackEvent', 'Recharge', 'Confirm','Mobile']);
-
 
410
		}	
409
    }else if(parseInt(value) == 2){
411
    }else if(parseInt(value) == 2){
-
 
412
    	if(typeof _gaq != "undefined" && _gaq != null)	{
410
    	ga('send', 'event', 'Recharge', 'Confirm','DTH');
413
			_gaq.push(['_trackEvent', 'Recharge', 'Confirm','DTH']);
-
 
414
		}
411
    }
415
    }
412
  }
416
  }
413
 function addressValidation(e){
417
 function addressValidation(e){
414
 	debugger;
418
 	debugger;
415
 	var Id = e.currentTarget.id;
419
 	var Id = e.currentTarget.id;
Line 581... Line 585...
581
        document.getElementById('error').innerHTML ='Please remove excess whitespaces from phone number!';
585
        document.getElementById('error').innerHTML ='Please remove excess whitespaces from phone number!';
582
        window.scrollTo(0,0); return false;}	 
586
        window.scrollTo(0,0); return false;}	 
583
	}
587
	}
584
	var value = localStorage.getItem('rechargeValue');
588
	var value = localStorage.getItem('rechargeValue');
585
    if(parseInt(value) == 1){
589
    if(parseInt(value) == 1){
-
 
590
    	if(typeof _gaq != "undefined" && _gaq != null)	{
586
    	ga('send', 'event', 'Recharge', 'Recharge','Mobile');	
591
			_gaq.push(['_trackEvent', 'Recharge', 'Pay Now','Mobile']);
-
 
592
		}
587
    }else if(parseInt(value) == 2){
593
    }else if(parseInt(value) == 2){
-
 
594
    	if(typeof _gaq != "undefined" && _gaq != null)	{
588
    	ga('send', 'event', 'Recharge', 'Pay Now','DTH');
595
			_gaq.push(['_trackEvent', 'Recharge', 'Pay Now','DTH']);
-
 
596
		}
589
    }
597
    }
590
 }
598
 }
591
 var url;
599
 var url;
592
 url = document.URL;
600
 url = document.URL;
593
 if(url.indexOf('recharge-result') != -1){
601
 if(url.indexOf('recharge-result') != -1){
594
 	if(orderConfirmation != undefined){
602
 	if(orderConfirmation != undefined){
595
 		ga('require', 'ecommerce', 'ecommerce.js');
-
 
596
 		var amount = parseFloat(orderConfirmation['response'].totalAmount).toFixed(2);
603
 		var amount = parseFloat(orderConfirmation['response'].totalAmount).toFixed(2);
597
 		var orderId = orderConfirmation['response'].rechargeDisplayId;
604
 		var orderId = orderConfirmation['response'].rechargeDisplayId;
598
 		var deviceNumber = orderConfirmation['response'].rechargeDeviceNumber;
605
 		var deviceNumber = orderConfirmation['response'].rechargeDeviceNumber;
599
 		ga('ecommerce:addTransaction', {
606
 		_gaq.push(['_addTrans',
600
		  'id': orderId,                     // Transaction ID. Required.
607
			orderId,                     // Transaction ID. Required.
601
		  'affiliation': 'shop2020',   // Affiliation or store name.
608
			'shop2020',   // Affiliation or store name.
602
		  'revenue': amount,               // Grand Total.
609
			amount,               // Grand Total.
603
		  'shipping': '0',                  // Shipping.
610
			'0',                  // Shipping.
604
		  'tax': '0',                     // Tax.
611
			'0',                     // Tax.
605
		  'city':"",
612
			"",
606
		  'state':"",
613
			"",
607
		  'country':"India"
614
			"India"
608
		});
615
		]);
609
		ga('ecommerce:addItem', {
616
		_gaq.push(['_addItem',
610
		  'id': orderId,                     // Transaction ID. Required.
617
			orderId,                     // Transaction ID. Required.
611
		  'name': orderConfirmation['response'].rechargeProvider,    // Product name. Required.
618
			orderConfirmation['response'].rechargeProvider,    // Product name. Required.
612
		  'sku': deviceNumber,                 // SKU/code.
619
			deviceNumber,                 // SKU/code.
613
		  'category': 'Digital',         // Category or variation.
620
			'Digital',         // Category or variation.
614
		  'price': amount,                 // Unit price.
621
			amount,                 // Unit price.
615
		  'quantity': '1'                   // Quantity.
622
			'1'                   // Quantity.
616
		});
623
		]);
617
		ga('ecommerce:send');
624
		 _gaq.push(['_trackTrans']); //submits transaction to the Analytics servers
618
 	}
625
 	}
619
 }
626
 }
620
627