Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Forecasting Google Analytics with Facebook Prophet

Forecasting Google Analytics with Facebook Prophet

In business, forecasts are everything. To make an accurate forecast you need the latest tools and algorithms. This presentation combines several cutting edge technologies including Google Analytics API, Facebook Prophet, Fable Scalable Time Series, and Shiny Web Applications.

Matt Dancho

March 25, 2020
Tweet

More Decks by Matt Dancho

Other Decks in Business

Transcript

  1. With the Facebook Prophet Matt Dancho & David Curry Business

    Science Learning Lab Forecasting Google Analytics
  2. Shiny API Series • Lab 28 - Shiny Real Estate

    App ◦ Zillow API • Lab 29 - Shiny Oil & Gas App ◦ Quandl API • Lab 30 - Shiny Finance App ◦ Tidyquant API • Lab 31 - Shiny Marketing App ◦ Google Analytics API • Lab 32 - Shiny Twitter App ◦ Twitter API
  3. Learning Labs PRO Every 2-Weeks 1-Hour Course Recordings + Code

    + Slack $19/month university.business-science.io Lab 31 - Shiny API Series, Pt 4 Shiny + Google Analytics + Prophet Lab 30 - Shiny API Series, Pt 3 Shiny + Finance + Excel + R + Tidyquant Lab 29 - Shiny API Series, Pt 2 Shiny + Quandl + ARIMA for Energy Forecasting Lab 28 - Shiny API Series, Pt 1 Shiny + Zillow for Real Estate Lab 27 - Marketing Series, Pt 4 Google Trends Automation with Shiny Lab 26 - Marketing Series, Pt 3 Customer Journey with Machine Learning Lab 25 - Marketing Series, Pt 2 Attribution with ChannelAttribution Lab 24 - Marketing Series, Pt 1 A/B Testing with Infer Continuous Learning Advanced Topics
  4. Agenda • Demo ◦ Google Analytics ◦ Page Views ◦

    Forecast Automation • Business Case ◦ Marketing • Google Analytics API ◦ How GA works (80/20) • Facebook Prophet ◦ What is it? ◦ Fable Implementation • 30-Min Demo ◦ Google Analytics API ◦ Prophet ◦ Shiny Page View Forecast Automation [LL PRO] • Pro-Tips & Learning Guide ◦ Build your career
  5. Marketing Funnel Establish Relationship Web Traffic leads to email collection

    3 Build Relationship Email enables Nurturing 2 Sales Nurturing leads to Purchasing 1 Why web traffic is important
  6. Forecasting is critical The better we can predict • The

    better we can estimate email conversions • The better we can estimate revenue • The better we can drive results A 20% reduction in forecast error Can save an organization $10M annually
  7. Google Analytics Access to A TON of important website data

    Key Concepts: • Data Organization • Metrics • Dimensions
  8. Facebook Prophet https://facebook.github.io/prophet/ Claims: • Accurate & Fast • Fully

    automatic • Tunable forecasts • Available in R & Python My experience Prophet works well until it doesn’t. Key Point: No silver bullet.
  9. How Prophet works “...additive model where non-linear trends are fit

    with yearly, weekly, and daily seasonality, plus holiday effects” Prophet Model Trends modeled by selecting changepoints Weeks modeled with dummy variables Seasonal with Fourier Series ...is 3 models added together Source: https://research.fb.com/blog/2017/02/prophet-forecasting-at-scale/
  10. Workflow Step-By-Step Start Finish 1 2 3 Google Analytics API

    Connect to GA Preprocess & Visualize Data Prophet Create prophet model for Page Views & Organic Searches Shiny App that productionizes the models
  11. Pro-Tip #1: Give Businesses Apps Apps are what businesses need

    Businesses can’t scale reports Businesses have cloud & servers Businesses need data democratized Businesses can solve these problems with shiny apps Apps solve these challenges
  12. Advanced Visualization Advanced Data Wrangling Advanced Functional Programming & Modeling

    Advanced Machine Learning Visualization Data Cleaning & Manipulation Data Science Algorithms & Iteration Business Reporting Business Analysis with R (DS4B 101-R) Data Science For Business with R (DS4B 201-R) Web Apps & Shiny Developer (DS4B 102-R + DS4B 202A-R) Web Apps Data Science Foundations 7 Weeks Machine Learning & Business Consulting 10 Weeks Web Application Development 12 Weeks -TRACK Project-Based Courses with Business Application Business Science University R-Track 4-Course R-Track System
  13. Key Benefits - Fundamentals - Weeks 1-5 (25 hours of

    Video Lessons) - Data Manipulation (dplyr) - Time series (lubridate) - Text (stringr) - Categorical (forcats) - Visualization (ggplot2) - Programming & Iteration (purrr) - 3 Challenges - Machine Learning - Week 6 (8 hours of Video Lessons) - Clustering (3 hours) - Regression (5 hours) - 2 Challenges - Learn Business Reporting - Week 7 - RMarkdown & plotly - 2 Project Reports: 1. Product Pricing Algo 2. Customer Segmentation Visualization Data Cleaning & Manipulation Business Reporting Business Analysis with R (DS4B 101-R) Data Science Foundations 7 Weeks Data Science Algorithms & Iteration
  14. Key Benefits Understanding the Problem & Preparing Data - Weeks

    1-4 - Project Setup & Framework - Business Understanding / Sizing Problem - Tidy Evaluation - rlang - EDA - Exploring Data -GGally, skimr - Data Preparation - recipes - Correlation Analysis - 3 Challenges Machine Learning - Weeks 5, 6, 7 - H2O AutoML - Modeling Churn - ML Performance - LIME Feature Explanation Return-On-Investment - Weeks 7, 8, 9 - Expected Value Framework - Threshold Optimization - Sensitivity Analysis - Recommendation Algorithm Data Science For Business (DS4B 201-R) Machine Learning & Business Consulting 10 Weeks Advanced Visualization Advanced Data Wrangling Advanced Functional Programming & Modeling Advanced Data Science End-to-End Churn Project
  15. Key Benefits Learn Shiny & Flexdashboard - Build Applications -

    Learn Reactive Programming - Integrate Machine Learning App #1: Predictive Pricing App - Model Product Portfolio - XGBoost Pricing Prediction - Generate new products instantly App #2: Sales Dashboard with Demand Forecasting - Model Demand History - Segment Forecasts by Product & Customer - XGBoost Time Series Forecast - Generate new forecasts instantly Shiny Apps for Business (DS4B 102-R) Web Application Development 4 Weeks Web Apps Machine Learning
  16. Key Benefits Frontend + Backend + Production Deployment Frontend for

    Shiny - Bootstrap Backend for Shiny - MongoDB Atlas Cloud - Dynamic UI - User Authentication & Security Production Deployment - AWS - EC2 Server - SSL & HTTPS Encryption Shiny Apps for Business (DS4B 202A-R) Web Application Development 6 Weeks