Reputation: 6490
I would like to Integrate Google Analytics Tracking into my IOS APP.
I have integrated Google Analytics Library and Add It To my Application.
Here is my code snippet,
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[UIApplication sharedApplication].statusBarHidden = NO;
[GAI sharedInstance].trackUncaughtExceptions = YES;
[GAI sharedInstance].dispatchInterval = 1;
[GAI sharedInstance].debug=YES;
[[GAI sharedInstance] trackerWithTrackingId:@"UA-43556575-1"];
return YES;
}
Code In my FirstViewController
- (void)viewDidLoad
{
[super viewDidLoad];
self.trackedViewName = @"Home";
....
....
}
List of Librarys which i have added, (First i have copied all this library from download folder then added to my project folder and then in Xcode i am taking reference from project folder)
Almost 5 days and still stuck with same problem :(
: Please Help ...
Thank you for reading and thanks in advance.
Upvotes: 1
Views: 647
Reputation: 7373
I think this may be one case.
Your UIViewController
class must be a subclass of the GAITrackedViewController
class,
@interface FirstViewController : GAITrackedViewController
And Must override these function.
-(void)viewDidLoad
{
[super viewDidLoad];
self.trackedName = @"Home";
// your code here
}
-(void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
// your code here
}
As viewDidLoad
and viewDidAppear:
are important methods.
And Remember the profile must be for mobile app
.
Upvotes: 1