SlideShare a Scribd company logo
1 of 61
Tracking User Behavior
Creatively
Kiana Tennyson
AnDevCon V
May 2013
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.
What is Analytics?
™  Collection, analysis, reporting of internet data
™  Two categories – onsite and offsite
™  Two data collection methods
™  Log file analysis
™  Page tagging
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
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)
User Story
™  Web Analytics and User Tracking are meant to tell the
story of our user(s)
Common Analytics Software
SAAS
™  Google Analytics
™  Webtrends (paid)
BYOH
™  Open Web Analytics
™  Piwik
™  SnowPlow
™  But…
Why not Analytics Sites?
™  No outsourcing
™  Extra needs/historical data
™  Company policy
™  Sensitive data
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
Google Analytics
Platform Overview
source: www.Google-Analytics.com
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
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
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
Google
Analytics
Tracker
Event (Hit)
SQLLite
Database
Network
Dispatcher
Dispatch
Handler
AsyncDispatch
Task
Pipelined
Requestor
Http
Connection
Callbacks
(start)
(end)
Workflow Visualized
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
™  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
Data Collection
Basic Interaction Types
(Classic and Android)
™  Page View Tracking
™  Event Tracking
™  Ecommerce/Transaction Tracking
™  Custom Dimensions/Metrics
™  Timing, Social, Exception…
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
public class TestPage extends Activity {!
!
GoogleAnalyticsTracker tracker;!
!
@Override!
protected void onCreate(Bundle savedInstanceState) {!
super.onCreate(savedInstanceState);!
!
tracker = GoogleAnalyticsTracker.getInstance(); //singleton!
tracker.startNewSession(“UA-XXXXX-YY”, this);!
!
setContentView(R.layout.test_layout);!
!
TextView helpLink = (TextView)findViewById(R.id.helpLink);!
helpLink.setOnClickListener(new OnClickListener() {!
!
@Override!
public void onClick(View view) {!
tracker.sendView(“/helpPage”);!
Intent intent = new Intent(TestPage.this, HelpPage.class);!
startActivity(intent);!
}!
}!
}!
}!
Pageview Tracking
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
public class VideoPage extends Activity {!
!
GoogleAnalyticsTracker tracker;!
!
@Override!
protected void onCreate(Bundle savedInstanceState) {!
super.onCreate(savedInstanceState);!
!
tracker = GoogleAnalyticsTracker.getInstance(); //singleton!
tracker.startNewSession(“UA-XXXXX-YY”, this);!
!
setContentView(R.layout.test_layout);!
!
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!
}!
}!
}!
}!
Event Tracking
Ecommerce Tracking
™  Track shopping carts and in-app purchases
™  Additional classes required to track transactions:
™  Transaction
™  Item
™  Process goes:
1.  Create Transaction Object
2.  Add Items to Transaction
3.  Submit Transaction to Analytics Servers
public class PurchasePage extends Activity {!
. . . !
!
public void onPurchaseConfirmed(Purchase purchase) {!
!
Transaction transaction = !
new TransactionBuilder(purchase.getId(), !
purchase.getTotal());!
!
transaction.setStoreName(Constants.STORE_NAME);!
transaction.setShippingCost(purchase.getShippingCost());!
transaction.setTotalTax(purchase.getTotalTax());!
!
for(LineItem lineItem : purchase.getLineItems() {!
!tracker.addItem(new ItemBuilder(!
!purchase.getId(),!
lineItem.getProductId,!
lineItem.getCost(),!
lineItem.getQuantity())!
.build()); !
}!
tracker.sendTransaction(transaction);!
}!
}!
Ecommerce Tracking
Step 1
Step 2
Step 3
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
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
Reporting
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
GA Reporting
Framework Account
Property
Profile
Report
Profile
Report
Property
Profile
Report Report
Property – website, blog, app
Profile – A version of the property
(Android, iOS, Blackberry)
Query the profile tables via the
Core Reporting API using the
profile id
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
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
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
https://www.googleapis.com/analytics/v2.4/data
?ids=12345
&dimensions=ga:customVarValue5
&metrics=ga:visits
&filters=ga:daysSinceLastVisit%3E%3D5
&start-date=2013-05-01
&end-date=2013-05-30
&max-results=50
(Where customVarValue5 == salesRepId)
Select visits, customVarValue5 from 12345 where
daysSinceLastVisit <= 5 and startDate => ‘2013-05-01’ and
endDate <= ‘2013-05-30’ group by customVarValue5 limit 0, 50
Sample Query
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
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
Metrics
™  Common ones
™  visitors
™  timeOnSite
™  organicSearches
™  adClicks
™  goal(N)Completions
™  Interesting ones
™  serverConnectionTime
™  domainLookupTime
™  redirectionTime
™  exceptions
™  uniqueSocialInteractions
Dimensions
™  Common ones
™  visitorType
™  campaign
™  city/metro/region
™  searchUsed
™  language
™  Interesting ones
™  customVarName(N)
™  mobileDeviceModel
™  hostname
™  nthMonth/Week/Day
Output
™  JSON response format
™  Client Libraries available
™  Java, Python, Objective-C, Javascript
™  Just use your favorite Json Parser Library
User Story
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
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)
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
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:
User Story
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
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
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
User Story
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
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) !
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
User Story
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
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
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
User Story
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
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
User Tracking – “Why’’
™  Too subjective for User Tracking
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
Questions?

