main

mattermost/focalboard

Last updated at: 29/12/2023 09:41

telemetry.ts

TLDR

The telemetry.ts file is part of the Demo Projects project. It contains an interface called TelemetryHandler that defines two methods for tracking events and page visits.

Methods

trackEvent

This method tracks an event and sends the event data to a telemetry service. It takes the following parameters:

  • userId (string): The ID of the user who triggered the event.
  • userRoles (string): The roles assigned to the user.
  • category (string): The category of the event.
  • event (string): The event name.
  • props (optional any): Additional properties related to the event (if any).

pageVisited

This method tracks a page visit and sends the page visit data to a telemetry service. It takes the following parameters:

  • userId (string): The ID of the user who visited the page.
  • userRoles (string): The roles assigned to the user.
  • category (string): The category of the page.
  • name (string): The name or URL of the page.
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

export interface TelemetryHandler {
    trackEvent: (userId: string, userRoles: string, category: string, event: string, props?: any) => void
    pageVisited: (userId: string, userRoles: string, category: string, name: string) => void
}