Browse Source

Merge pull request #784 from bgrozev/round-analytics-values

Rounds floats passed to analytics (instead of truncating them).
j8
Дамян Минков 9 years ago
parent
commit
202ad0542f
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      analytics.js

+ 1
- 1
analytics.js View File

12
 
12
 
13
   Analytics.prototype.sendEvent = function (action, data) {
13
   Analytics.prototype.sendEvent = function (action, data) {
14
     // empty label and add the value, the value should be integer or null
14
     // empty label and add the value, the value should be integer or null
15
-    var value = parseInt(data);
15
+    var value = Math.round(parseFloat(data));
16
 
16
 
17
     ga('send', 'event', 'jit.si', action, "", value ? value : null);
17
     ga('send', 'event', 'jit.si', action, "", value ? value : null);
18
   };
18
   };

Loading…
Cancel
Save