mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Add basic event actions to analytics (#2375)
Co-authored-by: dwelle <luzar.david@gmail.com>
This commit is contained in:
parent
014097a97e
commit
abde1daba4
20 changed files with 183 additions and 61 deletions
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);
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue