Skip to content
This repository has been archived by the owner on Aug 7, 2021. It is now read-only.

Commit

Permalink
move app settings analytics to appDidBecomeActive
Browse files Browse the repository at this point in the history
improves accuracy of app settings analytics as before Google Analytics
would store events to be sent during the next session but if the next
session did not occur on the same day Google Analytics would throw out
the events.
  • Loading branch information
bbodenmiller committed Mar 9, 2015
1 parent 415103a commit 37c4ce9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions OBAApplicationDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,7 @@ - (void)applicationDidBecomeActive:(UIApplication *)application {
self.tabBarController.selectedIndex = [[NSUserDefaults standardUserDefaults] integerForKey:kOBASelectedTabIndexDefaultsKey];
[GAI sharedInstance].optOut =
![[NSUserDefaults standardUserDefaults] boolForKey:kAllowTracking];
}

- (void)applicationWillResignActive:(UIApplication *)application {
if([self.modelDao.readCustomApiUrl isEqualToString:@""]) {
[OBAAnalytics reportEventWithCategory:@"app_settings" action:@"configured_region" label:[NSString stringWithFormat:@"API Region: %@",self.modelDao.region.regionName] value:nil];
}else{
Expand All @@ -250,7 +248,9 @@ - (void)applicationWillResignActive:(UIApplication *)application {
if ([[NSUserDefaults standardUserDefaults] boolForKey: @"kOBAShowExperimentalRegionsDefaultsKey"])
_showExperimentalRegions = [[NSUserDefaults standardUserDefaults] boolForKey: @"kOBAShowExperimentalRegionsDefaultsKey"];
[OBAAnalytics reportEventWithCategory:@"app_settings" action:@"general" label:[NSString stringWithFormat:@"Show Experimental Regions: %@", (_showExperimentalRegions ? @"YES" : @"NO")] value:nil];

}

- (void)applicationWillResignActive:(UIApplication *)application {
self.active = NO;
}

Expand Down

0 comments on commit 37c4ce9

Please sign in to comment.