ebidel/appmetrics.js

Google Analytics requires integer timing

ejdaly opened this issue · 1 comments

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));

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