diff --git a/Riot/ViewController/GroupDetailsViewController.m b/Riot/ViewController/GroupDetailsViewController.m index 70972d3a1..cad49c910 100644 --- a/Riot/ViewController/GroupDetailsViewController.m +++ b/Riot/ViewController/GroupDetailsViewController.m @@ -121,13 +121,8 @@ { [super viewWillAppear:animated]; - // Screen tracking (via Google Analytics) - id tracker = [[GAI sharedInstance] defaultTracker]; - if (tracker) - { - [tracker set:kGAIScreenName value:@"GroupDetails"]; - [tracker send:[[GAIDictionaryBuilder createScreenView] build]]; - } + // Screen tracking + [[AppDelegate theDelegate] trackScreen:@"GroupDetails"]; } - (void)viewWillDisappear:(BOOL)animated diff --git a/Riot/ViewController/GroupHomeViewController.m b/Riot/ViewController/GroupHomeViewController.m index e15461604..758d06951 100644 --- a/Riot/ViewController/GroupHomeViewController.m +++ b/Riot/ViewController/GroupHomeViewController.m @@ -144,13 +144,8 @@ { [super viewWillAppear:animated]; - // Screen tracking (via Google Analytics) - id tracker = [[GAI sharedInstance] defaultTracker]; - if (tracker) - { - [tracker set:kGAIScreenName value:@"GroupHome"]; - [tracker send:[[GAIDictionaryBuilder createScreenView] build]]; - } + // Screen tracking + [[AppDelegate theDelegate] trackScreen:@"GroupDetailsHome"]; if (_group) { diff --git a/Riot/ViewController/GroupParticipantsViewController.m b/Riot/ViewController/GroupParticipantsViewController.m index 70ac4ab1c..0c43ea584 100644 --- a/Riot/ViewController/GroupParticipantsViewController.m +++ b/Riot/ViewController/GroupParticipantsViewController.m @@ -206,13 +206,8 @@ { [super viewWillAppear:animated]; - // Screen tracking (via Google Analytics) - id tracker = [[GAI sharedInstance] defaultTracker]; - if (tracker) - { - [tracker set:kGAIScreenName value:@"GroupParticipants"]; - [tracker send:[[GAIDictionaryBuilder createScreenView] build]]; - } + // Screen tracking + [[AppDelegate theDelegate] trackScreen:@"GroupDetailsPeople"]; if (contactsPickerViewController) { diff --git a/Riot/ViewController/GroupsViewController.h b/Riot/ViewController/GroupsViewController.h index e71825089..46e71adb5 100644 --- a/Riot/ViewController/GroupsViewController.h +++ b/Riot/ViewController/GroupsViewController.h @@ -49,9 +49,4 @@ */ @property (nonatomic) BOOL enableSearchBar; -/** - The Google Analytics Instance screen name (Default is "Groups"). - */ -@property (nonatomic) NSString *screenName; - @end diff --git a/Riot/ViewController/GroupsViewController.m b/Riot/ViewController/GroupsViewController.m index 66bb67142..1fccd5076 100644 --- a/Riot/ViewController/GroupsViewController.m +++ b/Riot/ViewController/GroupsViewController.m @@ -54,8 +54,6 @@ self.enableBarTintColorStatusChange = NO; self.rageShakeManager = [RageShakeManager sharedManager]; - self.screenName = @"Groups"; - // Enable the search bar in the recents table, and remove the search option from the navigation bar. _enableSearchBar = YES; self.enableBarButtonSearch = NO; @@ -180,13 +178,8 @@ { [super viewWillAppear:animated]; - // Screen tracking (via Google Analytics) - id tracker = [[GAI sharedInstance] defaultTracker]; - if (tracker) - { - [tracker set:kGAIScreenName value:_screenName]; - [tracker send:[[GAIDictionaryBuilder createScreenView] build]]; - } + // Screen tracking + [[AppDelegate theDelegate] trackScreen:@"Groups"]; // Deselect the current selected row, it will be restored on viewDidAppear (if any) NSIndexPath *indexPath = [self.groupsTableView indexPathForSelectedRow];