These SDKs for iOS and Android enable you to track user activity directly in your native mobile apps -- for example, you can see what "pages" or panels of your application are the most popular or even how many clicks a particular button or control generates. As with Google Analytics for the web, this usage data can help provide insight on additions or enhancements necessary to boost user engagement or optimize your mobile ad spending. Even better, all "page view" and event tracking data is viewable in the same interface that you're already accustomed to for tracking website statistics, and integrating it into your app is as simple as adding a few lines to your iOS or Android source code. For example:
Sample code:#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.
Posted by Chrix Finne, Product Manager, Google Mobile Ads, and Beth Liebert, Google Analytics Team