Browse Source

feat(ui): Add release details chart to analytics (#26619)

Matej Minar 3 years ago
parent
commit
5bbbc25458
1 changed files with 12 additions and 2 deletions
  1. 12 2
      static/app/views/releases/detail/overview/index.tsx

+ 12 - 2
static/app/views/releases/detail/overview/index.tsx

@@ -8,6 +8,7 @@ import TransactionsList, {DropdownOption} from 'app/components/discover/transact
 import {Body, Main, Side} from 'app/components/layouts/thirds';
 import {t} from 'app/locale';
 import {GlobalSelection, NewQuery, Organization, ReleaseProject} from 'app/types';
+import {trackAnalyticsEvent} from 'app/utils/analytics';
 import {getUtcDateString} from 'app/utils/dates';
 import {TableDataRow} from 'app/utils/discover/discoverQuery';
 import EventView from 'app/utils/discover/eventView';
@@ -68,8 +69,17 @@ class ReleaseOverview extends AsyncView<Props> {
   }
 
   handleYAxisChange = (yAxis: YAxis) => {
-    const {location, router} = this.props;
-    const {eventType: _eventType, vitalType: _vitalType, ...query} = location.query;
+    const {location, router, organization} = this.props;
+    const {eventType, vitalType, ...query} = location.query;
+
+    trackAnalyticsEvent({
+      eventKey: `release_detail.change_chart`,
+      eventName: `Release Detail: Change Chart`,
+      organization_id: parseInt(organization.id, 10),
+      display: yAxis,
+      eventType,
+      vitalType,
+    });
 
     router.push({
       ...location,