Reputation: 831
I am trying to bind events for events tracking by Google Analytics. While making a call to GA, we can send some value also.
I am trying to send value by DOM selector.
When I use:
myValue=function(){return parseInt($('.checkout-order-totals .order-total td:last').text().replace('$','').replace(/,/g,'')).valueOf(); }
It works perfectly fine (showing click event in omnibug).
But when I remove parseInt from the above code, i.e,
myValue=function(){return $('.checkout-order-totals .order-total td:last').text().replace('$','').replace(/,/g,'').valueOf(); }
it does not send request to GA. (not showing click event in omnibug)
What can be the possible reasons for this?
Upvotes: 1
Views: 2299
Reputation: 6051
According to GA documentation, the Value
parameter must be a JS Number.
Therefore, it is not surprising that the request is not sent, as it must fail some validation.
Upvotes: 1