Browse Source

feat(mobile-prompt): replace mobile prompt check event (#25357)

Stephen Cefali 3 years ago
parent
commit
199ef333c9

+ 13 - 16
static/app/components/suggestProjectCTA.tsx

@@ -118,22 +118,19 @@ class SuggestProjectCTA extends React.Component<Props, State> {
       },
       () => {
         const matchedUserAgentString = this.matchedUserAgentString;
-
-        //now record the results
-        trackAdvancedAnalyticsEvent(
-          'growth.check_show_mobile_prompt_banner',
-          {
-            matchedUserAgentString,
-            userAgentMatches: !!matchedUserAgentString,
-            hasMobileProject: this.hasMobileProject,
-            snoozedOrDismissed: isDismissed,
-            mobileEventBrowserName: mobileEventResult?.browserName || '',
-            mobileEventClientOsName: mobileEventResult?.clientOsName || '',
-            showCTA: this.showCTA,
-          },
-          this.props.organization,
-          {startSession: true}
-        );
+        if (this.showCTA) {
+          //now record the results
+          trackAdvancedAnalyticsEvent(
+            'growth.show_mobile_prompt_banner',
+            {
+              matchedUserAgentString,
+              mobileEventBrowserName: mobileEventResult?.browserName || '',
+              mobileEventClientOsName: mobileEventResult?.clientOsName || '',
+            },
+            this.props.organization,
+            {startSession: true}
+          );
+        }
       }
     );
   }

+ 3 - 7
static/app/utils/growthAnalyticsEvents.tsx

@@ -2,19 +2,15 @@ type MobilePromptBannerParams = {
   matchedUserAgentString: string;
 };
 
-type CheckShowParams = MobilePromptBannerParams & {
-  userAgentMatches: boolean;
+type ShowParams = MobilePromptBannerParams & {
   matchedUserAgentString: string;
-  hasMobileProject: boolean;
-  snoozedOrDismissed: boolean;
   mobileEventBrowserName: string;
   mobileEventClientOsName: string;
-  showCTA: boolean;
 };
 
 //define the event key to payload mappings
 export type GrowthEventParameters = {
-  'growth.check_show_mobile_prompt_banner': CheckShowParams;
+  'growth.show_mobile_prompt_banner': ShowParams;
   'growth.dismissed_mobile_prompt_banner': MobilePromptBannerParams;
   'growth.opened_mobile_project_suggest_modal': MobilePromptBannerParams;
   'growth.clicked_mobile_prompt_setup_project': MobilePromptBannerParams;
@@ -26,7 +22,7 @@ export type GrowthEventParameters = {
 type GrowthAnalyticsKey = keyof GrowthEventParameters;
 
 export const growthEventMap: Record<GrowthAnalyticsKey, string> = {
-  'growth.check_show_mobile_prompt_banner': 'Growth: Check Show Mobile Prompt Banner',
+  'growth.show_mobile_prompt_banner': 'Growth: Show Mobile Prompt Banner',
   'growth.dismissed_mobile_prompt_banner': 'Growth: Dismissed Mobile Prompt Banner',
   'growth.opened_mobile_project_suggest_modal':
     'Growth: Open Mobile Project Suggest Modal',