In this session, we will discuss how to measure and track users' actions in your app against key metrics and trends such as new vs. returning users, app revenue, user retention, and custom in-app behavior events. We will also show you how to leverage this data to bring them back to your app by sending automatic push notifications, SMS, and emails.
AWS DevDay San Francisco, June 21, 2016.
Presenter: Richard Threlkeld
4. 60 Second Introduction
We will cover the “How” today
Sessions
Custom Events
Attributes
Metrics
Demographics
Device Details
Gather Data
Retention Rates
Rules Processing
Search Indexing
Machine Learning
Process
Customized Messages
Real-Time State
Event-based Notifications
Deliver Features
6. Gather: Mobile Analytics
SDK
(Android, iOS, JavaScript, Unity, Xamarin)
REST API
Amazon
MobileAnalytics
Daily/Monthly Active Users
Sessions
Sticky Factor
In-app Revenue
Lifetime Value (LTV)
Retention
…. and more
(Pre-defined metrics with a few lines of code)
Amazon
S3
Amazon
Redshift
Amazon
DynamoDB
Amazon
EMR
Amazon Machine
Learning
Amazon
API
Gateway
Amazon
Elasticsearch
Service
Amazon
RDS
7. Assume a Role with Cognito
Create an instance of your
Mobile Analytics Application
Create->Record->Submit Events
Submitting Events: Android Example
19. Native
Interrogates app lifecycle
• Background queue filled with
Session and Custom Events
• Session events batched & sent
Backgrounded time > AWSValueSessionResumeDelay
• Custom events sent anytime
• Best practice: use onPause,
onStop, onResume
SDK Session Management
Web
Configure default session length
Force event submission anytime
Window.localStorage ensures
persistence through browser/tab
exiting
20. Enhancing JavaScript Sessions
Debate: Apples vs. Oranges?
Modern browsers offer visibilitychange() event:
https://developer.mozilla.org/en-US/docs/Web/Events/visibilitychange
extendSession()
stopSession()
21. Delivery Status
Written to CloudWatch Logs
• 2-week graph of Sent vs Delivered
• Publishers can also write to
CloudWatch w/ custom metric
Tracking Metrics
Application Events
Publish to Topics
• Lambda, HTTP/S, etc.
23. iOS
// if your app had to be launched. A particular key is set in options to
specify that a push notification was received-
application:didFinishLaunchingWithOptions:
// if you app was already running in the background
application:didReceiveRemoteNotification:
Metrics: Open on Push
Android
25. Personalization
Engagement is all about personalization
• Automatic push if they installed but never did action X
• Push to group of users (Topic) with a custom message
• “Discount today click here!”
• Push to individuals with customized messages
• "Hey John we noticed you looked at product X but didn't
purchase"
26. TODO: Lambda function reading DDB list of users that
looked at product X then send push notifications that they
might be interested in product Y
• This will be a good example showing you can push to
platform endpoints not just topics
• Will also show this with Lambda cron scheduling to
publish to SNS
27. Tying it all together: Request tracking
Amazon API
Gateway
Amazon
SQS
Amazon
SNS
Amazon
DynamoDB
AWS
Lambda
Amazon
SQS
Lambda #1
TimeStamp CognitoID Acknowledged
DelaySeconds =
15 mins
Lambda #2
SLA:TimeStamp+30min
= expTimeStamp
remaining =
expTimeStamp – Time.Now()
IF remaining >0 {
//Resubmit to SQS w/
//visbility timeout remaining
}ELSE{
//Business escalation logic
}
Poll for new
messages
Amazon
MobileAnalytics