trackAdvancedAnalyticsEvent.tsx 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import {dashboardsEventMap, DashboardsEventParameters} from './dashboardsAnalyticsEvents';
  2. import {discoverEventMap, DiscoverEventParameters} from './discoverAnalyticsEvents';
  3. import {growthEventMap, GrowthEventParameters} from './growthAnalyticsEvents';
  4. import {issueEventMap, IssueEventParameters} from './issueAnalyticsEvents';
  5. import makeAnalyticsFunction from './makeAnalyticsFunction';
  6. import {
  7. performanceEventMap,
  8. PerformanceEventParameters,
  9. } from './performanceAnalyticsEvents';
  10. import {searchEventMap, SearchEventParameters} from './searchAnalyticsEvents';
  11. import {settingsEventMap, SettingsEventParameters} from './settingsAnalyticsEvents';
  12. import {TeamInsightsEventParameters, workflowEventMap} from './workflowAnalyticsEvents';
  13. type EventParameters = GrowthEventParameters &
  14. IssueEventParameters &
  15. PerformanceEventParameters &
  16. DashboardsEventParameters &
  17. DiscoverEventParameters &
  18. TeamInsightsEventParameters &
  19. SearchEventParameters &
  20. SettingsEventParameters;
  21. const allEventMap = {
  22. ...growthEventMap,
  23. ...issueEventMap,
  24. ...performanceEventMap,
  25. ...dashboardsEventMap,
  26. ...discoverEventMap,
  27. ...workflowEventMap,
  28. ...searchEventMap,
  29. ...settingsEventMap,
  30. };
  31. /**
  32. * Generic typed analytics function for growth, issue, and performance events.
  33. * Can split up analytics functions to a smaller set of events like we do for trackIntegrationAnalytics
  34. */
  35. const trackAdvancedAnalyticsEvent = makeAnalyticsFunction<EventParameters>(allEventMap);
  36. export default trackAdvancedAnalyticsEvent;