Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

chore: update find courses clicked analytics #1774

Merged
merged 1 commit into from
Jul 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Source/CoursesContainerViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ class CoursesContainerViewController: UICollectionViewController {
let footerView = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: EnrolledCoursesFooterView.identifier, for: indexPath) as! EnrolledCoursesFooterView
footerView.findCoursesAction = {[weak self] in
self?.environment.router?.showCourseCatalog(fromController: self, bottomBar: nil)
self?.environment.analytics.trackUserFindsCourses(self?.courses.count ?? 0)
}
return footerView
}
Expand Down
3 changes: 0 additions & 3 deletions Source/EnrolledTabBarViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,5 @@ class EnrolledTabBarViewController: UITabBarController, UITabBarControllerDelega
extension EnrolledTabBarViewController {
func tabBarController(_ tabBarController: UITabBarController, didSelect viewController: UIViewController){
navigationItem.title = viewController.navigationItem.title
if TabBarOptions.options[tabBarController.selectedIndex] == .CourseCatalog {
environment.analytics.trackUserFindsCourses()
}
}
}
2 changes: 1 addition & 1 deletion Source/OEXAnalytics.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ NS_ASSUME_NONNULL_BEGIN

- (void)trackUserDoesNotHaveAccount;

- (void)trackUserFindsCourses;
- (void)trackUserFindsCourses:(NSInteger) enrolledCounses;

//Discussion search screen event
- (void) trackDiscussionSearchScreenWithName:(NSString *) screenName courseId:(NSString *) courseID value:(nullable NSString *) value searchQuery:(NSString *) query;
Expand Down
4 changes: 2 additions & 2 deletions Source/OEXAnalytics.m
Original file line number Diff line number Diff line change
Expand Up @@ -482,13 +482,13 @@ - (void)trackUserDoesNotHaveAccount {
[self trackEvent:event forComponent:nil withInfo:@{}];
}

- (void)trackUserFindsCourses {
- (void)trackUserFindsCourses:(NSInteger) enrolledCounses {
OEXAnalyticsEvent* event = [[OEXAnalyticsEvent alloc] init];
event.name = value_find_courses;
event.displayName = @"Find Courses Clicked";
event.category = OEXAnalyticsCategoryUserEngagement;
event.label = @"course-discovery";
[self trackEvent:event forComponent:nil withInfo:@{}];
[self trackEvent:event forComponent:nil withInfo:@{@"enrolled_courses_count": [NSNumber numberWithInteger:enrolledCounses]}];
}

#pragma mark- Discussion
Expand Down
1 change: 0 additions & 1 deletion Source/OEXRouter+Swift.swift
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,6 @@ extension OEXRouter {
} else {
showControllerFromStartupScreen(controller: controller)
}
self.environment.analytics.trackUserFindsCourses()
}

func discoveryViewController(bottomBar: UIView? = nil, searchQuery: String? = nil) -> UIViewController? {
Expand Down