iOS 4 Compatible Mobile SDK Now Available
Friday, September 17, 2010 | 11:16 AM
Google Analytics is very pleased to announce the latest release of the Google Analytics SDK for iOS and Android, which now runs on devices using the latest version of Apple's mobile operating system, iOS 4. The new version of the SDK is 0.8 (ie. still beta) and it also includes fixes for Android.
If you are a current website administrator or Google Analytics developer and are beginning to branch out into Android or iOS development, the Google Analytics mobile SDKs can provide a familiar interface as you transition from tracking website visitors to mobile users.
#import "GANTracker.h"
// ...
- (void)applicationDidFinishLaunching:(UIApplication *)application {
[[GANTracker sharedTracker] startTrackerWithAccountID:@"UA-0000000-1"
dispatchPeriod:kGANDispatchPeriodSec
delegate:nil];
// Track a page view
if (![[GANTracker sharedTracker] trackPageview:@"/app_entry_point"
withError:&error]) {
// ...
}
}
// ...
For more sample code for both iOS and Android, please see the developer documentation. Also keep in mind that you can use Google Analytics to track usage activity for mobile websites using the server-side code snippets for PHP, JSP, ASP.NET, and Perl, also available in the documentation.
Analytics