Vikas Mangal
Vikas Mangal

Reputation: 831

Sending string value in google analytics

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

Answers (1)

Valentin Waeselynck
Valentin Waeselynck

Reputation: 6051

According to GA documentation, the Valueparameter must be a JS Number.

Therefore, it is not surprising that the request is not sent, as it must fail some validation.

Upvotes: 1

Related Questions