Skip to content
This repository has been archived by the owner on Aug 14, 2019. It is now read-only.

Support for User Timing API #42

Open
pastelsky opened this issue Feb 15, 2017 · 6 comments
Open

Support for User Timing API #42

pastelsky opened this issue Feb 15, 2017 · 6 comments
Labels
migrated The issue has been migrated

Comments

@pastelsky
Copy link

Is there a way to send custom metrics like user timings through segment ? This is supported by google analytics.

@hankim813
Copy link
Contributor

@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.

@dazulu
Copy link

dazulu commented Aug 23, 2017

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.

@hankim813
Copy link
Contributor

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

@chollier
Copy link

I would love to see this prioritized as well

@ryzy
Copy link

ryzy commented May 24, 2018

👍

@SegmentDestinationsBot
Copy link
Contributor

Hi @pastelsky, as part of the monorepo migration, this issue has been moved to new issue. Our engineers have been notified and will prioritize and work on it ASAP. Thank you!

For more information, see README.md.

@SegmentDestinationsBot SegmentDestinationsBot added the migrated The issue has been migrated label Aug 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
migrated The issue has been migrated
Projects
None yet
Development

No branches or pull requests

6 participants