replayAnalyticsEvents.tsx 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import type {LayoutKey} from 'sentry/utils/replays/hooks/useReplayLayout';
  2. export type ReplayEventParameters = {
  3. 'replay.details-layout-changed': {
  4. chosen_layout: LayoutKey;
  5. default_layout: LayoutKey;
  6. };
  7. 'replay.details-resized-panel': {
  8. layout: LayoutKey;
  9. slide_motion: 'toTop' | 'toBottom' | 'toLeft' | 'toRight';
  10. };
  11. 'replay.details-tab-changed': {
  12. tab: string;
  13. };
  14. 'replay.details-time-spent': {
  15. seconds: number;
  16. user_email: string;
  17. };
  18. 'replay.details-viewed': {
  19. referrer: undefined | string;
  20. user_email: string;
  21. };
  22. 'replay.play-pause': {
  23. play: boolean;
  24. user_email: string;
  25. };
  26. 'replay.render-player': {
  27. aspect_ratio: 'portrait' | 'landscape';
  28. /*
  29. * What scale is the video as a percent, bucketed into ranges of 10% increments
  30. * example:
  31. * - The video is shown at 25% the normal size
  32. * - in CSS we use the statement `transform: scale(0.25);`
  33. * - The logged value is `20`, because the scale is in the range of 20% to 30%.
  34. */
  35. scale_bucket: 0 | 10 | 20 | 30 | 40 | 50 | 60 | 70 | 80 | 90 | 100;
  36. };
  37. 'replay.toggle-fullscreen': {
  38. fullscreen: boolean;
  39. user_email: string;
  40. };
  41. };
  42. export type ReplayEventKey = keyof ReplayEventParameters;
  43. export const replayEventMap: Record<ReplayEventKey, string | null> = {
  44. 'replay.details-layout-changed': 'Changed Replay Details Layout',
  45. 'replay.details-resized-panel': 'Resized Replay Details Panel',
  46. 'replay.details-tab-changed': 'Changed Replay Details Tab',
  47. 'replay.details-time-spent': 'Time Spent Viewing Replay Details',
  48. 'replay.details-viewed': 'Viewed Replay Details',
  49. 'replay.play-pause': 'Played/Paused Replay',
  50. 'replay.render-player': 'Rendered ReplayPlayer',
  51. 'replay.toggle-fullscreen': 'Toggled Replay Fullscreen',
  52. };