How to use the @hint/utils-telemetry.trackEvent function in @hint/utils-telemetry

To help you get started, we’ve selected a few @hint/utils-telemetry examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github webhintio / hint / packages / extension-browser / src / devtools / utils / analytics.ts View on Github external
export const trackFinish = (config: Config, results: Results, duration: number) => {
    // Extract hint status from config and results, discarding user-provided data.
    const properties = determineHintStatus(config, results);

    trackEvent('f12-finish', properties, { 'f12-finish-duration': duration });
};
github webhintio / hint / packages / extension-vscode / src / utils / analytics.ts View on Github external
const trackActive = (storage: Configstore) => {
    // Don't count a user as active if telemetry is disabled.
    if (!enabled()) {
        return;
    }

    const activity = getUpdatedActivity(storage.get(activityKey));

    if (activity) {
        storage.set(activityKey, activity);
        trackEvent('vscode-activity', activity);
    }
};
github webhintio / hint / packages / extension-browser / src / devtools / utils / analytics.ts View on Github external
export const enable = (storage = localstore) => {
    storage.setItem(storageKey, true);

    setup(storage);

    // If it is the first time the user enable telemetry
    if (!storage.getItem(alreadyOptInKey)) {
        storage.setItem(alreadyOptInKey, true);
        trackEvent('f12-telemetry');
    }
};
github webhintio / hint / packages / extension-browser / src / devtools / utils / analytics.ts View on Github external
const trackActive = (storage = localstore) => {
    // Don't count a user as active if telemetry is disabled.
    if (!enabled(storage)) {
        return;
    }

    const activity = getUpdatedActivity(storage.getItem(activityKey));

    if (activity) {
        storage.setItem(activityKey, activity);
        trackEvent('f12-activity', activity);
    }
};
github webhintio / hint / packages / extension-vscode / src / utils / analytics.ts View on Github external
const trackOpen = (result: ProblemCountMap, languageId: string, storage: Configstore) => {
    const status = determineHintStatus({}, result);

    trackEvent('vscode-open', { ...status, languageId });
    trackActive(storage);
};
github webhintio / hint / packages / extension-browser / src / devtools / utils / analytics.ts View on Github external
export const trackTimeout = (duration: number) => {
    trackEvent('f12-timeout', undefined, { 'f12-timeout-duration': duration });
};
github webhintio / hint / packages / extension-browser / src / devtools / utils / analytics.ts View on Github external
export const trackCancel = (duration: number) => {
    trackEvent('f12-cancel', undefined, { 'f12-cancel-duration': duration });
};
github webhintio / hint / packages / extension-browser / src / devtools / utils / analytics.ts View on Github external
export const trackStart = () => {
    trackEvent('f12-start');
    trackActive();
};
github webhintio / hint / packages / extension-vscode / src / utils / analytics.ts View on Github external
export const trackOptIn = (telemetryEnabled: TelemetryState, everEnabledTelemetry: boolean) => {
    if (telemetryEnabled === 'enabled' && !everEnabledTelemetry) {
        trackEvent('vscode-telemetry');
    }
};