Skip to content

Commit 0646195

Browse files
committed
chore: add ga event
1 parent 1a5d9e3 commit 0646195

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/components/app/details/appDetails/AppDetailsCDButton.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,13 @@ const AppDetailsCDButton = ({
7878
search: new URLSearchParams(newParams).toString(),
7979
})
8080

81-
if (!isForRollback) {
82-
ReactGA.event(
83-
isAppView ? DA_APP_DETAILS_GA_EVENTS.DeployButtonClicked : AG_APP_DETAILS_GA_EVENTS.DeployButtonClicked,
84-
)
81+
if (isForRollback) {
82+
ReactGA.event(DA_APP_DETAILS_GA_EVENTS.RollbackButtonClicked)
83+
return
8584
}
85+
ReactGA.event(
86+
isAppView ? DA_APP_DETAILS_GA_EVENTS.DeployButtonClicked : AG_APP_DETAILS_GA_EVENTS.DeployButtonClicked,
87+
)
8688
}
8789

8890
const closeCDModal = (e: React.MouseEvent): void => {

src/components/app/details/appDetails/constants.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ export const DA_APP_DETAILS_GA_EVENTS: Record<string, Parameters<typeof ReactGA.
3535
category: 'App Metrics',
3636
action: 'DA_APP_DETAIL_METRICS_PRESET_TIME_RANGE',
3737
},
38+
RollbackButtonClicked: {
39+
category: 'App Details',
40+
action: 'DA_APP_DETAILS_ROLLBACK_CLICKED',
41+
},
3842
}
3943

4044
export const AG_APP_DETAILS_GA_EVENTS: Record<string, Parameters<typeof ReactGA.event>[0]> = {

0 commit comments

Comments
 (0)