(core) Tweak telemetry

Summary: Adjusts the level of telemetry collected from Grist SaaS.

Test Plan: Tested manually.

Reviewers: paulfitz

Reviewed By: paulfitz

Subscribers: paulfitz

Differential Revision: https://phab.getgrist.com/D3899
This commit is contained in:
George Gevoian
2023-05-18 18:35:39 -04:00
parent be5cb9124a
commit 1e873b4203
13 changed files with 107 additions and 49 deletions

View File

@@ -2,10 +2,10 @@ import {logError} from 'app/client/models/errors';
import {TelemetryEventName} from 'app/common/Telemetry';
import {fetchFromHome, pageHasHome} from 'app/common/urlUtils';
export async function logTelemetryEvent(name: TelemetryEventName, metadata?: Record<string, any>) {
export function logTelemetryEvent(name: TelemetryEventName, metadata?: Record<string, any>) {
if (!pageHasHome()) { return; }
await fetchFromHome('/api/telemetry', {
fetchFromHome('/api/telemetry', {
method: 'POST',
body: JSON.stringify({
name,

View File

@@ -36,7 +36,7 @@ const VIDEO_TOUR_YOUTUBE_EMBED_ID = 'qnr2Pfnxdlc';
owner.onDispose(async () => {
if (youtubePlayer.isLoading()) { return; }
await logTelemetryEvent('watchedVideoTour', {
logTelemetryEvent('watchedVideoTour', {
watchTimeSeconds: Math.floor(youtubePlayer.getCurrentTime()),
});
});