More Related Content

Viewers also liked

Unit 1 LO2 - Audience Profiling PowerPoint
Unit 1 LO2 - Audience Profiling PowerPointUnit 1 LO2 - Audience Profiling PowerPoint
Unit 1 LO2 - Audience Profiling PowerPoint
samtc98
 
Behavioral targeting
Behavioral targeting Behavioral targeting
Behavioral targeting
Hee Jin Cho
 
Online Consumer Behavior
Online Consumer BehaviorOnline Consumer Behavior
Online Consumer Behavior
Graham Garner
 
How media producers define their target audience
How media producers define their target audienceHow media producers define their target audience
How media producers define their target audience
mattwako
 
Audience Profiling Powerpoint
Audience Profiling PowerpointAudience Profiling Powerpoint
Audience Profiling Powerpoint
leannacatherina
 
customer behavior in e-commerce
customer behavior in e-commercecustomer behavior in e-commerce
customer behavior in e-commerce
Nor Rasyidah
 
Online shopping behaviour
Online shopping behaviourOnline shopping behaviour
Online shopping behaviour
Pradeep Kumar Tiwari
 
Chp 7 online customer behavior
Chp 7 online customer behaviorChp 7 online customer behavior
Chp 7 online customer behavior
cheqala5626
 

Viewers also liked (18)

Unit 1 LO2 - Audience Profiling PowerPoint
Unit 1 LO2 - Audience Profiling PowerPointUnit 1 LO2 - Audience Profiling PowerPoint
Unit 1 LO2 - Audience Profiling PowerPoint
 
Behavioral targeting
Behavioral targeting Behavioral targeting
Behavioral targeting
 
The Role of the Internet and New Media on Consumer and Firm Behavior
The Role of the Internet and New Media on Consumer and Firm BehaviorThe Role of the Internet and New Media on Consumer and Firm Behavior
The Role of the Internet and New Media on Consumer and Firm Behavior
 
Making search better by tracking & utilizing user search behavior
Making search better by tracking & utilizing user search behaviorMaking search better by tracking & utilizing user search behavior
Making search better by tracking & utilizing user search behavior
 
Basics of Behavioral Targeting
Basics of Behavioral TargetingBasics of Behavioral Targeting
Basics of Behavioral Targeting
 
Web Usage Pattern
Web Usage PatternWeb Usage Pattern
Web Usage Pattern
 
E Marketing Ch7 Consumer Behavior
E Marketing Ch7 Consumer BehaviorE Marketing Ch7 Consumer Behavior
E Marketing Ch7 Consumer Behavior
 
Chapter 6 e-marketing research
Chapter 6   e-marketing researchChapter 6   e-marketing research
Chapter 6 e-marketing research
 
Consumer Behavior
Consumer BehaviorConsumer Behavior
Consumer Behavior
 
Ec2009 ch04 consumer behavior
Ec2009 ch04 consumer behaviorEc2009 ch04 consumer behavior
Ec2009 ch04 consumer behavior
 
Online Consumer Behavior
Online Consumer BehaviorOnline Consumer Behavior
Online Consumer Behavior
 
How media producers define their target audience
How media producers define their target audienceHow media producers define their target audience
How media producers define their target audience
 
Audience Profiling Powerpoint
Audience Profiling PowerpointAudience Profiling Powerpoint
Audience Profiling Powerpoint
 
customer behavior in e-commerce
customer behavior in e-commercecustomer behavior in e-commerce
customer behavior in e-commerce
 
User Behavior Tracking with Google Analytics, Garb, and Vanity
User Behavior Tracking with Google Analytics, Garb, and VanityUser Behavior Tracking with Google Analytics, Garb, and Vanity
User Behavior Tracking with Google Analytics, Garb, and Vanity
 
Online shopping behaviour
Online shopping behaviourOnline shopping behaviour
Online shopping behaviour
 
E-commerce customer behavior analysis
E-commerce customer behavior analysisE-commerce customer behavior analysis
E-commerce customer behavior analysis
 
Chp 7 online customer behavior
Chp 7 online customer behaviorChp 7 online customer behavior
Chp 7 online customer behavior
 

Similar to AnDevCon - Tracking User Behavior Creatively

