SlideShare a Scribd company logo
1 of 39
Download to read offline
1
Event
Sessionization
Arielle, Sales Engineer, Looker
2
Sales Engineer, Looker
Arielle Strong
Agenda
•  What is sessionization?
•  Why is it important?
•  How do I implement it?
•  Now what?
•  Questions
3
4
What is an Event?
Any type of user interaction on a website or
product
signed up
logged in
viewed product
add to cart
purchase
logged in
viewed history
viewed product
clicked help
logged in
viewed product
5
What is Sessionization?
Grouping events from the same user based
on a period of activity
signed up
logged in
viewed product
add to cart
purchase
logged in
viewed history
viewed product
clicked help
logged in
viewed product
6
Why Should I Sessionize my Data?
To observe user behavior on your website, game, mobile app, etc
•  Understand and increase conversion rates and retention
•  Lead marketing campaigns
•  Detect fraud
•  Improve product
7
What Is It Going To Tell Me?
8
What Is It Going To Tell Me?
•  Which events cause bounces?
•  Which events end a session or trigger a user to leave our site or product?
•  What features and areas in the application are used and where in the
workflow?
•  How long do users use the application?
•  Which sessions encourage or discourage retention?
•  Where do users spend most of their time?
9
I want that! How?
10
I want that! How?
•  Looker Blocks!
11
I want that! How?
•  Looker Blocks!
•  But first...
12
Let’s Break it Down
•  Collect event data (timestamp, user ID, event ID)
•  Define sessions
•  Map events back to a session
•  Add session facts
13
How Do We Define a Session?
14
How Do We Define a Session?
User
A
A
A
A
A
B
B
•  User
•  Unknown visitor
•  Known visitor (logged in)
15
How Do We Define a Session?
User Event
A log in
A view category
A view product
A view product
A go to cart
B sign up
B log in
•  User
•  Unknown visitor
•  Known visitor (logged in)
•  Event
•  View a page
•  Click a button
•  Play a video
16
How Do We Define a Session?
User Event Time
A log in 3:04
A view category 3:05
A view product 3:07
A view product 5:44
A go to cart 5:46
B sign up 5:48
B log in 6:03
•  User
•  Unknown visitor
•  Known visitor (logged in)
•  Event
•  View a page
•  Click a button
•  Play a video
•  Timestamp
•  When event occurred
17
How Do We Define a Session?
User Event Time
A log in 3:04
A view category 3:05
A view product 3:07
A view product 5:44
A go to cart 5:46
B sign up 5:48
B log in 6:03
Session 1
Session 2
Session 3
•  User
•  Unknown visitor
•  Known visitor (logged in)
•  Event
•  View a page
•  Click a button
•  Play a video
•  Timestamp
•  When event occurred
•  Session
•  30 minute timeout
window
•  5 minute timeout window
•  Event trigger
18
Defining a Session
•  Identify the time difference between each event
User Time Idle Time (min)
1 3:04 ⌀
1 3:05 1
1 3:07 2
1 4:07 60
19
Defining a Session
•  Identify the time difference between each event
datediff( minute, lag(events.created_at) OVER ( partition BY events.user_id
ORDER BY events.created_at ), events.created_at ) AS idle_time
User Time Idle Time (min)
1 3:04 ⌀
1 3:05 1
1 3:07 2
1 4:07 60
20
Defining a Session
•  Assign a new session ID to each event that has idle time > 30 minutes
•  That event timestamp becomes the session start time
Session Start Idle Time User ID Session ID Next Session Start
2017-08-21 3:04 ⌀ 1 1 2017-08-21 4:07
2017-08-21 4:07 60 1 2 2017-08-21 6:37
2017-08-21 6:37 150 1 3 ⌀
21
Defining a Session
Session Start Idle Time User ID Session ID Next Session Start
2017-08-21 3:04 ⌀ 1 1 2017-08-21 4:07
2017-08-21 4:07 60 1 2 2017-08-21 6:37
2017-08-21 6:37 150 1 3 ⌀
•  Assign a new session ID to each event that has idle time > 30 minutes
•  That event timestamp becomes the session start time
, ROW_NUMBER () OVER (ORDER BY find_idle_time.created_at) AS unique_session_id
FROM find_idle_time
WHERE (find_idle_time.idle_time > 30 OR find_idle_time.idle_time IS NULL)
22
What time of day do sessions occur?
23
Mapping Events to Sessions
•  Knowing the event timestamp, session start time, and next session start time, we can map an event to
a session
User ID Event ID Event Time Session Start Next Session Session ID
1 25 2017-08-21 3:04 2017-08-21 3:04 2017-08-21 5:02 1
1 32 2017-08-21 3:20 2017-08-21 3:04 2017-08-21 5:02 1
1 45 2017-08-21 5:10 2017-08-21 5:02 2017-08-22 9:35 2
24
Mapping Events to Sessions
•  Knowing the event timestamp, session start time, and next session start time, we can map an event to
a session
FROM events
INNER JOIN sessions
ON events.user_id = sessions.user_id
AND events.created_at >= sessions.session_start
AND events.created_at < sessions.next_session_start
User ID Event ID Event Time Session Start Next Session Session ID
1 25 2017-08-21 3:04 2017-08-21 3:04 2017-08-21 5:02 1
1 32 2017-08-21 3:20 2017-08-21 3:04 2017-08-21 5:02 1
1 45 2017-08-21 5:10 2017-08-21 5:02 2017-08-22 9:35 2
25
Mapping Events to Sessions
User ID Event ID Event Time Session ID Event Sequence
1 25 2017-08-21 3:04 1 1
1 32 2017-08-21 3:20 1 2
1 45 2017-08-21 5:10 2 1
•  Based on the event timestamp, we can sequence the events
26
Mapping Events to Sessions
User ID Event ID Event Time Session ID Event Sequence
1 25 2017-08-21 3:04 1 1
1 32 2017-08-21 3:20 1 2
1 45 2017-08-21 5:10 2 1
•  Based on the event timestamp, we can sequence the events
, ROW_NUMBER() OVER (PARTITION BY sessions.unique_session_id ORDER BY
events.created_at) AS event_sequence_within_session
27
What’s the most common 2nd event?
28
Who are these people?!
29
Session Facts
Session ID Timestamp User ID Event ID Session Start Session End
1 2017-08-21 3:04 1 25 2017-08-21 3:04 2017-08-21 3:20
1 2017-08-21 3:20 1 32 2017-08-21 3:04 2017-08-21 3:20
2 2017-08-21 5:10 1 45 2017-08-21 5:10 2017-08-21 6:30
•  Now we can add additional detail, like the session end time
•  Which can be used to calculate session duration
30
Session Facts
Session ID Timestamp User ID Event ID Session Start Session End
1 2017-08-21 3:04 1 25 2017-08-21 3:04 2017-08-21 3:20
1 2017-08-21 3:20 1 32 2017-08-21 3:04 2017-08-21 3:20
2 2017-08-21 5:10 1 45 2017-08-21 5:10 2017-08-21 6:30
•  Now we can add additional detail, like the session end time
•  Which can be used to calculate session duration
, FIRST_VALUE (created_at) OVER (PARTITION BY unique_session_id ORDER BY created_at
ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS session_start
, LAST_VALUE (created_at) OVER (PARTITION BY unique_session_id ORDER BY created_at ROWS
BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS session_end
31
How long do visitors spend on our
website?
32
Putting It All Together
Session ID User ID Session Start Session End Session Seq Events in Session
1 1 2017-08-21 3:04 2017-08-21 3:20 1 2
1 1 2017-08-21 3:04 2017-08-21 3:20 1 2
2 1 2017-08-21 5:10 2017-08-21 6:30 2 1
•  Add in the number of events in each session
33
Putting It All Together
Session ID User ID Session Start Session End Session Seq Events in Session
1 1 2017-08-21 3:04 2017-08-21 3:20 1 2
1 1 2017-08-21 3:04 2017-08-21 3:20 1 2
2 1 2017-08-21 5:10 2017-08-21 6:30 2 1
•  Add in the number of events in each session
, ROW_NUMBER () OVER (PARTITION BY session_facts.user_id ORDER BY MIN(session_start))
AS session_sequence_for_user
, count(1) AS events_in_session
FROM session_facts
INNER JOIN events_sessionized
34
Which pages cause bounces?
35
What percentage of my user base is
returning?
What’s Next?
36
37
Funnel Explorer
38
Try it yourself!
Event Sessionization Sessionization Funnel
Join 2017_Deep Dive_Sessionization

More Related Content

Similar to Join 2017_Deep Dive_Sessionization

SIGIR2014 - Impact of Response Latency on User Behavior in Web Search
SIGIR2014 - Impact of Response Latency on User Behavior in Web SearchSIGIR2014 - Impact of Response Latency on User Behavior in Web Search
SIGIR2014 - Impact of Response Latency on User Behavior in Web Search
Telefonica Research
 

Similar to Join 2017_Deep Dive_Sessionization (20)

Product Deck
Product DeckProduct Deck
Product Deck
 
Best Practices: What to Track with Your Analytics
Best Practices: What to Track with Your AnalyticsBest Practices: What to Track with Your Analytics
Best Practices: What to Track with Your Analytics
 
Jake Rexus - KPI's for Self-serve Content: Turning Marketing Metrics Upside Down
Jake Rexus - KPI's for Self-serve Content: Turning Marketing Metrics Upside DownJake Rexus - KPI's for Self-serve Content: Turning Marketing Metrics Upside Down
Jake Rexus - KPI's for Self-serve Content: Turning Marketing Metrics Upside Down
 
Observe It Presentation
Observe It PresentationObserve It Presentation
Observe It Presentation
 
Logs & Visualizations at Twitter
Logs & Visualizations at TwitterLogs & Visualizations at Twitter
Logs & Visualizations at Twitter
 
Using Visualizations to Monitor Changes and Harvest Insights from a Global-sc...
Using Visualizations to Monitor Changes and Harvest Insights from a Global-sc...Using Visualizations to Monitor Changes and Harvest Insights from a Global-sc...
Using Visualizations to Monitor Changes and Harvest Insights from a Global-sc...
 
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...
 
O365Engage17 - One drive for business deploy, manage, migrate
O365Engage17 - One drive for business deploy, manage, migrateO365Engage17 - One drive for business deploy, manage, migrate
O365Engage17 - One drive for business deploy, manage, migrate
 
SBDC Events & registration
SBDC Events & registrationSBDC Events & registration
SBDC Events & registration
 
IoD Sales and Marketing Forum 8oct13
IoD Sales and Marketing Forum 8oct13IoD Sales and Marketing Forum 8oct13
IoD Sales and Marketing Forum 8oct13
 
Event Management Tips and Time Savers in The Raiser’s Edge
Event Management Tips and Time Savers in The Raiser’s EdgeEvent Management Tips and Time Savers in The Raiser’s Edge
Event Management Tips and Time Savers in The Raiser’s Edge
 
Digital Velocity London 2017: Understanding AudienceStream Timeline and Funne...
Digital Velocity London 2017: Understanding AudienceStream Timeline and Funne...Digital Velocity London 2017: Understanding AudienceStream Timeline and Funne...
Digital Velocity London 2017: Understanding AudienceStream Timeline and Funne...
 
Sps toronto introduction to azure functions microsoft flow
Sps toronto introduction to azure functions microsoft flowSps toronto introduction to azure functions microsoft flow
Sps toronto introduction to azure functions microsoft flow
 
Mihir Case Study one.pdf
Mihir Case Study one.pdfMihir Case Study one.pdf
Mihir Case Study one.pdf
 
Live Automatic Captioning Workshop
Live Automatic Captioning WorkshopLive Automatic Captioning Workshop
Live Automatic Captioning Workshop
 
No More Sign-In Sheets! How VSCPA Automated Their Group Live CPE Process
No More Sign-In Sheets! How VSCPA Automated Their Group Live CPE ProcessNo More Sign-In Sheets! How VSCPA Automated Their Group Live CPE Process
No More Sign-In Sheets! How VSCPA Automated Their Group Live CPE Process
 
revit Information Master Revit with PNY TrainingMaster Revit with PNY Trainin...
revit Information Master Revit with PNY TrainingMaster Revit with PNY Trainin...revit Information Master Revit with PNY TrainingMaster Revit with PNY Trainin...
revit Information Master Revit with PNY TrainingMaster Revit with PNY Trainin...
 
Kata Pengantar Proposal Pdf. Online assignment writing service.
Kata Pengantar Proposal Pdf. Online assignment writing service.Kata Pengantar Proposal Pdf. Online assignment writing service.
Kata Pengantar Proposal Pdf. Online assignment writing service.
 
SIGIR2014 - Impact of Response Latency on User Behavior in Web Search
SIGIR2014 - Impact of Response Latency on User Behavior in Web SearchSIGIR2014 - Impact of Response Latency on User Behavior in Web Search
SIGIR2014 - Impact of Response Latency on User Behavior in Web Search
 
Google Analytics: The Next Chapter
Google Analytics:  The Next ChapterGoogle Analytics:  The Next Chapter
Google Analytics: The Next Chapter
 

More from Looker

More from Looker (20)

Join 2017_Deep Dive_To Use or Not Use PDT's
Join 2017_Deep Dive_To Use or Not Use PDT'sJoin 2017_Deep Dive_To Use or Not Use PDT's
Join 2017_Deep Dive_To Use or Not Use PDT's
 
Join 2017_Deep Dive_Table Calculations 201
Join 2017_Deep Dive_Table Calculations 201Join 2017_Deep Dive_Table Calculations 201
Join 2017_Deep Dive_Table Calculations 201
 
Join 2017_Deep Dive_Table Calculations 101
Join 2017_Deep Dive_Table Calculations 101Join 2017_Deep Dive_Table Calculations 101
Join 2017_Deep Dive_Table Calculations 101
 
Join 2017_Deep Dive_Smart Caching
Join 2017_Deep Dive_Smart CachingJoin 2017_Deep Dive_Smart Caching
Join 2017_Deep Dive_Smart Caching
 
Join 2017_Deep Dive_Redshift Optimization
Join 2017_Deep Dive_Redshift OptimizationJoin 2017_Deep Dive_Redshift Optimization
Join 2017_Deep Dive_Redshift Optimization
 
Join 2017_Deep Dive_Integrating Looker with R and Python
Join 2017_Deep Dive_Integrating Looker with R and PythonJoin 2017_Deep Dive_Integrating Looker with R and Python
Join 2017_Deep Dive_Integrating Looker with R and Python
 
Join 2017_Deep Dive_Customer Retention
Join 2017_Deep Dive_Customer Retention Join 2017_Deep Dive_Customer Retention
Join 2017_Deep Dive_Customer Retention
 
Join 2017_Deep Dive_Workflows with Zapier
Join 2017_Deep Dive_Workflows with ZapierJoin 2017_Deep Dive_Workflows with Zapier
Join 2017_Deep Dive_Workflows with Zapier
 
Join2017_Deep Dive_AWS Operations
Join2017_Deep Dive_AWS OperationsJoin2017_Deep Dive_AWS Operations
Join2017_Deep Dive_AWS Operations
 
Join 2017 - Deep Dive - Action Hub
Join 2017 - Deep Dive - Action HubJoin 2017 - Deep Dive - Action Hub
Join 2017 - Deep Dive - Action Hub
 
Winning the 3rd Wave of BI
Winning the 3rd Wave of BIWinning the 3rd Wave of BI
Winning the 3rd Wave of BI
 
Power to the People: A Stack to Empower Every User to Make Data-Driven Decisions
Power to the People: A Stack to Empower Every User to Make Data-Driven DecisionsPower to the People: A Stack to Empower Every User to Make Data-Driven Decisions
Power to the People: A Stack to Empower Every User to Make Data-Driven Decisions
 
Wisdom of Crowds Webinar Deck
Wisdom of Crowds Webinar DeckWisdom of Crowds Webinar Deck
Wisdom of Crowds Webinar Deck
 
How the economist with cloud BI and Looker have improved data-driven decision...
How the economist with cloud BI and Looker have improved data-driven decision...How the economist with cloud BI and Looker have improved data-driven decision...
How the economist with cloud BI and Looker have improved data-driven decision...
 
Frank Bien Opening Keynote - Join 2016
Frank Bien Opening Keynote - Join 2016Frank Bien Opening Keynote - Join 2016
Frank Bien Opening Keynote - Join 2016
 
Frank Bien Opening Keynote - Join 2016
Frank Bien Opening Keynote - Join 2016Frank Bien Opening Keynote - Join 2016
Frank Bien Opening Keynote - Join 2016
 
Meet Looker 4
Meet Looker 4Meet Looker 4
Meet Looker 4
 
Winning with Data
Winning with Data Winning with Data
Winning with Data
 
Data Stack Considerations: Build vs. Buy at Tout
Data Stack Considerations: Build vs. Buy at ToutData Stack Considerations: Build vs. Buy at Tout
Data Stack Considerations: Build vs. Buy at Tout
 
Embedding Data & Analytics With Looker
Embedding Data & Analytics With LookerEmbedding Data & Analytics With Looker
Embedding Data & Analytics With Looker
 

Recently uploaded

Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
masabamasaba
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 

Recently uploaded (20)

Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT  - Elevating Productivity in Today's Agile EnvironmentHarnessing ChatGPT  - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 

Join 2017_Deep Dive_Sessionization

  • 3. Agenda •  What is sessionization? •  Why is it important? •  How do I implement it? •  Now what? •  Questions 3
  • 4. 4 What is an Event? Any type of user interaction on a website or product signed up logged in viewed product add to cart purchase logged in viewed history viewed product clicked help logged in viewed product
  • 5. 5 What is Sessionization? Grouping events from the same user based on a period of activity signed up logged in viewed product add to cart purchase logged in viewed history viewed product clicked help logged in viewed product
  • 6. 6 Why Should I Sessionize my Data? To observe user behavior on your website, game, mobile app, etc •  Understand and increase conversion rates and retention •  Lead marketing campaigns •  Detect fraud •  Improve product
  • 7. 7 What Is It Going To Tell Me?
  • 8. 8 What Is It Going To Tell Me? •  Which events cause bounces? •  Which events end a session or trigger a user to leave our site or product? •  What features and areas in the application are used and where in the workflow? •  How long do users use the application? •  Which sessions encourage or discourage retention? •  Where do users spend most of their time?
  • 10. 10 I want that! How? •  Looker Blocks!
  • 11. 11 I want that! How? •  Looker Blocks! •  But first...
  • 12. 12 Let’s Break it Down •  Collect event data (timestamp, user ID, event ID) •  Define sessions •  Map events back to a session •  Add session facts
  • 13. 13 How Do We Define a Session?
  • 14. 14 How Do We Define a Session? User A A A A A B B •  User •  Unknown visitor •  Known visitor (logged in)
  • 15. 15 How Do We Define a Session? User Event A log in A view category A view product A view product A go to cart B sign up B log in •  User •  Unknown visitor •  Known visitor (logged in) •  Event •  View a page •  Click a button •  Play a video
  • 16. 16 How Do We Define a Session? User Event Time A log in 3:04 A view category 3:05 A view product 3:07 A view product 5:44 A go to cart 5:46 B sign up 5:48 B log in 6:03 •  User •  Unknown visitor •  Known visitor (logged in) •  Event •  View a page •  Click a button •  Play a video •  Timestamp •  When event occurred
  • 17. 17 How Do We Define a Session? User Event Time A log in 3:04 A view category 3:05 A view product 3:07 A view product 5:44 A go to cart 5:46 B sign up 5:48 B log in 6:03 Session 1 Session 2 Session 3 •  User •  Unknown visitor •  Known visitor (logged in) •  Event •  View a page •  Click a button •  Play a video •  Timestamp •  When event occurred •  Session •  30 minute timeout window •  5 minute timeout window •  Event trigger
  • 18. 18 Defining a Session •  Identify the time difference between each event User Time Idle Time (min) 1 3:04 ⌀ 1 3:05 1 1 3:07 2 1 4:07 60
  • 19. 19 Defining a Session •  Identify the time difference between each event datediff( minute, lag(events.created_at) OVER ( partition BY events.user_id ORDER BY events.created_at ), events.created_at ) AS idle_time User Time Idle Time (min) 1 3:04 ⌀ 1 3:05 1 1 3:07 2 1 4:07 60
  • 20. 20 Defining a Session •  Assign a new session ID to each event that has idle time > 30 minutes •  That event timestamp becomes the session start time Session Start Idle Time User ID Session ID Next Session Start 2017-08-21 3:04 ⌀ 1 1 2017-08-21 4:07 2017-08-21 4:07 60 1 2 2017-08-21 6:37 2017-08-21 6:37 150 1 3 ⌀
  • 21. 21 Defining a Session Session Start Idle Time User ID Session ID Next Session Start 2017-08-21 3:04 ⌀ 1 1 2017-08-21 4:07 2017-08-21 4:07 60 1 2 2017-08-21 6:37 2017-08-21 6:37 150 1 3 ⌀ •  Assign a new session ID to each event that has idle time > 30 minutes •  That event timestamp becomes the session start time , ROW_NUMBER () OVER (ORDER BY find_idle_time.created_at) AS unique_session_id FROM find_idle_time WHERE (find_idle_time.idle_time > 30 OR find_idle_time.idle_time IS NULL)
  • 22. 22 What time of day do sessions occur?
  • 23. 23 Mapping Events to Sessions •  Knowing the event timestamp, session start time, and next session start time, we can map an event to a session User ID Event ID Event Time Session Start Next Session Session ID 1 25 2017-08-21 3:04 2017-08-21 3:04 2017-08-21 5:02 1 1 32 2017-08-21 3:20 2017-08-21 3:04 2017-08-21 5:02 1 1 45 2017-08-21 5:10 2017-08-21 5:02 2017-08-22 9:35 2
  • 24. 24 Mapping Events to Sessions •  Knowing the event timestamp, session start time, and next session start time, we can map an event to a session FROM events INNER JOIN sessions ON events.user_id = sessions.user_id AND events.created_at >= sessions.session_start AND events.created_at < sessions.next_session_start User ID Event ID Event Time Session Start Next Session Session ID 1 25 2017-08-21 3:04 2017-08-21 3:04 2017-08-21 5:02 1 1 32 2017-08-21 3:20 2017-08-21 3:04 2017-08-21 5:02 1 1 45 2017-08-21 5:10 2017-08-21 5:02 2017-08-22 9:35 2
  • 25. 25 Mapping Events to Sessions User ID Event ID Event Time Session ID Event Sequence 1 25 2017-08-21 3:04 1 1 1 32 2017-08-21 3:20 1 2 1 45 2017-08-21 5:10 2 1 •  Based on the event timestamp, we can sequence the events
  • 26. 26 Mapping Events to Sessions User ID Event ID Event Time Session ID Event Sequence 1 25 2017-08-21 3:04 1 1 1 32 2017-08-21 3:20 1 2 1 45 2017-08-21 5:10 2 1 •  Based on the event timestamp, we can sequence the events , ROW_NUMBER() OVER (PARTITION BY sessions.unique_session_id ORDER BY events.created_at) AS event_sequence_within_session
  • 27. 27 What’s the most common 2nd event?
  • 28. 28 Who are these people?!
  • 29. 29 Session Facts Session ID Timestamp User ID Event ID Session Start Session End 1 2017-08-21 3:04 1 25 2017-08-21 3:04 2017-08-21 3:20 1 2017-08-21 3:20 1 32 2017-08-21 3:04 2017-08-21 3:20 2 2017-08-21 5:10 1 45 2017-08-21 5:10 2017-08-21 6:30 •  Now we can add additional detail, like the session end time •  Which can be used to calculate session duration
  • 30. 30 Session Facts Session ID Timestamp User ID Event ID Session Start Session End 1 2017-08-21 3:04 1 25 2017-08-21 3:04 2017-08-21 3:20 1 2017-08-21 3:20 1 32 2017-08-21 3:04 2017-08-21 3:20 2 2017-08-21 5:10 1 45 2017-08-21 5:10 2017-08-21 6:30 •  Now we can add additional detail, like the session end time •  Which can be used to calculate session duration , FIRST_VALUE (created_at) OVER (PARTITION BY unique_session_id ORDER BY created_at ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS session_start , LAST_VALUE (created_at) OVER (PARTITION BY unique_session_id ORDER BY created_at ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS session_end
  • 31. 31 How long do visitors spend on our website?
  • 32. 32 Putting It All Together Session ID User ID Session Start Session End Session Seq Events in Session 1 1 2017-08-21 3:04 2017-08-21 3:20 1 2 1 1 2017-08-21 3:04 2017-08-21 3:20 1 2 2 1 2017-08-21 5:10 2017-08-21 6:30 2 1 •  Add in the number of events in each session
  • 33. 33 Putting It All Together Session ID User ID Session Start Session End Session Seq Events in Session 1 1 2017-08-21 3:04 2017-08-21 3:20 1 2 1 1 2017-08-21 3:04 2017-08-21 3:20 1 2 2 1 2017-08-21 5:10 2017-08-21 6:30 2 1 •  Add in the number of events in each session , ROW_NUMBER () OVER (PARTITION BY session_facts.user_id ORDER BY MIN(session_start)) AS session_sequence_for_user , count(1) AS events_in_session FROM session_facts INNER JOIN events_sessionized
  • 35. 35 What percentage of my user base is returning?
  • 38. 38 Try it yourself! Event Sessionization Sessionization Funnel