6. Let’s start!
• Download the SDK at
http://code.google.com/mobile/analytics
• Add the JAR to your build path
• Add the required permissions to your
manifest
• Sign up at http://www.google.com/analytics
• Create an account and profile
7. The tracker object
private GoogleAnalyticsTracker tracker;
...
tracker = GoogleAnalyticsTracker.getInstance();
tracker.startNewSession(“UA-...”, context);
...
tracker.stopSession();
Google says: “In onCreate and onDestroy”
but that has implications.
8. What can we track?
Activity viewed by a user Pageview
Interaction with interface elements Event
11. Dispatching
• Manual dispatch vs automatic dispatch
tracker.startNewSession(“UA-..., context);
tracker.startNewSession(“UA-...”, 10, context);
• Batches of max 30 hits in manual mode
• Try to bundle your dispatches
25. Campaign tracking
• Android Market campaigns
• Campaigns using QR codes on bill boards
• General campaign tracking
• Links in online advertisements
30. Legal stuff
• Always inform your users
• If feasible, provide an opt-out possibility
• Use setAnonymizeIp
31. Resources
• Mobile Developer Documentation (sparse!)
http://code.google.com/mobile/analytics
• Google Analytics Developer docs
http://code.google.com/apis/analytics/docs/
• Example code
http://www.yoki.org/droidconNL/droidconNL.zip
Notas do Editor
\n
\n
\n
Management API, Data Export API\n
\n
\n
UA = website profile ID\n
\n
\n
\n
\n
\n
\n
Page = Pageviews and Events\nAlways set your custom var before generating a pageview or event\nExamples: Paid user; Logged in user/Network type; Sections in news app\n
Page = Pageviews and Events\nAlways set your custom var before generating a pageview or event\nExamples: Paid user; Logged in user/Network type; Sections in news app\n
Page = Pageviews and Events\nAlways set your custom var before generating a pageview or event\nExamples: Paid user; Logged in user/Network type; Sections in news app\n
Page = Pageviews and Events\nAlways set your custom var before generating a pageview or event\nExamples: Paid user; Logged in user/Network type; Sections in news app\n
Page = Pageviews and Events\nAlways set your custom var before generating a pageview or event\nExamples: Paid user; Logged in user/Network type; Sections in news app\n
Page = Pageviews and Events\nAlways set your custom var before generating a pageview or event\nExamples: Paid user; Logged in user/Network type; Sections in news app\n
Page = Pageviews and Events\nAlways set your custom var before generating a pageview or event\nExamples: Paid user; Logged in user/Network type; Sections in news app\n
Page = Pageviews and Events\nAlways set your custom var before generating a pageview or event\nExamples: Paid user; Logged in user/Network type; Sections in news app\n
Page = Pageviews and Events\nAlways set your custom var before generating a pageview or event\nExamples: Paid user; Logged in user/Network type; Sections in news app\n
Page = Pageviews and Events\nAlways set your custom var before generating a pageview or event\nExamples: Paid user; Logged in user/Network type; Sections in news app\n
Page = Pageviews and Events\nAlways set your custom var before generating a pageview or event\nExamples: Paid user; Logged in user/Network type; Sections in news app\n
Page = Pageviews and Events\nAlways set your custom var before generating a pageview or event\nExamples: Paid user; Logged in user/Network type; Sections in news app\n
Page = Pageviews and Events\nAlways set your custom var before generating a pageview or event\nExamples: Paid user; Logged in user/Network type; Sections in news app\n
Page = Pageviews and Events\nAlways set your custom var before generating a pageview or event\nExamples: Paid user; Logged in user/Network type; Sections in news app\n
Page = Pageviews and Events\nAlways set your custom var before generating a pageview or event\nExamples: Paid user; Logged in user/Network type; Sections in news app\n
Page = Pageviews and Events\nAlways set your custom var before generating a pageview or event\nExamples: Paid user; Logged in user/Network type; Sections in news app\n
Page = Pageviews and Events\nAlways set your custom var before generating a pageview or event\nExamples: Paid user; Logged in user/Network type; Sections in news app\n
Page = Pageviews and Events\nAlways set your custom var before generating a pageview or event\nExamples: Paid user; Logged in user/Network type; Sections in news app\n
Page = Pageviews and Events\nAlways set your custom var before generating a pageview or event\nExamples: Paid user; Logged in user/Network type; Sections in news app\n
Page = Pageviews and Events\nAlways set your custom var before generating a pageview or event\nExamples: Paid user; Logged in user/Network type; Sections in news app\n
\n
\n
Downside: you need to push an update to start A/B testing\n
Transactions and items generate individual hits\n
\n
\n
\n
\n
- strange visits when switching between activities\n
Class composition\n
\n
Opt-out downside: existing data will not be removed\nsetAnonymizeIp removes the last octet of IP addresses\nEULA is supposed to protect you, instead of gaining permission\n\n