-
Notifications
You must be signed in to change notification settings - Fork 125
Move telemetry.js to a hosted solution #193
Description
Move https://github.com/mozillareality/metrics to its own repo. Instead of using Google's analytics.js
, we can use Google's Universal Analytics. You can just use navigator.sendBeacon
to POST a JSON payload to https://ssl.google-analytics.com/collect
.
Current work in progress: https://github.com/MozillaReality/metrics
Some context here about documenting it: #164 (comment)
That way, it won't interfere with a user's Google Analytics script they put on their page. And it's as simple as dropping in this script:
Telemetry Usage
To opt in to telemetry (i.e., collecting usage statistics, performance metrics, and catching errors) it in your WebXR site, simply include this snippet of JavaScript code in your HTML (ideally, immediately before the
</head>
or before</body>
):<script src="https://webxr.services/metrics.js" async defer></script>Or this:
<script> // Telemetry for collecting basic usage statistics, performance metrics, and catching errors. (function () { function injectScript () { if (injectScript.injected || !navigator.onLine) { return; } injectScript.injected = true; var refScript = document.querySelector('script'); var script = document.createElement('script'); script.src = 'https://webxr.services/metrics.js'; script.async = true; script.crossorigin = 'anonymous'; (refScript ? refScript.parentNode : document.head).insertBefore(script, ref); } injectScript(); window.addEventListener('online', injectScript); })(); </script>
Metadata
Metadata
Assignees
Labels
Type
Projects
Status