Droid con2013 tracking user behavior_tennyson_manheim
Droid con2013 tracking user behavior_tennyson_manheimDroid con2013 tracking user behavior_tennyson_manheim
Droid con2013 tracking user behavior_tennyson_manheim
Droidcon Berlin
 
Hi5 Hackathon Presentation
Hi5 Hackathon PresentationHi5 Hackathon Presentation
Hi5 Hackathon Presentation
Lou Moore
 
Integrating Google Analytics in Android apps
Integrating Google Analytics in Android appsIntegrating Google Analytics in Android apps
Integrating Google Analytics in Android apps
Franklin van Velthuizen
 

Similar to AnDevCon - Tracking User Behavior Creatively (20)

All about engagement with Universal Analytics @ Google Developer Group NYC Ma...
All about engagement with Universal Analytics @ Google Developer Group NYC Ma...All about engagement with Universal Analytics @ Google Developer Group NYC Ma...
All about engagement with Universal Analytics @ Google Developer Group NYC Ma...
 
Google Analytics intro - Best practices for WCM
Google Analytics intro - Best practices for WCMGoogle Analytics intro - Best practices for WCM
Google Analytics intro - Best practices for WCM
 
GTUG Philippines - Implementing Google Analytics - 2011-10-11
GTUG Philippines - Implementing Google Analytics - 2011-10-11GTUG Philippines - Implementing Google Analytics - 2011-10-11
GTUG Philippines - Implementing Google Analytics - 2011-10-11
 
Droid con2013 tracking user behavior_tennyson_manheim
Droid con2013 tracking user behavior_tennyson_manheimDroid con2013 tracking user behavior_tennyson_manheim
Droid con2013 tracking user behavior_tennyson_manheim
 
What is going on? Application Diagnostics on Azure - Copenhagen .NET User Group
What is going on? Application Diagnostics on Azure - Copenhagen .NET User GroupWhat is going on? Application Diagnostics on Azure - Copenhagen .NET User Group
What is going on? Application Diagnostics on Azure - Copenhagen .NET User Group
 
DevFest Kuala Lumpur - Implementing Google Analytics - 2011-09-29.ppt
DevFest Kuala Lumpur - Implementing Google Analytics - 2011-09-29.pptDevFest Kuala Lumpur - Implementing Google Analytics - 2011-09-29.ppt
DevFest Kuala Lumpur - Implementing Google Analytics - 2011-09-29.ppt
 
Hi5 Hackathon Presentation
Hi5 Hackathon PresentationHi5 Hackathon Presentation
Hi5 Hackathon Presentation
 
Introduction to Firebase [Google I/O Extended Bangkok 2016]
Introduction to Firebase [Google I/O Extended Bangkok 2016]Introduction to Firebase [Google I/O Extended Bangkok 2016]
Introduction to Firebase [Google I/O Extended Bangkok 2016]
 
Cross Device Tracking - Thomas Danniau
Cross Device Tracking - Thomas DanniauCross Device Tracking - Thomas Danniau
Cross Device Tracking - Thomas Danniau
 
Integrating Google Analytics in Android apps
Integrating Google Analytics in Android appsIntegrating Google Analytics in Android apps
Integrating Google Analytics in Android apps
 
Jack borden jb471909_segment
Jack borden jb471909_segmentJack borden jb471909_segment
Jack borden jb471909_segment
 
High Availability by Design
High Availability by DesignHigh Availability by Design
High Availability by Design
 
(MBL310) Workshop: Build iOS Apps Using AWS Mobile Services | AWS re:Invent 2014
(MBL310) Workshop: Build iOS Apps Using AWS Mobile Services | AWS re:Invent 2014(MBL310) Workshop: Build iOS Apps Using AWS Mobile Services | AWS re:Invent 2014
(MBL310) Workshop: Build iOS Apps Using AWS Mobile Services | AWS re:Invent 2014
 
Government Web Analytics
Government Web AnalyticsGovernment Web Analytics
Government Web Analytics
 
Google’s tridente
Google’s tridenteGoogle’s tridente
Google’s tridente
 
Bootstrapping an App for Launch
Bootstrapping an App for LaunchBootstrapping an App for Launch
Bootstrapping an App for Launch
 
Open Social Presentation - GSP West 2008
Open Social Presentation - GSP West 2008Open Social Presentation - GSP West 2008
Open Social Presentation - GSP West 2008
 
Life After Mobilegeddon: App Deep Linking Strategies - Pubcon October 2015
Life After Mobilegeddon: App Deep Linking Strategies - Pubcon October 2015Life After Mobilegeddon: App Deep Linking Strategies - Pubcon October 2015
Life After Mobilegeddon: App Deep Linking Strategies - Pubcon October 2015
 
