SlideShare a Scribd company logo
1 of 32
Web Analytics with R
Johann de Boer
Purpose of this presentation
1. Encourage web data analysts to move to R
and away from Excel!
2. Help those wanting to learn R to get started.
3. Build interest amongst the R community in
developing packages for web analytics.
What is web analytics?
Measurement and analysis of (aggregated)
internet data for purposes of optimising
website usage.
Web analytics data
Dimensions and metrics
Web analytics data
Dimensions Metrics
User Custom dimensions, eg.
existing customer flag
Unique users, avg
revenue per user
Device Browser and OS,
isTablet, isMobile
Unique devices, total
visits
Session Traffic source, date and
time of visit, landing
page
Time on site,
pageviews per visit,
goal completions
Hit Page URL, page title,
event type, product
name
Time on page, page
loading time,
transaction amount
Metrics
Unique Visitors, New Visits, % New Visits, Visits, Bounces, Bounce Rate, Bounce
Rate, Visit Duration, Avg. Visit Duration, Organic Searches, Impressions, Clicks,
Cost, CPM, CPC, CTR, Cost per Transaction, Cost per Goal Conversion, Cost per
Conversion, RPC, ROI, Margin, Goal 1 Starts, Goal Starts, Goal 1 Completions,
Goal Completions, Goal 1 Value, Goal Value, Per Visit Goal Value, Goal 1
Conversion Rate, Goal Conversion Rate, Goal 1 Abandoned Funnels, Abandoned
Funnels, Goal 1 Abandonment Rate, Total Abandonment Rate, Data Hub Activities,
Page Value, Entrances, Entrances / Pageviews, Pageviews, Pages / Visit, Unique
Pageviews, Time on Page, Avg. Time on Page, Exits, % Exit, Results Pageviews,
Total Unique Searches, Results Pageviews / Search, Visits with Search, % Visits
with Search, Search Depth, Search Depth, Search Refinements, % Search
Refinements, Time after Search, Time after Search, Search Exits, % Search Exits,
Goal 1 Conversion Rate, Goal Conversion Rate, Per Search Goal Value, Page Load
Time (ms), Page Load Sample, Avg. Page Load Time (sec), Domain Lookup Time
(ms), Avg. Domain Lookup Time (sec), Page Download Time (ms), Avg. Page
Download Time (sec), Redirection Time (ms), Avg. Redirection Time (sec), Server
Connection Time (ms), Avg. Server Connection Time (sec), Server Response Time
(ms), Avg. Server Response Time (sec), Speed Metrics Sample, Document
Interactive Time (ms), Avg. Document Interactive Time (sec), Document Content
Loaded Time (ms), Avg. Document Content Loaded Time (sec), DOM Latency
Metrics Sample, Screen Views, Screen Views, Unique Screen Views, Unique
Screen Views, Screens / Session, Screens / Session, Time on Screen, Avg. Time
on Screen, Total Events, Unique Events, Event Value, Avg. Value, Visits with Event,
Events / Visit, Transactions, Ecommerce Conversion Rate, Revenue, Average
Value, Per Visit Value, Shipping, Tax, Total Value, Quantity, Unique Purchases,
Average Price, Product Revenue, Average QTY, Local Revenue, Local Shipping,
Local Tax, Local Product Revenue, Social Actions, Unique Social Actions, Actions
Per Social Visit, User Timing (ms), User Timing Sample, Avg. User Timing (sec),
Exceptions, Exceptions / Screen, Crashes, Crashes / Screen, Custom Metric Value
Dimensions
Visitor Type, Count of Visits, Days Since Last Visit, User Defined Value, Visit
Duration, Referral Path, Full Referrer, Campaign, Source, Medium, Source /
Medium, Keyword, Ad Content, Social Network, Social Source Referral, Ad Group,
Ad Slot, Ad Slot Position, Ad Distribution Network, Query Match Type, Matched
Search Query, Placement Domain, Placement URL, Ad Format, Targeting Type,
Placement Type, Display URL, Destination URL, AdWords Customer ID, AdWords
Campaign ID, AdWords Ad Group ID, AdWords Creative ID, AdWords Criteria ID,
Goal Completion Location, Goal Previous Step - 1, Goal Previous Step - 2, Goal
Previous Step - 3, Browser, Browser Version, Operating System, Operating System
Version, Mobile (Including Tablet), Tablet, Mobile Device Branding, Mobile Device
Model, Mobile Input Selector, Mobile Device Info, Mobile Device Marketing Name,
Device Category, Continent, Sub Continent Region, Country / Territory, Region,
Metro, City, Latitude, Longitude, Network Domain, Service Provider, Flash Version,
Java Support, Language, Screen Colors, Screen Resolution, Endorsing URL,
Display Name, Social Activity Post, Social Activity Timestamp, Social User Handle,
User Photo URL, User Profile URL, Shared URL, Social Tags Summary, Originating
Social Action, Social Network and Action, Hostname, Page, Page path level 1, Page
path level 2, Page path level 3, Page path level 4, Page Title, Landing Page,
Second Page, Exit Page, Previous Page Path, Next Page Path, Page Depth, Site
Search Status, Search Term, Refined Keyword, Site Search Category, Start Page,
Destination Page, App Installer ID, App Version, App Name, App ID, Screen Name,
Screen Depth, Landing Screen, Exit Screen, Event Category, Event Action, Event
Label, Transaction, Affiliation, Visits to Transaction, Days to Transaction, Product
SKU, Product, Product Category, Currency Code, Social Source, Social Action,
Social Source and Action, Social Entity, Social Type, Timing Category, Timing
Label, Timing Variable, Exception Description, Experiment ID, Variation, Custom
Dimension , Custom Variable (Key 1), Custom Variable (Value 01), Date, Year,
Month of the year, Week of the year, Day of the month, Hour, Month, Week, Day,
Day of week, Day of week name, Hour of Day, Month of Year, Week of Year, ISO
week of the year
265 dimensions and metrics in
Google Analytics and growing!
Google Analytics
Source: Charles Farina, e-nor.com blog, Published 9 July 2012
The Web Analytics market
Google Analytics - now Universal
Google Analytics APIs
● Data collection
○ Collection APIs and SDKs
● Data extraction
○ Core Reporting API
■ Metadata API
○ Real-time Reporting API
○ Multi-Channel Funnels Reporting API
Why use R for web
analytics?
R is free, open source and popular!
Spreadsheets are rigid and fragile
R is agile and robust
7 reasons to use R instead of Excel
1. Captures each step in your analysis
2. Makes it easier to review and fix your
mistakes
3. Easy to reproduce and reuse analyses
4. Join datasets from multiple sources
5. Powerful ways to analyse and visualise your
data
6. Automate retrieval of your data via the Core
Reporting API
7. Saves time!
Learning and using R
In the beginning...
plyr
ggplot2
lubridate
reshape2
devtools
httr
roxygen2
markdown
git (version control)
Recommended tools and packages
Google Analytics packages for R
● r-google-analytics
○ By Google but stopped working for a long time
● rga
○ By Bror Skardhamar, popular and active
● ganalytics
○ Written by me to create an abstraction from the Core
Reporting API protocol
ganalytics
Automate extraction of
Google Analytics data
Make querying GA data from R an
easy and interactive experience
● Queries are manipulated on the fly
● Defining filter and segmentation expressions
is easy
● Checks queries for errors before sending
○ corrects them automatically in some cases too!
● Creates a level of abstraction from the Core
Reporting API - easier to extend functionality
Query expressions
ga:keyword@=buy
(search traffic keywords containing “buy”)
A single expression comprises of:
● a variable - a dimension or metric
● an operator - e.g. equals, contains, regular
expression, greater than, does not equal, ...
● an operand - a number (metric) or a
character string (dimension)
Combining expressions
● Expressions can be joint using OR and AND.
● OR takes precedence over AND always, and
expressions cannot be grouped.
ga:keyword@=buy;ga:city=~^(Sy
dney|Melbourne)$,ga:isTablet=
=Yes
(search traffic keywords containing “buy” AND [city
is [Sydney OR Melbourne] OR via a tablet])
Writing expressions with ganalytics
● Filter to pass to core reporting API
ga:keyword@=buy;ga:city=~^(Sydney|Melbourne)$,g
a:isTablet==Yes
● Using ganalytics to write this
GaAnd(
GaExpr('keyword', '@', 'buy'),
GaOr(
GaExpr('city', '~',
'^(Sydney|Melbourne)$'),
GaExpr('isTablet', '=', ‘Yes’)
)
)
ganalytics Demo
gist.github.com/jdeboer/6569077
How does traffic from
desktop, mobile and
tablet users change
throughout the day and
over the week?
Average number of visits per hour and day -
split by desktop, mobile and tablet
R + ggplot2 + plyr + ganalytics =
Get involved!
Open source R package development is fun!
Package development
● Use RStudio with Git version control
○ Open a free GitHub account
○ Use Roxygen2 for generating your documentation
and NAMESPACE file
○ RStudio integrates with Git, Roxygen2 and RTools
to make the package build process easy
● Hadley Wickham is a great help
○ devtools package - great for installing straight from a
GitHub repository
○ read his online book “Advanced R Programming” -
easy to follow package development steps
Learn more...
● Google Analytics: #ganalytics
○ Video lessons: google.com.au/analytics/iq.html
○ Reference: developers.google.com/analytics
● Learn R: #rstats
○ Presciient: presciient.com/courses
○ Code School: tryr.codeschool.com
○ Coursera: coursera.org/course/compdata
○ Intro to R videos by Google: t.co/FQ8DvZEdRW
● Package development: adv-r.had.co.nz
● ganalytics: github.com/jdeboer/ganalytics
● Follow me on Twitter: @johannux

