From 4fa1528e719df904b88953edb8a625aa06610206 Mon Sep 17 00:00:00 2001 From: Bach Diep <29311886+bndiep@users.noreply.github.com> Date: Mon, 11 Apr 2022 13:06:32 -0700 Subject: [PATCH] feat(tracking): add experiment category to tracking types Adds an `experiment` category and `contentful_experiment_assignment_event` to EventDataTypes. This will help us to send Segment tracking events for Optimizely experiments from portal-app to the monolith. This PR is related to: Add new Segment Tracker event to monolith: https://github.com/codecademy-engineering/Codecademy/pull/30278 Adding tracking event trigger on an decision event: https://github.com/codecademy-engineering/portal-app/pull/1787 We're trying to get a tracking event fired like this: ![Screen Shot 2022-04-06 at 12 06 41 PM](https://user-images.githubusercontent.com/29311886/162050123-5fc0fbe1-8301-4a8f-880e-871f1e47d9b1.png) --- packages/tracking/src/events/types.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/tracking/src/events/types.ts b/packages/tracking/src/events/types.ts index 6008dc485..1eaed4eda 100644 --- a/packages/tracking/src/events/types.ts +++ b/packages/tracking/src/events/types.ts @@ -42,6 +42,10 @@ export type EventDataTypes = { exercise: { force_pass: BaseEventAnyData; }; + // events for tracking experiments in optimizely + experiment: { + contentful_experiment_assignment_event: BaseEventAnyData; + }; payments: { cancel_survey: BaseEventAnyData; };