You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey, I've just spent a couple hours debugging this and I think there is a room for improvement here.
At one point my events stopped being displayed in GA, while the universal-analytics was not throwing any errors.
Here is my code:
newPromise((resolve,reject)=>{try{consteventParams={action: 'passed funMetric',category: 'business',value: userId,// a string UUID}GA.event(// GA is a universal-analytics instanceeventParams.category,eventParams.action,eventParams.label,eventParams.value,(err)=>{if(err){logger.error({ err })throwerr}else{logger.info({ ...eventParams, userId },'Created a GA event')resolve()}})}}catch(err){logger.error({ err })reject(err)}})
I was getting 'Created a GA event' in my console, indicating that everything went fine. But it wasn't.
Best one: wait for GA to respond to a sent event and check if it was successful. If it's not - raise an error.
In a event function check that, when passed, the value is an integer.
Update the docs to indicate that only integers are supported.
What do you think?
The text was updated successfully, but these errors were encountered:
cbrwizard
changed the title
event function doesn't throw an error when an event value is not supported by GA
event function doesn't throw an error when an event value is not supported by GA
Aug 17, 2017
I am having the same problem, a string does not work and no error is being thrown. I think this module should attempt to convert strings to numbers and send to Google, but I don't know if Google is throwing errors here.
Hey, I've just spent a couple hours debugging this and I think there is a room for improvement here.
At one point my events stopped being displayed in GA, while the
universal-analytics
was not throwing any errors.Here is my code:
I was getting 'Created a GA event' in my console, indicating that everything went fine. But it wasn't.
Randomly I've changed the
value
to1
and it started working. I've checked the documentation https://github.com/peaksandpies/universal-analytics/blob/master/AcceptableParams.md#event-value it doesn't say anything about a requirement for a value to be a number. A string is also a non-negative value, right?Here are the possible solutions for this issue:
event
function check that, when passed, thevalue
is an integer.What do you think?
The text was updated successfully, but these errors were encountered: