google analytics data mining with r
TRANSCRIPT
![Page 1: Google Analytics Data Mining with R](https://reader036.vdocuments.mx/reader036/viewer/2022062406/55a8ad031a28ab8e2a8b483a/html5/thumbnails/1.jpg)
#tatvicwebinar
A GACP and GTMCP company
1/28/2015 1 #tatvicwebinar1/28/2015 1 #tatvicwebinar
Google Analytics Data Mining with R
(includes 3 Real Applications)
Jan 28th, 2015FREE Webinar by
![Page 2: Google Analytics Data Mining with R](https://reader036.vdocuments.mx/reader036/viewer/2022062406/55a8ad031a28ab8e2a8b483a/html5/thumbnails/2.jpg)
#tatvicwebinar
A GACP and GTMCP company
1/28/2015 2 #tatvicwebinar1/28/2015 2 #tatvicwebinar
Our Speakers
Kushan Shah
Maintainer of RGoogleAnalytics
Library & Web Analyst at Tatvic
@ kushan_s
Andy GranowitzDeveloper Advocate, Google
Analytics (Google)
@ agrano
![Page 3: Google Analytics Data Mining with R](https://reader036.vdocuments.mx/reader036/viewer/2022062406/55a8ad031a28ab8e2a8b483a/html5/thumbnails/3.jpg)
#tatvicwebinar
A GACP and GTMCP company
1/28/2015 3 #tatvicwebinar
Outline
An Introduction to R
Why analyze Google Analytics data with R
Getting started with R & Google Analytics
Questions & Answers
3 Real Life Applications & Use Cases
![Page 4: Google Analytics Data Mining with R](https://reader036.vdocuments.mx/reader036/viewer/2022062406/55a8ad031a28ab8e2a8b483a/html5/thumbnails/4.jpg)
#tatvicwebinar
A GACP and GTMCP company
1/28/2015 4 #tatvicwebinar
An Introduction to R
• Open source statistical computing language, widely used byorganizations to solve business problems
![Page 5: Google Analytics Data Mining with R](https://reader036.vdocuments.mx/reader036/viewer/2022062406/55a8ad031a28ab8e2a8b483a/html5/thumbnails/5.jpg)
#tatvicwebinar
A GACP and GTMCP company
1/28/2015 5 #tatvicwebinar
An Introduction to R
• Open source statistical computing language, widely used byorganizations to solve business problems
Data Analysis Statistical Tests
Data Visualization
Predictive Models
Forecasting
R
![Page 6: Google Analytics Data Mining with R](https://reader036.vdocuments.mx/reader036/viewer/2022062406/55a8ad031a28ab8e2a8b483a/html5/thumbnails/6.jpg)
#tatvicwebinar
A GACP and GTMCP company
1/28/2015 6 #tatvicwebinar
Why Use R
Easy to integrate with various data sources
Data Frame – Analogous to Excel Spreadsheet or MySQL Table
6000 Pre developed packages for various applications
No software licensing costs
Enables reproducible analysis
![Page 7: Google Analytics Data Mining with R](https://reader036.vdocuments.mx/reader036/viewer/2022062406/55a8ad031a28ab8e2a8b483a/html5/thumbnails/7.jpg)
#tatvicwebinar
A GACP and GTMCP company
1/28/2015 7 #tatvicwebinar
Outline of this Webinar
An Introduction to R
Why analyze Google Analytics data with R
Getting started with R & Google Analytics
Questions & Answers
3 Real Life Applications & Use Cases
![Page 8: Google Analytics Data Mining with R](https://reader036.vdocuments.mx/reader036/viewer/2022062406/55a8ad031a28ab8e2a8b483a/html5/thumbnails/8.jpg)
#tatvicwebinar
A GACP and GTMCP company
1/28/2015 8 #tatvicwebinar
Why analyze Google Analytics data with R
● Google Analytics API allows data extraction for custom reports
• Reports with up to 7 Dimensions and 10 Metrics
• API is well suited for batch data extraction
• API has techniques for handling large queries (10K - 1M records and beyond)
● RGoogleAnalytics = R Wrapper over the Google Analytics API
• Provides functions to easily interact with the Google Analytics API
• Takes care of the low level plumbing
● Google Analytics Premium User and data exported to Big Query
• Use the bigrquery package by Prof. Hadley Wickham
![Page 9: Google Analytics Data Mining with R](https://reader036.vdocuments.mx/reader036/viewer/2022062406/55a8ad031a28ab8e2a8b483a/html5/thumbnails/9.jpg)
#tatvicwebinar
A GACP and GTMCP company
1/28/2015 9 #tatvicwebinar
Outline of this Webinar
An Introduction to R
Why analyze Google Analytics data with R
Getting started with R & Google Analytics
Questions & Answers
3 Real Life Applications & Use Cases
![Page 10: Google Analytics Data Mining with R](https://reader036.vdocuments.mx/reader036/viewer/2022062406/55a8ad031a28ab8e2a8b483a/html5/thumbnails/10.jpg)
#tatvicwebinar
A GACP and GTMCP company
1/28/2015 10 #tatvicwebinar
Getting Started with R and Google Analytics
● Install R - http://www.r-project.org/
● Install RStudio - GUI for R (Optional)
● Install RGoogleAnalytics
Check out the blogpost for a step by step walkthrough - bit.ly/18oJjqA
![Page 11: Google Analytics Data Mining with R](https://reader036.vdocuments.mx/reader036/viewer/2022062406/55a8ad031a28ab8e2a8b483a/html5/thumbnails/11.jpg)
#tatvicwebinar
A GACP and GTMCP company
1/28/2015 11 #tatvicwebinar
Getting Started with R and Google Analytics
One Time Setup
● Create a Project in the Google Dev Console● Activate the Google Analytics API for your project● Get your Project’s Client ID and Client Secret
https://developers.google.com/analytics/devguides/reporting/core/v3/gdataAuthorization
![Page 12: Google Analytics Data Mining with R](https://reader036.vdocuments.mx/reader036/viewer/2022062406/55a8ad031a28ab8e2a8b483a/html5/thumbnails/12.jpg)
#tatvicwebinar
A GACP and GTMCP company
1/28/2015 12 #tatvicwebinar
Outline of this Webinar
An Introduction to R
Why analyze Google Analytics data with R
Getting started with R & Google Analytics
Questions & Answers
3 Real Life Applications & Use Cases
![Page 13: Google Analytics Data Mining with R](https://reader036.vdocuments.mx/reader036/viewer/2022062406/55a8ad031a28ab8e2a8b483a/html5/thumbnails/13.jpg)
#tatvicwebinar
A GACP and GTMCP company
1/28/2015 13 #tatvicwebinar
Examples
● Example 1: Forecast Product Revenue for an eCommerce Store
● Example 2: Assess the long term value of your Marketing Campaigns
● Example 3: Web Analytics Visualization with ggplot2
![Page 14: Google Analytics Data Mining with R](https://reader036.vdocuments.mx/reader036/viewer/2022062406/55a8ad031a28ab8e2a8b483a/html5/thumbnails/14.jpg)
#tatvicwebinar
A GACP and GTMCP company
1/28/2015 14 #tatvicwebinar
Example 1: Predict Product Revenue with R
● Get Product Revenue as Time Series (historical data)● Forecast Product Revenue for the next quarter
Check out the blogpost for a complete walkthrough - http://bit.ly/1y3dmtI
![Page 15: Google Analytics Data Mining with R](https://reader036.vdocuments.mx/reader036/viewer/2022062406/55a8ad031a28ab8e2a8b483a/html5/thumbnails/15.jpg)
#tatvicwebinar
A GACP and GTMCP company
1/28/2015 15 #tatvicwebinar
Example 1: Predict Product Revenue with R
Time Series Components
![Page 16: Google Analytics Data Mining with R](https://reader036.vdocuments.mx/reader036/viewer/2022062406/55a8ad031a28ab8e2a8b483a/html5/thumbnails/16.jpg)
#tatvicwebinar
A GACP and GTMCP company
1/28/2015 16 #tatvicwebinar
Example 2: Long Term Value of Your Marketing Campaigns
Check out the blogpost for a complete walkthrough - http://bit.ly/1zpjbYA
![Page 17: Google Analytics Data Mining with R](https://reader036.vdocuments.mx/reader036/viewer/2022062406/55a8ad031a28ab8e2a8b483a/html5/thumbnails/17.jpg)
#tatvicwebinar
A GACP and GTMCP company
1/28/2015 17 #tatvicwebinar
Example 2: Long Term Value of Your Marketing Campaigns
![Page 18: Google Analytics Data Mining with R](https://reader036.vdocuments.mx/reader036/viewer/2022062406/55a8ad031a28ab8e2a8b483a/html5/thumbnails/18.jpg)
#tatvicwebinar
A GACP and GTMCP company
1/28/2015 18 #tatvicwebinar
Query New Customers Acquired via a Given Campaign
query.list <- Init(start.date = "2014-11-01",
end.date = "2014-12-20",
dimensions = "ga:date",
metrics = "ga:transactions,ga:transactionRevenue",
segment = "users::sequence::
^ga:userType==New Visitor;
dateOfSession<>2014-11-01_2014-11-07;
ga:campaign==Campaign A;
->>perSession::ga:transactions>0",
sort = "ga:date",
table.id = tableId)
Example 2: Long Term Value of Your Marketing Campaigns
![Page 19: Google Analytics Data Mining with R](https://reader036.vdocuments.mx/reader036/viewer/2022062406/55a8ad031a28ab8e2a8b483a/html5/thumbnails/19.jpg)
#tatvicwebinar
A GACP and GTMCP company
1/28/2015 19 #tatvicwebinar
Example 2: Long Term Value of Your Marketing Campaigns
Segments Explained
• The segment selects users:: in order to include not only the sessions that match the conditions, but all sessions among users who match the conditions.
• The sequence:: prefix selects a set of users that completed a specified set of steps
• Step #1 - Visit from a given campaign in a given set of time
• Step #2 - Make a purchase
• The ^ prefix in front of ga:userType==New Visitor;dateOfSession<>2014-11-01_2014-11-07;ga:campaign==Campaign A ensures that the Date of Session, Campaign, and User Type conditions are true for the first hit of the first session in the given date range.
• ->>perSession::ga:transactions > 0 specifies the second step of making a purchase at some point.
![Page 20: Google Analytics Data Mining with R](https://reader036.vdocuments.mx/reader036/viewer/2022062406/55a8ad031a28ab8e2a8b483a/html5/thumbnails/20.jpg)
#tatvicwebinar
A GACP and GTMCP company
1/28/2015 20 #tatvicwebinar
Example 2: Long Term Value of Your Marketing Campaigns
• head(campaign_a_df)
• cumulativeTransactions <- cumsum(campaign_a_df$transactions)
![Page 21: Google Analytics Data Mining with R](https://reader036.vdocuments.mx/reader036/viewer/2022062406/55a8ad031a28ab8e2a8b483a/html5/thumbnails/21.jpg)
#tatvicwebinar
A GACP and GTMCP company
1/28/2015 21 #tatvicwebinar
Example 2: Long Term Value of Your Marketing Campaigns
Use the data to Generate a Cumulative Transactions Plot
![Page 22: Google Analytics Data Mining with R](https://reader036.vdocuments.mx/reader036/viewer/2022062406/55a8ad031a28ab8e2a8b483a/html5/thumbnails/22.jpg)
#tatvicwebinar
A GACP and GTMCP company
1/28/2015 22 #tatvicwebinar
Example 3: Web Analytics visualization with ggplot2
Background
• gg – Grammar of Graphics (Wilkinson, 2005)• R Implementation by Prof. Hadley Wickham• Sophisticated graphs in a *few lines of R code
* Learning Curve
![Page 23: Google Analytics Data Mining with R](https://reader036.vdocuments.mx/reader036/viewer/2022062406/55a8ad031a28ab8e2a8b483a/html5/thumbnails/23.jpg)
#tatvicwebinar
A GACP and GTMCP company
1/28/2015 23 #tatvicwebinar
Example 3: Web Analytics visualization with ggplot2
ggplot(data = ga.data) + geom_line(aes(x = date, y = itemRevenue)
Check out the blogpost for a complete walkthrough - http://bit.ly/15Iaaf7
![Page 24: Google Analytics Data Mining with R](https://reader036.vdocuments.mx/reader036/viewer/2022062406/55a8ad031a28ab8e2a8b483a/html5/thumbnails/24.jpg)
#tatvicwebinar
A GACP and GTMCP company
1/28/2015 24 #tatvicwebinar
Example 3: Web Analytics visualization with ggplot2
Decomposing the syntax
• Create the ggplot object and populate it with data • ggplot(ga.data)
• Add Layers(s) • geom_line(aes(x=date, y=itemRevenue))
• Other geoms – bar, point, line, histogram• Aesthetics describe how variables are mapped to visual
properties of geoms• Additional Plotting Options -> Plot title, Axis Titles, Axis Text
Formatting, Legends
![Page 25: Google Analytics Data Mining with R](https://reader036.vdocuments.mx/reader036/viewer/2022062406/55a8ad031a28ab8e2a8b483a/html5/thumbnails/25.jpg)
#tatvicwebinar
A GACP and GTMCP company
1/28/2015 25 #tatvicwebinar
Best Practices
• Become familiar with the Google Analytics API Naming Conventions
– Dimension/Metric names are in camelCase
• Know the permissible Dimension Metric Combinations
– https://developers.google.com/analytics/devguides/reporting/core/dimsmets
• Use the Query Feed Explorer to test queries before running them in R
– https://ga-dev-tools.appspot.com/explorer/
• Post issues at https://github.com/Tatvic/RGoogleAnalytics/issues
• Questions at Google Analytics Reporting API Forum
![Page 26: Google Analytics Data Mining with R](https://reader036.vdocuments.mx/reader036/viewer/2022062406/55a8ad031a28ab8e2a8b483a/html5/thumbnails/26.jpg)
#tatvicwebinar
A GACP and GTMCP company
1/28/2015 26 #tatvicwebinar
Further Resources
• http://bit.ly/r-googleanalytics-resources
• Watch the full R Google Analytics Webinar -http://bit.ly/1KrHXtH
![Page 27: Google Analytics Data Mining with R](https://reader036.vdocuments.mx/reader036/viewer/2022062406/55a8ad031a28ab8e2a8b483a/html5/thumbnails/27.jpg)
#tatvicwebinar
A GACP and GTMCP company
1/28/2015 27 #tatvicwebinar
Outline of this Webinar
An Introduction to R
Why analyze Google Analytics data with R
Getting started with R & Google Analytics
Questions & Answers
3 Real Life Applications & Use Cases
![Page 28: Google Analytics Data Mining with R](https://reader036.vdocuments.mx/reader036/viewer/2022062406/55a8ad031a28ab8e2a8b483a/html5/thumbnails/28.jpg)
#tatvicwebinar
A GACP and GTMCP company
1/28/2015 28 #tatvicwebinar
Next Webinar
Webinar: Everything You Need to Know aboutGTM V2
When: Feb 18th 10:00 AM PDT Guest Speaker
Phil Pearce(Web Analyst/ PPC/ SEO Expert)
You will learn:• How to Upgrade to GTM V2• Mistakes to Avoid while Upgrading• A Quick Checklist for Upgrading to GTM V2
And much more…
Register Here - http://bit.ly/gtm-v2-webinar
![Page 29: Google Analytics Data Mining with R](https://reader036.vdocuments.mx/reader036/viewer/2022062406/55a8ad031a28ab8e2a8b483a/html5/thumbnails/29.jpg)
#tatvicwebinar
A GACP and GTMCP company
1/28/2015 29 #tatvicwebinar
Kushan ShahTwitter: @kushan_s
Thank You!
Andy GranowitzTwitter: @agrano