Files
outline/app/utils/Analytics.ts
T
Tom Moor f7c41395c4 chore: Remove Google Analytics 3 (Universal Analytics) code (#14792)
Google stopped processing UA data in July 2023, so the UA- path, autotrack plugins and ga() calls did nothing.
2026-11-28 10:45:46 -05:00

23 lines
513 B
TypeScript

/**
* Helper class to track events across various analytics integrations
*/
export default class Analytics {
/**
* Send an event to Analytics
*
* @param event The event name
* @param action The action name
* @param metadata Additional parameters to attach to the event
*/
public static track = (
event: string,
action: string,
metadata?: Record<string, string>
) => {
// GA4
if (window.gtag) {
window.gtag("event", event, { action, ...metadata });
}
};
}