mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-12 20:10:09 +02:00
Add basic event actions to analytics (#2375)
Co-authored-by: dwelle <luzar.david@gmail.com>
This commit is contained in:
16
src/analytics.ts
Normal file
16
src/analytics.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
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);
|
||||
};
|
Reference in New Issue
Block a user