Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(analytics): Record the tour exit stage on esc-key press #87307

Merged
merged 2 commits into from
Mar 18, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions static/app/components/tours/components.tsx
Original file line number Diff line number Diff line change
@@ -67,6 +67,7 @@ export function TourContextProvider<T extends TourEnumType>({
omitBlur,
orderedStepIds,
}: TourContextProviderProps<T>) {
const organization = useOrganization();
const {mutate} = useMutateAssistant();
const tourContextValue = useTourReducer<T>({
isAvailable,
@@ -91,13 +92,14 @@ export function TourContextProvider<T extends TourEnumType>({
if (tourKey) {
mutate({guide: tourKey, status: 'dismissed'});
}
trackAnalytics('tour-guide.dismiss', {organization, id: `${currentStepId}`});
dispatch({type: 'END_TOUR'});
},
},
{match: ['left', 'h'], callback: () => dispatch({type: 'PREVIOUS_STEP'})},
{match: ['right', 'l'], callback: () => dispatch({type: 'NEXT_STEP'})},
];
}, [dispatch, mutate, tourKey, isTourActive]);
}, [dispatch, mutate, tourKey, isTourActive, organization, currentStepId]);

useHotkeys(tourHotkeys);

@@ -320,7 +322,7 @@ export function TourGuide({
{isDismissVisible && (
<TourCloseButton
onClick={e => {
trackAnalytics('tour-guide.close', {organization, id});
trackAnalytics('tour-guide.dismiss', {organization, id});
handleDismiss(e);
}}
icon={<IconClose style={{color: darkTheme.textColor}} />}
4 changes: 2 additions & 2 deletions static/app/utils/analytics/issueAnalyticsEvents.tsx
Original file line number Diff line number Diff line change
@@ -372,7 +372,7 @@ export type IssueEventParameters = {
'tag.clicked': {
is_clickable: boolean;
};
'tour-guide.close': {id?: string};
'tour-guide.dismiss': {id?: string};
'tour-guide.open': {id?: string};
'whats_new.link_clicked': Pick<Broadcast, 'title'> &
Partial<Pick<Broadcast, 'category'>>;
@@ -530,6 +530,6 @@ export const issueEventMap: Record<IssueEventKey, string | null> = {
'issue_details.comment_deleted': 'Issue Details: Comment Deleted',
'issue_details.comment_updated': 'Issue Details: Comment Updated',
'tour-guide.open': 'Tour Guide: Opened',
'tour-guide.close': 'Tour Guide: Closed',
'tour-guide.dismiss': 'Tour Guide: Dismissed',
'whats_new.link_clicked': "What's New: Link Clicked",
};