Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 4 additions & 1 deletion static/app/utils/analytics/trackAdvancedAnalyticsEvent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,22 @@ import {
performanceEventMap,
PerformanceEventParameters,
} from './performanceAnalyticsEvents';
import {TeamInsightsEventParameters, workflowEventMap} from './workflowAnalyticsEvents';

type EventParameters = GrowthEventParameters &
IssueEventParameters &
PerformanceEventParameters &
DashboardsEventParameters &
DiscoverEventParameters;
DiscoverEventParameters &
TeamInsightsEventParameters;

const allEventMap = {
...growthEventMap,
...issueEventMap,
...performanceEventMap,
...dashboardsEventMap,
...discoverEventMap,
...workflowEventMap,
};

/**
Expand Down
9 changes: 9 additions & 0 deletions static/app/utils/analytics/workflowAnalyticsEvents.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export type TeamInsightsEventParameters = {
'team_insights.viewed': {};
};

export type TeamInsightsEventKey = keyof TeamInsightsEventParameters;

export const workflowEventMap: Record<TeamInsightsEventKey, string | null> = {
'team_insights.viewed': 'Team Insights: Viewed',
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Fragment} from 'react';
import {Fragment, useEffect} from 'react';
import {RouteComponentProps} from 'react-router';
import {useTheme} from '@emotion/react';
import styled from '@emotion/styled';
Expand All @@ -17,6 +17,7 @@ import PageTimeRangeSelector from 'app/components/pageTimeRangeSelector';
import {t} from 'app/locale';
import space from 'app/styles/space';
import {DateString, Organization, RelativePeriod, TeamWithProjects} from 'app/types';
import trackAdvancedAnalyticsEvent from 'app/utils/analytics/trackAdvancedAnalyticsEvent';
import localStorage from 'app/utils/localStorage';
import withApi from 'app/utils/withApi';
import withOrganization from 'app/utils/withOrganization';
Expand Down Expand Up @@ -75,6 +76,12 @@ function TeamInsightsOverview({
const currentTeam = teams.find(team => team.id === currentTeamId);
const projects = currentTeam?.projects ?? [];

useEffect(() => {
trackAdvancedAnalyticsEvent('team_insights.viewed', {
organization,
});
}, []);

function handleChangeTeam(teamId: string) {
localStorage.setItem(localStorageKey, teamId);
setStateOnUrl({team: teamId});
Expand Down