Droid con2013 tracking user behavior_tennyson_manheim

Uploaded on


  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads


Total Views
On Slideshare
From Embeds
Number of Embeds



Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

    No notes for slide


  • 1. Kiana TennysonDroidCon BerlinApril 2013TRACKING USER BEHAVIOR CREATIVELY
  • 2. WHO IS KIANA?•  Software Engineer – Manheim•  Highest volume operator of wholesale auto auctions in the world•  Professional background… web portals, data aggregation•  2013 goal – contribute to an open source project (maybe WebRTC?)•  Occassional blogging… shecodes.blogspot.com•  Find me on twitter @kiaaaana
  • 3. DISCLAIMER:•  IS a Feasibility Discussion•  NOT an Ethics Discussion•  NOT a Security Discussion•  Don’t go to jail, get sued or end up defamed•  Ultimately, let’s take care of our users (so they will pay us)
  • 4. OVERVIEW•  Difference between Web Analytics and User Tracking•  Google Analytics•  Data Collection•  Data Transferal Strategy•  Data Querying using Core Reporting API
  • 5. •  Logging characteristics about the userand the user’s actions•  More granular study than WebAnalytics•  Sticky subject!•  Public apps… highest priority ==user permission•  Internal apps/corporate phones…different rules apply•  Collection, analysis, reporting ofinternet data•  Two categories – onsite and offsite•  Two data collection methods•  Log file analysis•  Page taggingANALTYICS VS USER TRACKINGAnalytics User Tracking
  • 6. INTERACTION TYPES(CLASSIC AND ANDROID)•  Pageview Tracking•  ”Activity” (aka page) requests•  Essentially wherever requests for a new view is made•  Event Tracking•  Layout interactions initiated by user•  Ecommerce Tracking•  Track average transactions and in-app purchases•  Custom Variables, Dimensions, Metrics
  • 7. PAGEVIEW TRACKINGpublic class TestPage extends Activity {!@Override!protected void onCreate(Bundle savedInstanceState) {!...!GoogleAnalyticsTracker tracker = GoogleAnalyticsTracker.getInstance();!tracker.startNewSession(“UA-XXXXX-YY”, this);!TextView helpLink = (TextView)findViewById(R.id.helpLink);!helpLink.setOnClickListener(new OnClickListener() {!@Override!public void onClick(View view) {!tracker.sendView(“/helpPage”);!startActivity(new Intent(TestPage.this, HelpPage.class));!}!}!}!}!
  • 8. EVENT TRACKINGpublic class VideoPage extends Activity {!@Override!protected void onCreate(Bundle savedInstanceState) {!...!GoogleAnalyticsTracker tracker = GoogleAnalyticsTracker.getInstance();!tracker.startNewSession(“UA-XXXXX-YY”, this);!TextView videoLink = (TextView)findViewById(R.id.videoLink);!videoLink.setOnClickListener(new OnClickListener() {!@Override!public void onClick(View view) {!tracker.sendEvent(“Videos”, “Play”, videoId, 0);!//initiate video playback!}!}!}!}!
  • 9. ECOMMERCE TRACKINGpublic class PurchasePage extends Activity {!. . . !public void onPurchaseConfirmed(Purchase purchase) {!!Transaction transaction = initTransaction(purchase);!!transaction.setStoreName(Constants.STORE_NAME);!transaction.setShippingCost(purchase.getShippingCost());!transaction.setTotalTax(purchase.getTotalTax());!tracker.addTransaction(transaction);!!for(LineItem lineItem : purchase.getLineItems() {!!tracker.addItem(createNewItemBuilder(purchase,lineItem).build()!}!tracker.sendTransactions();!}!}!Step 1Step 2Step 3
  • 10. CUSTOM VARIABLESpublic class PurchasePage extends Activity {!. . .!public void onSubscriptionComplete(Subscription subscription) {!boolean complete = subscriptionProcessor.process(subscription);!if (complete) {!//Track new subscription sold at session level!tracker.setCustomVar(1, “New Subscription”, salesRepId, 2);!trackTransaction(tracker, subscription);!}!listener.notify(subscription, complete);!}!!!index name value scope(default page-level)
  • 11. OTHER INTERACTION TYPES•  Social Interactions•  tracker.sendSocial(network, action, target)!•  Timings•  tracker.sendTimings(interval, category, name, label)!•  Custom Dimensions/Metrics•  tracker.setCustomDimension(index, scope)!
  • 12. USER STORY•  Web Analytics and User Tracking tell a story about our user(s)
  • 13. •  Secure.ANDROID_ID (Has limitations)•  TelephonyManager•  getSimSerialNumber()•  getDeviceId()•  Build.Serial (Good for tablets)•  Company-assigned ID•  All tracking calls collect user info•  Metrics for Core Reporting API:•  ga:visitors•  ga:visitorType•  ga:source•  ga:userActivityHandleWER (WHO)?Google Analytics User Tracking
  • 14. 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)
  • 15. •  Logging app usage via Singletons orlocal db inserts•  Define start and end points•  Strategy determined by UI•  Multiple Activity Structure –activity lifecycle drawbacks•  Single Activity/Multi Fragment –lifecycle benefits•  Data Collection – Event Tracking•  Reporting – Engagement Report type•  Querying for:•  ga:pageViews, ga:timeOnPage•  MultiChannel Funnels•  Reports created from sequencesof interactions leading toconversion or transactionWAS (WHAT)?Google Analytics User Tracking
  • 16. •  Log system time when user makesimportant action•  Time zone issues – log in UTC•  Log start/end of session•  Depending on UI structure, determine“session times”•  Submit data group when session iscomplete, or at end of dispatch period•  No metrics correlating time and useractivity•  Dimensions (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) !WANN (WHEN)?Google Analytics User Tracking
  • 17. •  Log location with android.locationpackage•  Choose best algorithm for selectinglocation•  Trade-off between killing user’sbattery and accuracy•  Once location received, hold on untilready to send with other tracking data•  No metrics to correlate geolocation toactivity•  Dimensions exist; collected from IPAddress during HTTP Requests•  ga:continent down to ga:latitude/longitude, etcWO (WHERE)?Google Analytics User Tracking
  • 18. •  Subjective question; no concrete method to answer “Why” a user uses yourapp•  Align app goals with with user’s actions•  Accept your app’s purpose to the user to fully realize its potentialWARUM (WHY)?Google Analytics AND User Tracking
  • 19. GA DATA COLLECTIONGoogleAnalyticsTrackerEvent (Hit)SQLLiteDatabaseNetworkDispatcherDispatchHandlerAsyncDispatchTaskPipelinedRequestorHttpConnectionCallbacks(start)(end)
  • 20. USER TRACKING DATA COLLECTION•  Write a Custom ContentProvider and SyncAdapter•  Requires user permission (removing your liability)•  Handles network availability, scheduling and interrupts
  • 21. 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
  • 22. SAMPLE QUERY(CORE REPORTING API)https://www.google.com/analytics/feeds/data?ids=12345&dimensions=ga:customVarValue5&metrics=ga:visits&filters=ga:daysSinceLastVisit%3E%3D5&start-date=2012-11-23&end-date=2012-12-07&max-results=50(Where customVarValue5 == salesRepId)Select visits, customVarValue5 from 12345 where daysSinceLastVisit <= 5 and startDate =>‘2012-11-23’ and endDate <= ‘2012-12-07’ group by customVarValue5 limit 0, 50
  • 23. COMPARED TO SQLGAQueryMetrics Dim.ProfileID FiltersSQLQuerySelectCol.GroupByFrom(Table)Where
  • 24. 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
  • 25. QUESTIONS?Thank you….