Download the Analytics SDK for iOS (2.0 Beta 3)
Create a Google Analytics account for MobileApp
Sign in Google Analytics --> Sign up --> What would you like to track? --> Choose App
Step 1: Xcode --> Create New Project
Step 2: Add headers and libraries to your project
Download the Google Analytics for iOS SDK and add these files from the SDK package to your app:
GAI.h
GAITracker.h
GAITrackedViewController.h
GAITransaction.h
GAITransactionItem.h
libGoogleAnalytics.a
Add the FrameWorks (or) Add the following to your application target's linked libraries:
CoreData.framework
SystemConfiguration.framework
Step 3: If you want to Track this page add the codings into ViewDidLoad (or) ViewWillAppear
id<GAITracker> tracker = [[GAI sharedInstance] trackerWithTrackingId:@"UA-XXXX-XX"];
[tracker trackView:@"Sample_Tracking_Page"];
Event Analytics:
id<GAITracker> tracker = [[GAI sharedInstance] trackerWithTrackingId:@"UA-XXXX-XX"];
[tracker trackEventWithCategory:@"ButtonType"
withAction:@"Sample_Action"
withLabel:@"Action_Label"
withValue:[NSNumber numberWithInt:1]];
No comments:
Post a Comment