Browse Source

feat(analytics): track stream index for issue viewed event (#46278)

This will allow us to do analysis based on the index in the stream
Stephen Cefali 1 year ago
parent
commit
cfcf478c04

+ 1 - 0
static/app/components/eventOrGroupHeader.tsx

@@ -117,6 +117,7 @@ function EventOrGroupHeader({
             }`,
             query: {
               referrer: source || 'event-or-group-header',
+              stream_index: index,
               query,
               // This adds sort to the query if one was selected from the
               // issues list page

+ 1 - 0
static/app/components/stream/group.tsx

@@ -247,6 +247,7 @@ function BaseGroupRow({
       pathname: `/organizations/${organization.slug}/issues/${group.id}/events/`,
       query: {
         referrer,
+        stream_index: index,
         ...commonQuery,
         query: filteredQuery,
       },

+ 3 - 1
static/app/views/issueDetails/groupDetails.tsx

@@ -149,13 +149,15 @@ class GroupDetails extends Component<Props, State> {
   trackView(project: Project) {
     const {group, event} = this.state;
     const {location, organization, router} = this.props;
-    const {alert_date, alert_rule_id, alert_type, ref_fallback} = location.query;
+    const {alert_date, alert_rule_id, alert_type, ref_fallback, stream_index} =
+      location.query;
 
     this.props.setEventNames('issue_details.viewed', 'Issue Details: Viewed');
     this.props.setRouteAnalyticsParams({
       ...getAnalyticsDataForGroup(group),
       ...getAnalyticsDataForEvent(event),
       ...getAnalyicsDataForProject(project),
+      stream_index: typeof stream_index === 'string' ? Number(stream_index) : undefined,
       // Alert properties track if the user came from email/slack alerts
       alert_date:
         typeof alert_date === 'string' ? getUtcDateString(Number(alert_date)) : undefined,