Browse Source

ref(analytics): convert redirect analytics (#47193)

Stephen Cefali 1 year ago
parent
commit
ea2d534560

+ 5 - 0
static/app/utils/analytics/coreuiAnalyticsEvents.tsx

@@ -12,6 +12,10 @@ export type CoreUIEventParameters = {
     path: string;
     utc: boolean;
   };
+  'deprecated_urls.redirect': {
+    feature: string;
+    url: string;
+  };
   'environmentselector.direct_selection': {
     path: string;
   };
@@ -52,4 +56,5 @@ export const coreUIEventMap: Record<CoreUIAnalyticsKey, string | null> = {
   'environmentselector.toggle': null, // volume high
   'environmentselector.update': null, // volume high
   'environmentselector.direct_selection': null, // volume high
+  'deprecated_urls.redirect': null, // volume high
 };

+ 3 - 4
static/app/views/projects/redirectDeprecatedProjectRoute.tsx

@@ -10,7 +10,7 @@ import LoadingIndicator from 'sentry/components/loadingIndicator';
 import {t} from 'sentry/locale';
 import {space} from 'sentry/styles/space';
 import {Project} from 'sentry/types';
-import {analytics} from 'sentry/utils/analytics';
+import trackAdvancedAnalyticsEvent from 'sentry/utils/analytics/trackAdvancedAnalyticsEvent';
 import getRouteStringFromRoutes from 'sentry/utils/getRouteStringFromRoutes';
 import Redirect from 'sentry/utils/redirect';
 import withApi from 'sentry/utils/withApi';
@@ -127,12 +127,11 @@ const redirectDeprecatedProjectRoute = (generateRedirectRoute: RedirectCallback)
       const payload = {
         feature: 'global_views',
         url: getRouteStringFromRoutes(routes), // the URL being redirected from
-        org_id: parseInt(organizationId, 10),
+        organization: organizationId,
       };
 
       // track redirects of deprecated URLs for analytics
-      analytics('deprecated_urls.redirect', payload);
-
+      trackAdvancedAnalyticsEvent('deprecated_urls.redirect', payload);
       return nextRoute;
     }