浏览代码

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

Rounds floats passed to analytics (instead of truncating them).
j8
Дамян Минков 9 年前
父节点
当前提交
202ad0542f
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1
    1
      analytics.js

+ 1
- 1
analytics.js 查看文件

@@ -12,7 +12,7 @@
12 12
 
13 13
   Analytics.prototype.sendEvent = function (action, data) {
14 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 17
     ga('send', 'event', 'jit.si', action, "", value ? value : null);
18 18
   };

正在加载...
取消
保存