Permalink
Browse files

an event value can only be an integer according to the API specification

  • Loading branch information...
1 parent cb12127 commit 600433c2d88e16d79f9c6ba4990737f48dcf22f6 @hannesgassert hannesgassert committed Oct 7, 2012
Showing with 3 additions and 3 deletions.
  1. +1 −1 README.md
  2. +2 −2 lib/ga.js
View
@@ -16,5 +16,5 @@ Server side google analytics
category: 'Videos',
action: 'Video Loading',
label: 'Gone With the Wind',
- value: 1.234
+ value: 42
});
View
@@ -84,8 +84,8 @@ GoogleAnalytics.prototype.trackEvent = function(event, userId, cb) {
utme: '5(' + payload.join('*') + ')'
};
- if (typeof event.value === 'number') {
- obj.utme += '(' + event.value + ')';
+ if (typeof event.value !== 'undefined') {
+ obj.utme += '(' + Math.round(event.value) + ')';
}
if (event.nonInteraction) {

0 comments on commit 600433c

Please sign in to comment.