From 2cdf240fb2e6cd781ef5d0fb03806cde3b3afb7c Mon Sep 17 00:00:00 2001 From: Afzal Khan Date: Sun, 18 Aug 2024 20:03:58 +0530 Subject: [PATCH] [GSoC'24] M2.7: Add classroom related analytic events (#20814) * Add classroom related analytic events * fix ga event * fix console error * fix rtl topic tile * show published classrooms in learner dashboard * add analytic for new lesson card in home tab * add test * add continue event * remove console * add test for learner dashboard * fix test * update function name --- core/domain/learner_progress_services.py | 9 ++++ core/domain/learner_progress_services_test.py | 14 ++++++ .../classroom-navigation-links.component.html | 4 +- ...assroom-navigation-links.component.spec.ts | 19 +++----- .../classroom-navigation-links.component.ts | 7 ++- .../topic-summary-tile.component.html | 2 +- .../topic-summary-tile.component.spec.ts | 7 +++ .../topic-summary-tile.component.ts | 4 ++ .../classrooms-page.component.html | 2 +- .../classrooms-page.component.spec.ts | 16 ++++++- .../classrooms-page.component.ts | 11 ++++- .../home-tab.component.html | 4 +- .../home-tab.component.spec.ts | 25 +++++++++++ .../home-tab.component.ts | 24 ++++++++++- .../library-page/library-page.component.html | 18 ++++---- .../library-page.component.spec.ts | 15 +++++++ .../library-page/library-page.component.ts | 13 +++++- .../services/site-analytics.service.spec.ts | 43 ++++++++++++++++--- .../services/site-analytics.service.ts | 38 ++++++++++++++-- 19 files changed, 231 insertions(+), 44 deletions(-) diff --git a/core/domain/learner_progress_services.py b/core/domain/learner_progress_services.py index e0510aa1c564..cfdf474ed6bf 100644 --- a/core/domain/learner_progress_services.py +++ b/core/domain/learner_progress_services.py @@ -1728,7 +1728,16 @@ def get_displayable_untracked_topic_summary_dicts( ] = collections.defaultdict(list) topic_ids = [topic.id for topic in untracked_topic_summaries] topics = topic_fetchers.get_topics_by_ids(topic_ids, strict=True) + classrooms = classroom_config_services.get_all_classrooms() + published_classroom_topic_ids = [ + topic_id + for classroom in classrooms if classroom.is_published + for topic_id in classroom.topic_id_to_prerequisite_topic_ids.keys() + ] + for index, topic in enumerate(topics): + if topic.id not in published_classroom_topic_ids: + continue all_skill_ids = topic.get_all_skill_ids() skill_descriptions = ( skill_services.get_descriptions_of_skills( diff --git a/core/domain/learner_progress_services_test.py b/core/domain/learner_progress_services_test.py index c884a8d771f5..0bc39f8825e8 100644 --- a/core/domain/learner_progress_services_test.py +++ b/core/domain/learner_progress_services_test.py @@ -1602,6 +1602,12 @@ def test_get_all_and_untracked_topic_ids(self) -> None: self.TOPIC_ID_1: [] } ) + self.save_new_valid_classroom( + is_published=False, + name='History', + url_fragment='history', + classroom_id='historyid' + ) self.login(self.USER_EMAIL) partially_learnt_topic_ids = ( @@ -1655,6 +1661,14 @@ def test_get_all_and_untracked_topic_ids(self) -> None: learner_progress_services.get_all_and_untracked_topic_ids_for_user( partially_learnt_topic_ids, learnt_topic_ids, topic_ids_to_learn)) + untracked_topic_summary_dicts = ( + learner_progress_services + .get_displayable_untracked_topic_summary_dicts( + self.user_id, + topic_fetchers.get_all_topic_summaries() + ) + ) + self.assertEqual(len(untracked_topic_summary_dicts), 1) self.assertEqual(len(all_topics), 2) self.assertEqual(len(untracked_topics), 0) diff --git a/core/templates/components/common-layout-directives/common-elements/classroom-navigation-links.component.html b/core/templates/components/common-layout-directives/common-elements/classroom-navigation-links.component.html index d94af7a54352..ffc29058b1a2 100644 --- a/core/templates/components/common-layout-directives/common-elements/classroom-navigation-links.component.html +++ b/core/templates/components/common-layout-directives/common-elements/classroom-navigation-links.component.html @@ -10,19 +10,17 @@

{{ 'I18N_CLASSROOM_NAVIGATION_LINKS_DESCRIPTION' | translate }}

-
+
{{ classroom.name }} {{ getClassroomNameTranslationkey(classroom.name) | translate }} diff --git a/core/templates/components/common-layout-directives/common-elements/classroom-navigation-links.component.spec.ts b/core/templates/components/common-layout-directives/common-elements/classroom-navigation-links.component.spec.ts index e735f9f7bed1..14f6649d6785 100644 --- a/core/templates/components/common-layout-directives/common-elements/classroom-navigation-links.component.spec.ts +++ b/core/templates/components/common-layout-directives/common-elements/classroom-navigation-links.component.spec.ts @@ -78,10 +78,6 @@ describe('ClassroomNavigationLinksComponent', () => { 'AssetsBackendApiService', ['getThumbnailUrlForPreview'] ); - const siteAnalyticsServiceSpy = jasmine.createSpyObj( - 'SiteAnalyticsService', - ['registerClassroomHeaderClickEvent'] - ); await TestBed.configureTestingModule({ imports: [HttpClientModule, HttpClientTestingModule], @@ -95,10 +91,6 @@ describe('ClassroomNavigationLinksComponent', () => { provide: AssetsBackendApiService, useValue: assetsBackendApiServiceSpy, }, - { - provide: SiteAnalyticsService, - useValue: siteAnalyticsServiceSpy, - }, ], }).compileComponents(); @@ -179,11 +171,14 @@ describe('ClassroomNavigationLinksComponent', () => { ).toHaveBeenCalledWith(classroomName); }); - it('should register classroom header click event', () => { - component.registerClassroomHeaderClickEvent(); - + it('should record analytics when classroom card is clicked', () => { + spyOn( + siteAnalyticsService, + 'registerClickClassroomCardEvent' + ).and.callThrough(); + component.registerClassroomCardClickEvent('Math'); expect( - siteAnalyticsService.registerClassroomHeaderClickEvent + siteAnalyticsService.registerClickClassroomCardEvent ).toHaveBeenCalled(); }); }); diff --git a/core/templates/components/common-layout-directives/common-elements/classroom-navigation-links.component.ts b/core/templates/components/common-layout-directives/common-elements/classroom-navigation-links.component.ts index 6ea3b8760242..6ed44aa4c5cc 100644 --- a/core/templates/components/common-layout-directives/common-elements/classroom-navigation-links.component.ts +++ b/core/templates/components/common-layout-directives/common-elements/classroom-navigation-links.component.ts @@ -65,8 +65,11 @@ export class ClassroomNavigationLinksComponent implements OnInit { ); } - registerClassroomHeaderClickEvent(): void { - this.siteAnalyticsService.registerClassroomHeaderClickEvent(); + registerClassroomCardClickEvent(classroomName: string): void { + this.siteAnalyticsService.registerClickClassroomCardEvent( + 'Classroom card in the navigation dropdown', + classroomName + ); } ngOnInit(): void { diff --git a/core/templates/components/summary-tile/topic-summary-tile.component.html b/core/templates/components/summary-tile/topic-summary-tile.component.html index 21bc67d5ecb6..6d7c00cf1f18 100644 --- a/core/templates/components/summary-tile/topic-summary-tile.component.html +++ b/core/templates/components/summary-tile/topic-summary-tile.component.html @@ -10,7 +10,7 @@
-
+
{{ topicSummary.getName() }} diff --git a/core/templates/components/summary-tile/topic-summary-tile.component.spec.ts b/core/templates/components/summary-tile/topic-summary-tile.component.spec.ts index e2aa956a1649..865dc37d2245 100644 --- a/core/templates/components/summary-tile/topic-summary-tile.component.spec.ts +++ b/core/templates/components/summary-tile/topic-summary-tile.component.spec.ts @@ -122,4 +122,11 @@ describe('TopicSummaryTileCompoennt', () => { expect(component.isHackyTopicNameTranslationDisplayed()).toBe(true); }); + + it('should get RTL language status correctly', () => { + spyOn(i18nLanguageCodeService, 'isCurrentLanguageRTL').and.returnValue( + true + ); + expect(component.isLanguageRTL()).toBeTrue(); + }); }); diff --git a/core/templates/components/summary-tile/topic-summary-tile.component.ts b/core/templates/components/summary-tile/topic-summary-tile.component.ts index 8a3a546aff5d..a3b13c470951 100644 --- a/core/templates/components/summary-tile/topic-summary-tile.component.ts +++ b/core/templates/components/summary-tile/topic-summary-tile.component.ts @@ -108,6 +108,10 @@ export class TopicSummaryTileComponent { ) && !this.i18nLanguageCodeService.isCurrentLanguageEnglish() ); } + + isLanguageRTL(): boolean { + return this.i18nLanguageCodeService.isCurrentLanguageRTL(); + } } angular.module('oppia').directive( diff --git a/core/templates/pages/classrooms-page/classrooms-page.component.html b/core/templates/pages/classrooms-page/classrooms-page.component.html index 6f0dfb192685..a96c57644564 100644 --- a/core/templates/pages/classrooms-page/classrooms-page.component.html +++ b/core/templates/pages/classrooms-page/classrooms-page.component.html @@ -36,7 +36,7 @@

Oppia Classrooms

- + diff --git a/core/templates/pages/classrooms-page/classrooms-page.component.spec.ts b/core/templates/pages/classrooms-page/classrooms-page.component.spec.ts index 31a36fb750b1..034228cdc617 100644 --- a/core/templates/pages/classrooms-page/classrooms-page.component.spec.ts +++ b/core/templates/pages/classrooms-page/classrooms-page.component.spec.ts @@ -32,6 +32,7 @@ import {MockTranslatePipe} from 'tests/unit-test-utils'; import {ClassroomsPageComponent} from './classrooms-page.component'; import {CapitalizePipe} from 'filters/string-utility-filters/capitalize.pipe'; import {Router} from '@angular/router'; +import {SiteAnalyticsService} from 'services/site-analytics.service'; class MockCapitalizePipe { transform(input: string): string { @@ -51,13 +52,14 @@ class MockRouter { } } -describe('Classroom Page Component', () => { +describe('Classrooms Page Component', () => { let component: ClassroomsPageComponent; let fixture: ComponentFixture; let classroomBackendApiService: ClassroomBackendApiService; let alertsService: AlertsService; let router: Router; let i18nLanguageCodeService: I18nLanguageCodeService; + let siteAnalyticsService: SiteAnalyticsService; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ @@ -80,6 +82,7 @@ describe('Classroom Page Component', () => { }).compileComponents(); router = TestBed.inject(Router); i18nLanguageCodeService = TestBed.inject(I18nLanguageCodeService); + siteAnalyticsService = TestBed.inject(SiteAnalyticsService); })); beforeEach(() => { @@ -205,4 +208,15 @@ describe('Classroom Page Component', () => { ); expect(component.isLanguageRTL()).toBeTrue(); }); + + it('should record analytics when classroom card is clicked', () => { + spyOn( + siteAnalyticsService, + 'registerClickClassroomCardEvent' + ).and.callThrough(); + component.registerClassroomCardClickEvent('Math'); + expect( + siteAnalyticsService.registerClickClassroomCardEvent + ).toHaveBeenCalled(); + }); }); diff --git a/core/templates/pages/classrooms-page/classrooms-page.component.ts b/core/templates/pages/classrooms-page/classrooms-page.component.ts index 27f1f2466c62..4915a984134a 100644 --- a/core/templates/pages/classrooms-page/classrooms-page.component.ts +++ b/core/templates/pages/classrooms-page/classrooms-page.component.ts @@ -26,6 +26,7 @@ import { import {LoaderService} from 'services/loader.service'; import {AppConstants} from 'app.constants'; import {I18nLanguageCodeService} from 'services/i18n-language-code.service'; +import {SiteAnalyticsService} from 'services/site-analytics.service'; @Component({ selector: 'oppia-classrooms-page', @@ -51,13 +52,21 @@ export class ClassroomsPageComponent { private alertsService: AlertsService, private loaderService: LoaderService, private router: Router, - private i18nLanguageCodeService: I18nLanguageCodeService + private i18nLanguageCodeService: I18nLanguageCodeService, + private siteAnalyticsService: SiteAnalyticsService ) {} isLanguageRTL(): boolean { return this.i18nLanguageCodeService.isCurrentLanguageRTL(); } + registerClassroomCardClickEvent(classroomName: string): void { + this.siteAnalyticsService.registerClickClassroomCardEvent( + 'Classroom card in the classrooms page', + classroomName + ); + } + ngOnInit(): void { this.loaderService.showLoadingScreen('Loading'); diff --git a/core/templates/pages/learner-dashboard-page/home-tab.component.html b/core/templates/pages/learner-dashboard-page/home-tab.component.html index 07d6f4c35777..db7784a13891 100644 --- a/core/templates/pages/learner-dashboard-page/home-tab.component.html +++ b/core/templates/pages/learner-dashboard-page/home-tab.component.html @@ -26,7 +26,7 @@
+ [topicName]="topicSummaryTile.name" (click)="registerClassroomInProgressLessonEvent(topicSummaryTile.classroom, topicSummaryTile.name)">
@@ -44,7 +44,7 @@
-
+
diff --git a/core/templates/pages/learner-dashboard-page/home-tab.component.spec.ts b/core/templates/pages/learner-dashboard-page/home-tab.component.spec.ts index 3505d7fec794..df4c19f38ab2 100644 --- a/core/templates/pages/learner-dashboard-page/home-tab.component.spec.ts +++ b/core/templates/pages/learner-dashboard-page/home-tab.component.spec.ts @@ -28,6 +28,7 @@ import {EventEmitter, NO_ERRORS_SCHEMA} from '@angular/core'; import {LearnerTopicSummary} from 'domain/topic/learner-topic-summary.model'; import {WindowDimensionsService} from 'services/contextual/window-dimensions.service'; import {I18nLanguageCodeService} from 'services/i18n-language-code.service'; +import {SiteAnalyticsService} from 'services/site-analytics.service'; describe('Home tab Component', () => { let component: HomeTabComponent; @@ -36,6 +37,7 @@ describe('Home tab Component', () => { let windowDimensionsService: WindowDimensionsService; let i18nLanguageCodeService: I18nLanguageCodeService; let mockResizeEmitter: EventEmitter; + let siteAnalyticsService: SiteAnalyticsService; beforeEach(async(() => { mockResizeEmitter = new EventEmitter(); @@ -62,6 +64,7 @@ describe('Home tab Component', () => { urlInterpolationService = TestBed.inject(UrlInterpolationService); windowDimensionsService = TestBed.inject(WindowDimensionsService); i18nLanguageCodeService = TestBed.inject(I18nLanguageCodeService); + siteAnalyticsService = TestBed.inject(SiteAnalyticsService); spyOn(i18nLanguageCodeService, 'isCurrentLanguageRTL').and.returnValue( true @@ -258,4 +261,26 @@ describe('Home tab Component', () => { expect(component.isGoalLimitReached()).toBeFalse(); } ); + + it('should record analytics when lesson card in home tab clicked', () => { + spyOn( + siteAnalyticsService, + 'registerNewClassroomLessonEngagedWithEvent' + ).and.callThrough(); + component.registerNewClassroomLessonEvent('Math', 'Addition'); + expect( + siteAnalyticsService.registerNewClassroomLessonEngagedWithEvent + ).toHaveBeenCalled(); + }); + + it('should record analytics when in-progress lesson card in home tab clicked', () => { + spyOn( + siteAnalyticsService, + 'registerInProgressClassroomLessonEngagedWithEvent' + ).and.callThrough(); + component.registerClassroomInProgressLessonEvent('Math', 'Addition'); + expect( + siteAnalyticsService.registerInProgressClassroomLessonEngagedWithEvent + ).toHaveBeenCalled(); + }); }); diff --git a/core/templates/pages/learner-dashboard-page/home-tab.component.ts b/core/templates/pages/learner-dashboard-page/home-tab.component.ts index dcd7553ca83a..e16272d25f12 100644 --- a/core/templates/pages/learner-dashboard-page/home-tab.component.ts +++ b/core/templates/pages/learner-dashboard-page/home-tab.component.ts @@ -26,6 +26,7 @@ import {UrlInterpolationService} from 'domain/utilities/url-interpolation.servic import {Subscription} from 'rxjs'; import {WindowDimensionsService} from 'services/contextual/window-dimensions.service'; import {I18nLanguageCodeService} from 'services/i18n-language-code.service'; +import {SiteAnalyticsService} from 'services/site-analytics.service'; import './home-tab.component.css'; @@ -62,7 +63,8 @@ export class HomeTabComponent { constructor( private i18nLanguageCodeService: I18nLanguageCodeService, private windowDimensionService: WindowDimensionsService, - private urlInterpolationService: UrlInterpolationService + private urlInterpolationService: UrlInterpolationService, + private siteAnalyticsService: SiteAnalyticsService ) {} ngOnInit(): void { @@ -147,4 +149,24 @@ export class HomeTabComponent { LearnerDashboardPageConstants.LEARNER_DASHBOARD_SECTION_I18N_IDS.GOALS ); } + + registerClassroomInProgressLessonEvent( + classroomName: string, + topicName: string + ): void { + this.siteAnalyticsService.registerInProgressClassroomLessonEngagedWithEvent( + classroomName, + topicName + ); + } + + registerNewClassroomLessonEvent( + classroomName: string, + topicName: string + ): void { + this.siteAnalyticsService.registerNewClassroomLessonEngagedWithEvent( + classroomName, + topicName + ); + } } diff --git a/core/templates/pages/library-page/library-page.component.html b/core/templates/pages/library-page/library-page.component.html index 06cb12a2a48e..d57f69d3191a 100644 --- a/core/templates/pages/library-page/library-page.component.html +++ b/core/templates/pages/library-page/library-page.component.html @@ -6,10 +6,11 @@

{{ 'I18N_COMMUNITY_LIBRARY_PAGE_CLASSROOMS_HINT_TEXT' | translate }}

- +
@@ -30,10 +31,11 @@

{{ 'I18N_COMMUNITY_LIBRARY_PAGE_CLASSROOMS_HINT_TEXT' | translate }}

- +
diff --git a/core/templates/pages/library-page/library-page.component.spec.ts b/core/templates/pages/library-page/library-page.component.spec.ts index d494da994378..b6181f6bc26f 100644 --- a/core/templates/pages/library-page/library-page.component.spec.ts +++ b/core/templates/pages/library-page/library-page.component.spec.ts @@ -55,6 +55,7 @@ import { NgbSlideEvent, NgbSlideEventDirection, } from '@ng-bootstrap/ng-bootstrap'; +import {SiteAnalyticsService} from 'services/site-analytics.service'; class MockWindowRef { nativeWindow = { @@ -62,6 +63,7 @@ class MockWindowRef { pathname: '/community-library/top-rated', href: '', }, + gtag: jasmine.createSpy('gtag'), }; } @@ -105,6 +107,7 @@ describe('Library Page Component', () => { let searchService: SearchService; let translateService: TranslateService; let classroomBackendApiService: ClassroomBackendApiService; + let siteAnalyticsService: SiteAnalyticsService; const mockNgbCarousel: Partial = { next: jasmine.createSpy('next'), @@ -302,6 +305,7 @@ describe('Library Page Component', () => { loggerService = TestBed.inject(LoggerService); searchService = TestBed.inject(SearchService); classroomBackendApiService = TestBed.inject(ClassroomBackendApiService); + siteAnalyticsService = TestBed.inject(SiteAnalyticsService); }); afterEach(() => { @@ -900,4 +904,15 @@ describe('Library Page Component', () => { false ); }); + + it('should record analytics when classroom card is clicked', () => { + spyOn( + siteAnalyticsService, + 'registerClickClassroomCardEvent' + ).and.callThrough(); + componentInstance.registerClassroomCardClickEvent('Math'); + expect( + siteAnalyticsService.registerClickClassroomCardEvent + ).toHaveBeenCalled(); + }); }); diff --git a/core/templates/pages/library-page/library-page.component.ts b/core/templates/pages/library-page/library-page.component.ts index aeb4b8c3d685..184f99bf2bea 100755 --- a/core/templates/pages/library-page/library-page.component.ts +++ b/core/templates/pages/library-page/library-page.component.ts @@ -43,6 +43,7 @@ import { } from './services/library-page-backend-api.service'; import {NgbCarousel, NgbSlideEvent} from '@ng-bootstrap/ng-bootstrap'; import './library-page.component.css'; +import {SiteAnalyticsService} from 'services/site-analytics.service'; interface MobileLibraryGroupProperties { inCollapsedState: boolean; @@ -113,7 +114,8 @@ export class LibraryPageComponent { private windowDimensionsService: WindowDimensionsService, private classroomBackendApiService: ClassroomBackendApiService, private pageTitleService: PageTitleService, - private translateService: TranslateService + private translateService: TranslateService, + private siteAnalyticsService: SiteAnalyticsService ) {} setActiveGroup(groupIndex: number): void { @@ -507,7 +509,7 @@ export class LibraryPageComponent { onClassroomNavigationIndicatorClicked(slideEvent: NgbSlideEvent): void { // Extract numeric index from slide id (format: 'ngb-slide-{index}') - this.classroomCarouselIndex = parseInt(slideEvent.current.split('-')[2]); + this.classroomCarouselIndex = parseInt(slideEvent?.current?.split('-')[2]); } getClassroomChunkIndices(length: number): number[] { @@ -548,6 +550,13 @@ export class LibraryPageComponent { return true; } + registerClassroomCardClickEvent(classroomName: string): void { + this.siteAnalyticsService.registerClickClassroomCardEvent( + 'Classroom card in the community library page', + classroomName + ); + } + ngOnDestroy(): void { if (this.translateSubscription) { this.translateSubscription.unsubscribe(); diff --git a/core/templates/services/site-analytics.service.spec.ts b/core/templates/services/site-analytics.service.spec.ts index 86f3a2391a99..306a2588eb84 100644 --- a/core/templates/services/site-analytics.service.spec.ts +++ b/core/templates/services/site-analytics.service.spec.ts @@ -666,12 +666,6 @@ describe('Site Analytics Service', () => { ); }); - it('should register classroom header click event', () => { - sas.registerClassroomHeaderClickEvent(); - - expect(gtagSpy).toHaveBeenCalledWith('event', 'click_on_classroom', {}); - }); - it('should register community lesson completed event', () => { sas.registerCommunityLessonCompleted('exp_id'); @@ -910,5 +904,42 @@ describe('Site Analytics Service', () => { testKey ); }); + + it('should register classroom card click event', () => { + const srcElement = 'Classroom card in the navigation dropdown'; + sas.registerClickClassroomCardEvent(srcElement, 'Math'); + + expect(gtagSpy).toHaveBeenCalledWith('event', 'classroom_card_click', { + page_path: pathname, + source_element: srcElement, + classroom_name: 'Math', + }); + }); + + it('should register new classroom lesson card click event', () => { + sas.registerNewClassroomLessonEngagedWithEvent('Math', 'Addition'); + + expect(gtagSpy).toHaveBeenCalledWith( + 'event', + 'new_classroom_lesson_engaged_with', + { + classroom_name: 'Math', + topic_name: 'Addition', + } + ); + }); + + it('should register in-progress classroom lesson card click event', () => { + sas.registerInProgressClassroomLessonEngagedWithEvent('Math', 'Addition'); + + expect(gtagSpy).toHaveBeenCalledWith( + 'event', + 'classroom_lesson_in_progress_engaged_with', + { + classroom_name: 'Math', + topic_name: 'Addition', + } + ); + }); }); }); diff --git a/core/templates/services/site-analytics.service.ts b/core/templates/services/site-analytics.service.ts index e8b03c76f604..6deeb8cbb80c 100644 --- a/core/templates/services/site-analytics.service.ts +++ b/core/templates/services/site-analytics.service.ts @@ -543,10 +543,6 @@ export class SiteAnalyticsService { }); } - registerClassroomHeaderClickEvent(): void { - this._sendEventToGoogleAnalytics('click_on_classroom', {}); - } - registerClassroomPageViewed(): void { this._sendEventToGoogleAnalytics('view_classroom', {}); } @@ -641,6 +637,40 @@ export class SiteAnalyticsService { } this.localStorageService.setLastPageViewTime(lastPageViewTimeKey); } + + registerClickClassroomCardEvent( + srcElement: string, + classroomName: string + ): void { + this._sendEventToGoogleAnalytics('classroom_card_click', { + page_path: this.windowRef.nativeWindow.location.pathname, + source_element: srcElement, + classroom_name: classroomName, + }); + } + + registerInProgressClassroomLessonEngagedWithEvent( + classroomName: string, + topicName: string + ): void { + this._sendEventToGoogleAnalytics( + 'classroom_lesson_in_progress_engaged_with', + { + classroom_name: classroomName, + topic_name: topicName, + } + ); + } + + registerNewClassroomLessonEngagedWithEvent( + classroomName: string, + topicName: string + ): void { + this._sendEventToGoogleAnalytics('new_classroom_lesson_engaged_with', { + classroom_name: classroomName, + topic_name: topicName, + }); + } } angular