Open pastelsky opened 7 years ago
@pastelsky hmm I'm not sure how this would fit given Segment's API spec. It wouldn't really be mapped to .identify()
or .track()
since we don't have any events spec'd when it comes to tracking user timing. So I'd imagine without a strong case around viable GA User Timing API <> Segment API mapping, we probably won't support this.
Just dropping in to say that I'd love to see this supported. I would use it to send client side performance metrics to GA's Site Speed User Timings section.
@dazulu we still haven't heard much request for this feature and hasn't been something we prioritized. We do accept PRs :)
For now, you can just do this directly
// .ready ensures the ga integration has been initialized, so its safe to reference third party sdk window objects in the callback
analytics.ready(function() {
// Feature detects Navigation Timing API support.
if (window.performance) {
// Gets the number of milliseconds since page load
// (and rounds the result since the value must be an integer).
var timeSincePageLoad = Math.round(performance.now());
// Sends the timing hit to Google Analytics.
window.ga('send', 'timing', 'JS Dependencies', 'load', timeSincePageLoad);
}
});
I would love to see this prioritized as well
👍
Is there a way to send custom metrics like user timings through segment ? This is supported by google analytics.