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.
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.
#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.
0 comments:
Post a Comment