excalidraw/src/analytics.ts
Lipis abde1daba4
Add basic event actions to analytics (#2375)
Co-authored-by: dwelle <luzar.david@gmail.com>
2020-12-02 23:57:51 +02:00

17 lines
533 B
TypeScript

export const EVENT_ACTION = "action";
export const EVENT_EXIT = "exit";
export const EVENT_CHANGE = "change";
export const EVENT_SHAPE = "shape";
export const trackEvent = window.gtag
? (name: string, category: string, label?: string, value?: number) => {
window.gtag("event", name, {
event_category: category,
event_label: label,
value,
});
}
: (name: string, category: string, label?: string, value?: number) => {
console.info("Track Event", name, category, label, value);
};