(core) Add telemetry

Test Plan: Server tests.

Reviewers: jarek

Differential Revision: https://phab.getgrist.com/D3818
This commit is contained in:
George Gevoian
2023-04-06 11:10:29 -04:00
parent 6a4b7d96e8
commit a19ba0813a
28 changed files with 555 additions and 44 deletions

21
app/common/Telemetry.ts Normal file
View File

@@ -0,0 +1,21 @@
export const TelemetryTemplateSignupCookieName = 'gr_template_signup_trk';
export const TelemetryEventNames = [
'apiUsage',
'beaconOpen',
'beaconArticleViewed',
'beaconEmailSent',
'beaconSearch',
'documentForked',
'documentOpened',
'documentUsage',
'sendingWebhooks',
'signupVerified',
'siteMembership',
'siteUsage',
'tutorialProgressChanged',
'tutorialRestarted',
'watchedVideoTour',
] as const;
export type TelemetryEventName = typeof TelemetryEventNames[number];

View File

@@ -125,6 +125,7 @@ export interface DocumentOptions {
export interface TutorialMetadata {
lastSlideIndex?: number;
numSlides?: number;
}
export interface DocumentProperties extends CommonProperties {

View File

@@ -79,6 +79,7 @@ export const commonUrls = {
efcrHelp: 'https://www.nioxus.info/eFCR-Help',
basicTutorial: 'https://templates.getgrist.com/woXtXUBmiN5T/Grist-Basics',
basicTutorialImage: 'https://www.getgrist.com/wp-content/uploads/2021/08/lightweight-crm.png',
gristLabsCustomWidgets: 'https://gristlabs.github.io/grist-widget/',
};
/**

View File

@@ -4,7 +4,7 @@ import { GristObjCode } from "app/plugin/GristData";
// tslint:disable:object-literal-key-quotes
export const SCHEMA_VERSION = 36;
export const SCHEMA_VERSION = 37;
export const schema = {
@@ -148,6 +148,7 @@ export const schema = {
fileName : "Text",
fileType : "Text",
fileSize : "Int",
fileExt : "Text",
imageHeight : "Int",
imageWidth : "Int",
timeDeleted : "DateTime",
@@ -354,6 +355,7 @@ export interface SchemaTypes {
fileName: string;
fileType: string;
fileSize: number;
fileExt: string;
imageHeight: number;
imageWidth: number;
timeDeleted: number;