2. Disclaimer:
™ IS a Feasibility Discussion
™ NOT an Ethics Discussion
™ NOT a Security Discussion
™ Don’t go to jail, get sued or end up defamed in
Huffington Post.
3. What is Analytics?
™ Collection, analysis, reporting of internet data
™ Two categories – onsite and offsite
™ Two data collection methods
™ Log file analysis
™ Page tagging
4. What is User Tracking?
™ Logging characteristics about the the user and the
user’s actions
™ More granular study than Web Analytics
™ Sticky subject!
™ Public apps… highest priority == user permission
™ Internal apps/corporate phones… different rules apply
5. Why do this?
™ Understand and optimize app usage
™ App assessment and improvement
™ Business drivers (cost effectiveness, profit increase)
™ Market research
™ Safety (parental controls, employee usage)
6. User Story
™ Web Analytics and User Tracking are meant to tell the
story of our user(s)
8. Why not Analytics Sites?
™ No outsourcing
™ Extra needs/historical data
™ Company policy
™ Sensitive data
9. Open Web Analytics
™ Host your own database server J
™ Host your own analytics site
™ Open source; extend what you want
™ However: No Android client library… (contribute!)
™ Extras:
™ DomStream Tracking – tracks stream of mouse-oriented clicks
(adapt to smartphone user interactions)
™ CrossDomain Tracking – tracks same visitor across different web
domains
11. Google Analytics Workflow
™ Workflow (ga.js):
1. Browser requests page containing tracking code
2. _gaq array holding tracking commands created
3. GA source code is fetched and loaded
4. Commands on _gaq array executed, tracking obj built
5. Script element loaded to DOM
6. Tracking obj collects data (via gif request)
7. Gif request used for logging, data coll., post-processing
12. And on Android…
™ Same as conventional website tracking model
™ Web Property Id required
™ Four interaction types are tracked
™ EasyTracker library (v2) almost no dev effort L
™ Requires INTERNET and
ACCESS_NETWORK_STATE permissions
13. GA for Android Workflow
™ Workflow:
1. tracker.trackEvent(…) called
2. event is put in localized SQLLite database on device as a
“Hit”
3. At prescribed interval, dispatch occurs of collected data
4. tracker grabs “Hits” from local db
5. Sends them to NetworkDispatcher, which in turn posts an
AsyncDispatchTask on a thread Handler
6. Handler sends hits over an HTTP connection via
pipeLinedRequestor
7. When complete, callbacks are invoked, which sets a flag true
indicating the dispatcher is reopened for business
15. google_analytics_v2.db
Connection
™ Staging area for tracking data located on device
™ Next stop: Google Analytics servers
™ Command line access:
™ From platform-tools directory, open Android Debug
Bridge (adb)
™ adb -s emulator-5554 shell #example command
™ sqlite3 google_analytics[_v2].db
™ Begin issuing sqlite commands
16. ™ sqlite> .tables #list all tables in the db
™ Most important table – events table
™ Columns: hit_id, hit_time, hit_url, hit_string
™ Data
™ 6!
™ |1350361553317!
™ |http://www.google-analytics.com/collect!
™ |v=1&ul=en-
us&t=appview&sr=480x800&an=Kiana
+ByProxy&a=0&tid=UA-35996923-1&aid=com.kt
.kbp&cid=25c2e0bb07c4d6d&_u=.B&av=1.0&_v=
ma1b3&cd=com.kt.kbp.flickr.FlickrActivity!
google_analytics_v2.db
The Table
19. Pageview Tracking
™ Pageviews traditionally measure traffic volume to a site
™ Mobile apps don’t really contain web *pages*
™ App structure determines when a “page” is viewed
™ Multiple activity structure
™ Central activity, multiple fragments
™ Central activity, multiple layouts L
™ Any combo of the above
™ Simple line tracks a lot under the hood
21. Event Tracking
™ Event tracking logs user interaction with the app
™ Button/link clicks, viewing a video, anything
™ Anything passed into GoogleAnalyticsTracker appears
on the reporting interface (be consistent)
™ Category
™ Action
™ Label (opt)
™ Value (opt)
™ Category/Action pairs should be unique
25. Custom Dim/Metrics
™ Upgrade from Custom Variables
™ Three scopes (visitor, session, page)
™ Page-scoped vars overlaps Event Tracking functionality
™ 20 slots (can get weird… so keep a chart)
™ setCustomVar method
™ Defaults to Page scope
™ Does NOT send data like others, simply sets a variable
26. What Else to Track?
™ Track user’s touch order on the layout
™ OWA domstream tracking
™ Track user’s touch location on the screen
™ Set up clickable regions in layouts, perform event
tracking onClick()
™ Track a user’s navigation session through your app
28. External Data Integration
™ Compare brick and mortar shops with mobile traffic
vicinity
™ Compare app activity to desktop site activity
™ Correlate high/low volume usage with external user
statistics
™ Customize dashboards that include GA data
30. App Report Categories
™ Acquisitions
™ How your app is found/downloaded/installed
™ Users (who, where, when)
™ Info about people using your app and their devices
™ Engagement (what)
™ Ways people use your app
™ Outcomes (why)
™ Track targeted objectives with goals, ecommerce
31. Core Reporting API
™ Ability to export analytics data
™ Java, Obj-C, Ruby, among other client libraries
™ Data returned in JSON format
™ Paginated and compressed responses available
™ Daily limits to how much data returned
32. The Query
™ Four required parameters:
™ ids (unique table id is “ga:[profile id]”)
™ start-date
™ end-date
™ metrics
™ Fifth strongly suggested parameter:
™ access_token – to get your full quota (OAuth 2.0)
™ Without access_token, miniscule quota for testing
34. Compared to SQL
Additionally:
Can sort by Metrics *and* Dimensions J
Cannot query across profile-ids L
GA
Query
Metrics Dim.
Profile
ID Filters
SQL
QuerySelect
Col.
Group
By
From
(Table)
Where
35. Dimensions/Metrics
™ Max 7 dimensions (per query)
™ Max 10 metrics (per query)
™ At least one metric is required
™ Not all combos are valid/make sense
™ What’s the difference?
™ Metric – a measurement of user activity
™ Dimension – groups metrics across commonalities
38. Output
™ JSON response format
™ Client Libraries available
™ Java, Python, Objective-C, Javascript
™ Just use your favorite Json Parser Library
40. Who?
™ Know your user
™ By Individual – Corporate app that needs to track
representative use in the field
™ By Demographic – Publically downloaded game
catering to young males aged 9-13
™ Know what you can store about them
™ Google Analytics policy expressly forbids:
™ (S)PII storage
™ Storing correlational data in 3rd party systems
41. PII and SPII
(Sensitive) Personally Identifiable Information
™ Full Name
™ SSN
™ Driver’s License #
™ License Plate #
™ Birthplace
™ Credit card numbers
™ Digital Identity (gray area)
™ Date of Birth
™ IP Address (sometimes)
42. GA – Answering “Who”
™ All tracking calls intrinsically collect visitor
information
™ Decide what to query for
™ ga:visitors
™ ga:visitorType (new or returning)
™ ga:source (indirectly related to user)
™ ga:userActivityUserHandle
43. User Tracking – “Who”
™ Secure.ANDROID_ID (Has limitations)
™ TelephonyManager
™ getSimSerialNumber()
™ getDeviceId()
™ Build.Serial (Good for tablets)
™ Company-assigned ID
™ The following could be logged to represent a user:
45. What?
™ Know what your user is doing
™ By Individual – path tracking
™ By Demographic – event tracking, multi-channel funnels
™ Know what [else] they typically do
™ Most fundamental component of the User Story
46. GA – Answering “What”
™ Data Collection – Event Tracking
™ Reporting – Engagement Report type
™ Querying for:
™ ga:pageViews, ga:timeOnPage
™ MultiChannel Funnels
™ Reports created from sequences of interactions leading
to conversion or transaction
47. User Tracking – “What”
™ Logging app usage via Singletons or local db inserts
™ Strategy determined by UI
™ Multiple Activity Structure – activity lifecycle
drawbacks
™ Single Activity/Multi Fragment – lifecycle benefits
49. When?
™ When is your user in your app?
™ Time of day, week, month, season
™ Focus marketing efforts
™ Just before app is needed
™ To drive higher usage rates during low swings
™ Push new features/content during or before high usage
times
50. GA – Answering “When”
™ No metrics correlating time and user activity
™ Dimensions to query for actions around specified times
do exist (ga:timeOnSite, ga:visitLength,
ga:timeOnPage())
™ Answer “when are users most likely to …?”
™ Use a page level custom variable
™ tracker.setCustomVar(s, “Time ItemPurchase”,
! ! !dateTime.toString(), 3) !
51. User Tracking – “When’’
™ Log system time when user makes important action
™ Time zone issues – log in UTC
™ Log start/end of session
™ Depending on UI structure, determine “session times”
™ Submit data group when session is complete, or at end
of dispatch period
53. Where?
™ Where does your user most utilize your app?
™ What states/cities/etc is your app most popular?
™ Concentrate marketing efforts in less popular areas
™ Proximity awards
™ Field reps in region/expanding regions
™ Apps with parental control features
54. GA – Answering “Where”
™ No metrics to correlate geolocation to activity
™ Dimensions exist; collected from IP Address during
HTTP Requests
™ ga:continent down to ga:latitude/longitude, etc
55. User Tracking – “Where’’
™ Log location with android.location package
™ Locations don’t come on demand
™ Request updates from Context.Location_Service
™ Define a LocationListener ready to receive/handle updates
™ Choose best algorithm for selecting location
™ Trade-off between killing user’s battery and accuracy
™ Once location received, hold on until ready to send with
other tracking data
57. Why?
™ When users convert and complete goals, it is easy to
answer “Why”
™ When users are NOT participating in goal conversion/
completion,
™ Focus research on pageViews
™ Focus on events occurring on the higher rated
pageViews
58. GA – Answering “Why”
™ Subjective question; no concrete method to answer
“Why” a user uses your app
™ Align app goals with with user’s actions
™ Accept your app’s purpose to the user to fully realize its
potential
60. Wrap Up
™ Mobile devices are quickly becoming one of the most
commonly used personal computers
™ Understand the boundaries of user privacy
™ Protect our users; they keep us “in business” J