Life After Mobilegeddon: App Deep Linking Strategies - Pubcon October 2015
Life After Mobilegeddon: App Deep Linking Strategies - Pubcon October 2015Life After Mobilegeddon: App Deep Linking Strategies - Pubcon October 2015
Life After Mobilegeddon: App Deep Linking Strategies - Pubcon October 2015
 
Advanced Web Development
Advanced Web DevelopmentAdvanced Web Development
Advanced Web Development
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 

AnDevCon - Tracking User Behavior Creatively

  • 1. Tracking User Behavior Creatively Kiana Tennyson AnDevCon V May 2013
  • 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)
  • 7. Common Analytics Software SAAS ™  Google Analytics ™  Webtrends (paid) BYOH ™  Open Web Analytics ™  Piwik ™  SnowPlow ™  But…
  • 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
  • 10. Google Analytics Platform Overview source: www.Google-Analytics.com
  • 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
  • 18. Basic Interaction Types (Classic and Android) ™  Page View Tracking ™  Event Tracking ™  Ecommerce/Transaction Tracking ™  Custom Dimensions/Metrics ™  Timing, Social, Exception…
  • 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
  • 20. public class TestPage extends Activity {! ! GoogleAnalyticsTracker tracker;! ! @Override! protected void onCreate(Bundle savedInstanceState) {! super.onCreate(savedInstanceState);! ! tracker = GoogleAnalyticsTracker.getInstance(); //singleton! tracker.startNewSession(“UA-XXXXX-YY”, this);! ! setContentView(R.layout.test_layout);! ! TextView helpLink = (TextView)findViewById(R.id.helpLink);! helpLink.setOnClickListener(new OnClickListener() {! ! @Override! public void onClick(View view) {! tracker.sendView(“/helpPage”);! Intent intent = new Intent(TestPage.this, HelpPage.class);! startActivity(intent);! }! }! }! }! Pageview Tracking
  • 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
  • 22. public class VideoPage extends Activity {! ! GoogleAnalyticsTracker tracker;! ! @Override! protected void onCreate(Bundle savedInstanceState) {! super.onCreate(savedInstanceState);! ! tracker = GoogleAnalyticsTracker.getInstance(); //singleton! tracker.startNewSession(“UA-XXXXX-YY”, this);! ! setContentView(R.layout.test_layout);! ! 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! }! }! }! }! Event Tracking
  • 23. Ecommerce Tracking ™  Track shopping carts and in-app purchases ™  Additional classes required to track transactions: ™  Transaction ™  Item ™  Process goes: 1.  Create Transaction Object 2.  Add Items to Transaction 3.  Submit Transaction to Analytics Servers
  • 24. public class PurchasePage extends Activity {! . . . ! ! public void onPurchaseConfirmed(Purchase purchase) {! ! Transaction transaction = ! new TransactionBuilder(purchase.getId(), ! purchase.getTotal());! ! transaction.setStoreName(Constants.STORE_NAME);! transaction.setShippingCost(purchase.getShippingCost());! transaction.setTotalTax(purchase.getTotalTax());! ! for(LineItem lineItem : purchase.getLineItems() {! !tracker.addItem(new ItemBuilder(! !purchase.getId(),! lineItem.getProductId,! lineItem.getCost(),! lineItem.getQuantity())! .build()); ! }! tracker.sendTransaction(transaction);! }! }! Ecommerce Tracking Step 1 Step 2 Step 3
  • 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
  • 29. GA Reporting Framework Account Property Profile Report Profile Report Property Profile Report Report Property – website, blog, app Profile – A version of the property (Android, iOS, Blackberry) Query the profile tables via the Core Reporting API using the profile id
  • 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
  • 33. https://www.googleapis.com/analytics/v2.4/data ?ids=12345 &dimensions=ga:customVarValue5 &metrics=ga:visits &filters=ga:daysSinceLastVisit%3E%3D5 &start-date=2013-05-01 &end-date=2013-05-30 &max-results=50 (Where customVarValue5 == salesRepId) Select visits, customVarValue5 from 12345 where daysSinceLastVisit <= 5 and startDate => ‘2013-05-01’ and endDate <= ‘2013-05-30’ group by customVarValue5 limit 0, 50 Sample Query
  • 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
  • 36. Metrics ™  Common ones ™  visitors ™  timeOnSite ™  organicSearches ™  adClicks ™  goal(N)Completions ™  Interesting ones ™  serverConnectionTime ™  domainLookupTime ™  redirectionTime ™  exceptions ™  uniqueSocialInteractions
  • 37. Dimensions ™  Common ones ™  visitorType ™  campaign ™  city/metro/region ™  searchUsed ™  language ™  Interesting ones ™  customVarName(N) ™  mobileDeviceModel ™  hostname ™  nthMonth/Week/Day
  • 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
  • 59. User Tracking – “Why’’ ™  Too subjective for User Tracking
  • 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