analytics.ts 783 B

1234567891011121314151617181920212223
  1. export const EVENT_ACTION = "action";
  2. export const EVENT_ALIGN = "align";
  3. export const EVENT_CHANGE = "change";
  4. export const EVENT_DIALOG = "dialog";
  5. export const EVENT_EXIT = "exit";
  6. export const EVENT_IO = "io";
  7. export const EVENT_LAYER = "layer";
  8. export const EVENT_LIBRARY = "library";
  9. export const EVENT_LOAD = "load";
  10. export const EVENT_SHAPE = "shape";
  11. export const EVENT_SHARE = "share";
  12. export const trackEvent = window.gtag
  13. ? (category: string, name: string, label?: string, value?: number) => {
  14. window.gtag("event", name, {
  15. event_category: category,
  16. event_label: label,
  17. value,
  18. });
  19. }
  20. : (category: string, name: string, label?: string, value?: number) => {
  21. console.info("Track Event", category, name, label, value);
  22. };