diff --git a/src/app/core/services/tracking.service.ts b/src/app/core/services/tracking.service.ts index 2282c585cb..4a29598c73 100644 --- a/src/app/core/services/tracking.service.ts +++ b/src/app/core/services/tracking.service.ts @@ -813,6 +813,10 @@ export class TrackingService { this.eventTrack('Opted In From Profile'); } + optedInFromTasks(): void { + this.eventTrack('Opted In From Tasks'); + } + clickedOnDashboardBanner(): void { this.eventTrack('Clicked On Dashboard Banner'); } diff --git a/src/app/fyle/dashboard/tasks/tasks-2.component.spec.ts b/src/app/fyle/dashboard/tasks/tasks-2.component.spec.ts index 062ba8c730..24b14558fa 100644 --- a/src/app/fyle/dashboard/tasks/tasks-2.component.spec.ts +++ b/src/app/fyle/dashboard/tasks/tasks-2.component.spec.ts @@ -201,6 +201,7 @@ export function TestCases2(getTestBed) { expect(optInModalSpy.present).toHaveBeenCalledTimes(1); expect(optInModalSpy.onWillDismiss).toHaveBeenCalledTimes(1); expect(component.doRefresh).toHaveBeenCalledTimes(1); + expect(trackingService.optedInFromTasks).toHaveBeenCalledTimes(1); })); describe('onReviewExpensesTaskClick():', () => { diff --git a/src/app/fyle/dashboard/tasks/tasks.component.setup.spec.ts b/src/app/fyle/dashboard/tasks/tasks.component.setup.spec.ts index 03fb5c5296..78f5283995 100644 --- a/src/app/fyle/dashboard/tasks/tasks.component.setup.spec.ts +++ b/src/app/fyle/dashboard/tasks/tasks.component.setup.spec.ts @@ -62,6 +62,7 @@ describe('TasksComponent', () => { 'commuteDeductionTaskClicked', 'commuteDeductionDetailsAddedFromSpenderTask', 'clickedOnTask', + 'optedInFromTasks', ]); const loaderServiceSpy = jasmine.createSpyObj('LoaderService', ['showLoader', 'hideLoader']); const matBottomSheetSpy = jasmine.createSpyObj('MatBottomSheet', ['open']); diff --git a/src/app/fyle/dashboard/tasks/tasks.component.ts b/src/app/fyle/dashboard/tasks/tasks.component.ts index 6a40bf7a3e..844e0cc42c 100644 --- a/src/app/fyle/dashboard/tasks/tasks.component.ts +++ b/src/app/fyle/dashboard/tasks/tasks.component.ts @@ -417,6 +417,7 @@ export class TasksComponent implements OnInit { const { data } = await optInModal.onWillDismiss<{ action: string }>(); if (data && data.action === 'SUCCESS') { + this.trackingService.optedInFromTasks(); this.doRefresh(); this.optedIn.emit(); }