More Related Content

Recently uploaded

Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
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 Scriptwesley chun
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
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 DevelopmentsTrustArc
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
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?Igalia
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 

Recently uploaded (20)

Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
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
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
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?
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Web Analytics with R

  • 1. Web Analytics with R Johann de Boer
  • 2. Purpose of this presentation 1. Encourage web data analysts to move to R and away from Excel! 2. Help those wanting to learn R to get started. 3. Build interest amongst the R community in developing packages for web analytics.
  • 3. What is web analytics? Measurement and analysis of (aggregated) internet data for purposes of optimising website usage.
  • 6. Web analytics data Dimensions Metrics User Custom dimensions, eg. existing customer flag Unique users, avg revenue per user Device Browser and OS, isTablet, isMobile Unique devices, total visits Session Traffic source, date and time of visit, landing page Time on site, pageviews per visit, goal completions Hit Page URL, page title, event type, product name Time on page, page loading time, transaction amount
  • 7. Metrics Unique Visitors, New Visits, % New Visits, Visits, Bounces, Bounce Rate, Bounce Rate, Visit Duration, Avg. Visit Duration, Organic Searches, Impressions, Clicks, Cost, CPM, CPC, CTR, Cost per Transaction, Cost per Goal Conversion, Cost per Conversion, RPC, ROI, Margin, Goal 1 Starts, Goal Starts, Goal 1 Completions, Goal Completions, Goal 1 Value, Goal Value, Per Visit Goal Value, Goal 1 Conversion Rate, Goal Conversion Rate, Goal 1 Abandoned Funnels, Abandoned Funnels, Goal 1 Abandonment Rate, Total Abandonment Rate, Data Hub Activities, Page Value, Entrances, Entrances / Pageviews, Pageviews, Pages / Visit, Unique Pageviews, Time on Page, Avg. Time on Page, Exits, % Exit, Results Pageviews, Total Unique Searches, Results Pageviews / Search, Visits with Search, % Visits with Search, Search Depth, Search Depth, Search Refinements, % Search Refinements, Time after Search, Time after Search, Search Exits, % Search Exits, Goal 1 Conversion Rate, Goal Conversion Rate, Per Search Goal Value, Page Load Time (ms), Page Load Sample, Avg. Page Load Time (sec), Domain Lookup Time (ms), Avg. Domain Lookup Time (sec), Page Download Time (ms), Avg. Page Download Time (sec), Redirection Time (ms), Avg. Redirection Time (sec), Server Connection Time (ms), Avg. Server Connection Time (sec), Server Response Time (ms), Avg. Server Response Time (sec), Speed Metrics Sample, Document Interactive Time (ms), Avg. Document Interactive Time (sec), Document Content Loaded Time (ms), Avg. Document Content Loaded Time (sec), DOM Latency Metrics Sample, Screen Views, Screen Views, Unique Screen Views, Unique Screen Views, Screens / Session, Screens / Session, Time on Screen, Avg. Time on Screen, Total Events, Unique Events, Event Value, Avg. Value, Visits with Event, Events / Visit, Transactions, Ecommerce Conversion Rate, Revenue, Average Value, Per Visit Value, Shipping, Tax, Total Value, Quantity, Unique Purchases, Average Price, Product Revenue, Average QTY, Local Revenue, Local Shipping, Local Tax, Local Product Revenue, Social Actions, Unique Social Actions, Actions Per Social Visit, User Timing (ms), User Timing Sample, Avg. User Timing (sec), Exceptions, Exceptions / Screen, Crashes, Crashes / Screen, Custom Metric Value Dimensions Visitor Type, Count of Visits, Days Since Last Visit, User Defined Value, Visit Duration, Referral Path, Full Referrer, Campaign, Source, Medium, Source / Medium, Keyword, Ad Content, Social Network, Social Source Referral, Ad Group, Ad Slot, Ad Slot Position, Ad Distribution Network, Query Match Type, Matched Search Query, Placement Domain, Placement URL, Ad Format, Targeting Type, Placement Type, Display URL, Destination URL, AdWords Customer ID, AdWords Campaign ID, AdWords Ad Group ID, AdWords Creative ID, AdWords Criteria ID, Goal Completion Location, Goal Previous Step - 1, Goal Previous Step - 2, Goal Previous Step - 3, Browser, Browser Version, Operating System, Operating System Version, Mobile (Including Tablet), Tablet, Mobile Device Branding, Mobile Device Model, Mobile Input Selector, Mobile Device Info, Mobile Device Marketing Name, Device Category, Continent, Sub Continent Region, Country / Territory, Region, Metro, City, Latitude, Longitude, Network Domain, Service Provider, Flash Version, Java Support, Language, Screen Colors, Screen Resolution, Endorsing URL, Display Name, Social Activity Post, Social Activity Timestamp, Social User Handle, User Photo URL, User Profile URL, Shared URL, Social Tags Summary, Originating Social Action, Social Network and Action, Hostname, Page, Page path level 1, Page path level 2, Page path level 3, Page path level 4, Page Title, Landing Page, Second Page, Exit Page, Previous Page Path, Next Page Path, Page Depth, Site Search Status, Search Term, Refined Keyword, Site Search Category, Start Page, Destination Page, App Installer ID, App Version, App Name, App ID, Screen Name, Screen Depth, Landing Screen, Exit Screen, Event Category, Event Action, Event Label, Transaction, Affiliation, Visits to Transaction, Days to Transaction, Product SKU, Product, Product Category, Currency Code, Social Source, Social Action, Social Source and Action, Social Entity, Social Type, Timing Category, Timing Label, Timing Variable, Exception Description, Experiment ID, Variation, Custom Dimension , Custom Variable (Key 1), Custom Variable (Value 01), Date, Year, Month of the year, Week of the year, Day of the month, Hour, Month, Week, Day, Day of week, Day of week name, Hour of Day, Month of Year, Week of Year, ISO week of the year 265 dimensions and metrics in Google Analytics and growing!
  • 9. Source: Charles Farina, e-nor.com blog, Published 9 July 2012 The Web Analytics market
  • 10. Google Analytics - now Universal
  • 11. Google Analytics APIs ● Data collection ○ Collection APIs and SDKs ● Data extraction ○ Core Reporting API ■ Metadata API ○ Real-time Reporting API ○ Multi-Channel Funnels Reporting API
  • 12. Why use R for web analytics?
  • 13. R is free, open source and popular!
  • 14. Spreadsheets are rigid and fragile
  • 15. R is agile and robust
  • 16. 7 reasons to use R instead of Excel 1. Captures each step in your analysis 2. Makes it easier to review and fix your mistakes 3. Easy to reproduce and reuse analyses 4. Join datasets from multiple sources 5. Powerful ways to analyse and visualise your data 6. Automate retrieval of your data via the Core Reporting API 7. Saves time!
  • 19.
  • 21. Google Analytics packages for R ● r-google-analytics ○ By Google but stopped working for a long time ● rga ○ By Bror Skardhamar, popular and active ● ganalytics ○ Written by me to create an abstraction from the Core Reporting API protocol
  • 23. Make querying GA data from R an easy and interactive experience ● Queries are manipulated on the fly ● Defining filter and segmentation expressions is easy ● Checks queries for errors before sending ○ corrects them automatically in some cases too! ● Creates a level of abstraction from the Core Reporting API - easier to extend functionality
  • 24. Query expressions ga:keyword@=buy (search traffic keywords containing “buy”) A single expression comprises of: ● a variable - a dimension or metric ● an operator - e.g. equals, contains, regular expression, greater than, does not equal, ... ● an operand - a number (metric) or a character string (dimension)
  • 25. Combining expressions ● Expressions can be joint using OR and AND. ● OR takes precedence over AND always, and expressions cannot be grouped. ga:keyword@=buy;ga:city=~^(Sy dney|Melbourne)$,ga:isTablet= =Yes (search traffic keywords containing “buy” AND [city is [Sydney OR Melbourne] OR via a tablet])
  • 26. Writing expressions with ganalytics ● Filter to pass to core reporting API ga:keyword@=buy;ga:city=~^(Sydney|Melbourne)$,g a:isTablet==Yes ● Using ganalytics to write this GaAnd( GaExpr('keyword', '@', 'buy'), GaOr( GaExpr('city', '~', '^(Sydney|Melbourne)$'), GaExpr('isTablet', '=', ‘Yes’) ) )
  • 28. How does traffic from desktop, mobile and tablet users change throughout the day and over the week? Average number of visits per hour and day - split by desktop, mobile and tablet
  • 29. R + ggplot2 + plyr + ganalytics =
  • 30. Get involved! Open source R package development is fun!
  • 31. Package development ● Use RStudio with Git version control ○ Open a free GitHub account ○ Use Roxygen2 for generating your documentation and NAMESPACE file ○ RStudio integrates with Git, Roxygen2 and RTools to make the package build process easy ● Hadley Wickham is a great help ○ devtools package - great for installing straight from a GitHub repository ○ read his online book “Advanced R Programming” - easy to follow package development steps
  • 32. Learn more... ● Google Analytics: #ganalytics ○ Video lessons: google.com.au/analytics/iq.html ○ Reference: developers.google.com/analytics ● Learn R: #rstats ○ Presciient: presciient.com/courses ○ Code School: tryr.codeschool.com ○ Coursera: coursera.org/course/compdata ○ Intro to R videos by Google: t.co/FQ8DvZEdRW ● Package development: adv-r.had.co.nz ● ganalytics: github.com/jdeboer/ganalytics ● Follow me on Twitter: @johannux

Editor's Notes

  1. Digital Analytics Manager at Open Universities Australia Focused on web usability and analytics Background in computer systems Learning and using R for around 2 years
  2. I'll briefly explain: what Web Analytics is why R should be used instead of Excel for web data analysis ways to learn R, and how to put R to practice in web analytics
  3. Eugene Dubossarsky Jeff Leek and Rober Peng of John Hopkins School of Public Health Hadley Wickham R In A Nutshell by Joseph Adler Quick R by Rob Kabacoff Try R at Code School R Podcast by Eric Nantz #rstats