matrix-react-sdk
Version:
SDK for matrix.org using React
22 lines (21 loc) • 1 kB
TypeScript
import SettingController from "./SettingController";
import { SettingLevel } from "../SettingLevel";
import { InteractionName } from "../../PosthogTrackers";
/**
* Controller that sends events to analytics when a setting is changed.
* Since it will only trigger events when the setting is changed,
* (and the value isn't reported: only the fact that it's been toggled)
* it won't be useful for tracking what percentage of a userbase has a given setting
* enabled, but many of our settings can be set per device and Posthog only supports
* per-user properties, so this isn't straightforward. This is only for seeing how
* often people interact with the settings.
*/
export default class AnalyticsController extends SettingController {
private interactionName;
/**
*
* @param interactionName The name of the event to send to analytics
*/
constructor(interactionName: InteractionName);
onChange(_level: SettingLevel, _roomId: string | null, _newValue: any): void;
}