|
@@ -5,7 +5,14 @@ import {ChildrenRenderFn} from 'app/components/acl/feature';
|
|
|
import DateRange from 'app/components/organizations/timeRangeSelector/dateRange';
|
|
|
import SelectorItems from 'app/components/organizations/timeRangeSelector/dateRange/selectorItems';
|
|
|
import SidebarItem from 'app/components/sidebar/sidebarItem';
|
|
|
-import {IntegrationProvider, Member, Organization, Project, User} from 'app/types';
|
|
|
+import {
|
|
|
+ IntegrationProvider,
|
|
|
+ LightWeightOrganization,
|
|
|
+ Member,
|
|
|
+ Organization,
|
|
|
+ Project,
|
|
|
+ User,
|
|
|
+} from 'app/types';
|
|
|
import {ExperimentKey} from 'app/types/experiments';
|
|
|
import {NavigationItem, NavigationSection} from 'app/views/settings/types';
|
|
|
|
|
@@ -89,6 +96,7 @@ export type CustomizationHooks = {
|
|
|
export type AnalyticsHooks = {
|
|
|
'analytics:init-user': AnalyticsInitUser;
|
|
|
'analytics:track-event': AnalyticsTrackEvent;
|
|
|
+ 'analytics:track-event-v2': AnalyticsTrackEventV2;
|
|
|
'analytics:track-adhoc-event': AnalyticsTrackAdhocEvent;
|
|
|
'analytics:log-experiment': AnalyticsLogExperiment;
|
|
|
'metrics:event': MetricsEvent;
|
|
@@ -242,6 +250,44 @@ type AnalyticsTrackEvent = (opts: {
|
|
|
[key: string]: any;
|
|
|
}) => void;
|
|
|
|
|
|
+/**
|
|
|
+ * Trigger analytics tracking in the hook store.
|
|
|
+ */
|
|
|
+type AnalyticsTrackEventV2 = (
|
|
|
+ data: {
|
|
|
+ /**
|
|
|
+ * The Reload event key.
|
|
|
+ */
|
|
|
+ eventKey: string;
|
|
|
+ /**
|
|
|
+ * The Amplitude event name. Set to null if event should not go to Amplitude.
|
|
|
+ */
|
|
|
+ eventName: string | null;
|
|
|
+
|
|
|
+ organization: LightWeightOrganization | null;
|
|
|
+ /**
|
|
|
+ * Arbitrary data to track
|
|
|
+ */
|
|
|
+ [key: string]: any;
|
|
|
+ },
|
|
|
+ options: {
|
|
|
+ /**
|
|
|
+ * If true, send the event to marketing analytics
|
|
|
+ */
|
|
|
+ sendMarketing?: boolean;
|
|
|
+ /**
|
|
|
+ * If true, starts an analytics session. This session can be used
|
|
|
+ * to construct funnels. The start of the funnel should have
|
|
|
+ * startSession set to true.
|
|
|
+ */
|
|
|
+ startSession?: boolean;
|
|
|
+ /**
|
|
|
+ * An arbitrary function to map the parameters to new parameters
|
|
|
+ */
|
|
|
+ mapValuesFn?: (params: Record<string, any>) => Record<string, any>;
|
|
|
+ }
|
|
|
+) => void;
|
|
|
+
|
|
|
/**
|
|
|
* Trigger ad hoc analytics tracking in the hook store.
|
|
|
*/
|