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

Commit

Permalink
chore: update find courses clicked analytics (#1774)
Browse files Browse the repository at this point in the history
  • Loading branch information
saeedbashir committed Jul 18, 2023
1 parent 8d05a4a commit 0eebf53
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 7 deletions.
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

0 comments on commit 0eebf53

Please sign in to comment.