ebidel / appmetrics.js

A small (< 1kb) library for measuring things in your web app and reporting the results to Google Analytics.
Apache License 2.0
1.37k stars 67 forks source link

Google Analytics requires integer timing #8

Closed ejdaly closed 6 years ago

ejdaly commented 7 years ago

My timing events were not showing up on GA.

Forcing appmetrics to send integer values for time (ms) fixed this for me https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#timingValue

A Math.round() in sendToAnalytics() will fix this in general: ga('send', 'timing', category, metric, Math.round(duration));

ebidel commented 7 years ago

Huh. I haven't run into this myself but we should definitely follow the docs. Interested in a PR?