Learning Google Analytics

Book description

Why is Google Analytics 4 the most modern data model available for digital marketing analytics? Rather than simply reporting what has happened, GA4's new cloud integrations enable more data activation, linking online and offline data across all your streams to provide end-to-end marketing data. This practical book prepares you for the future of digital marketing by demonstrating how GA4 supports these additional cloud integrations.

Author Mark Edmondson, Google developer expert for Google Analytics and Google Cloud, provides a concise yet comprehensive overview of GA4 and its cloud integrations. Data, business, and marketing analysts will learn major facets of GA4's powerful new analytics model, with topics including data architecture and strategy, and data ingestion, storage, and modeling. You'll explore common data activation use cases and get the guidance you need to implement them.

You'll learn:

  • How Google Cloud integrates with GA4
  • The potential use cases that GA4 integrations can enable
  • Skills and resources needed to create GA4 integrations
  • How much GA4 data capture is necessary to enable use cases
  • The process of designing dataflows from strategy through data storage, modeling, and activation
  • How to adapt the use cases to fit your business needs

Publisher resources

View/Submit Errata

Table of contents

  1. Preface
    1. Who This Book Is For
    2. Conventions Used in This Book
    3. Using Code Examples
    4. O’Reilly Online Learning
    5. How to Contact Us
    6. Acknowledgments
  2. 1. The New Google Analytics 4
    1. Introducing GA4
      1. The Unification of Mobile and Web Analytics
      2. Firebase and BigQuery—First Steps into the Cloud
      3. GA4 Deployment
      4. Universal Analytics Versus GA4
    2. The GA4 Data Model
      1. Events
      2. Custom Parameters
      3. Ecommerce Items
      4. User Properties
    3. Google Cloud Platform
      1. Relevant GCP Services
      2. Coding Skills
      3. Onboarding to GCP
      4. Moving Up the Serverless Pyramid
      5. Wrapping Up Our GCP Intro
    4. Introduction to Our Use Cases
      1. Use Case: Predictive Purchases
      2. Use Case: Audience Segmentation
      3. Use Case: Real-Time Forecasting
    5. Summary
  3. 2. Data Architecture and Strategy
    1. Creating an Environment for Success
      1. Stakeholder Buy-In
      2. A Use Case–Led Approach to Avoiding Spaceships
      3. Demonstrating Business Value
      4. Assessing Digital Maturity
      5. Prioritizing Your Use Cases
    2. Technical Requirements
    3. Data Ingestion
    4. Data Storage
    5. Data Modeling
      1. Model Performance Versus Business Value
      2. Principle of Least Movement (of Data)
      3. Raw Data Inputs to Informational Outputs
      4. Helping Your Data Scientists/Modelers
      5. Setting Model KPIs
      6. Final Location of Modeling
    6. Data Activation
      1. Maybe It’s Not a Dashboard
      2. Interaction with Your End Users
    7. User Privacy
      1. Respecting User Privacy Choices
      2. Privacy by Design
    8. Helpful Tools
      1. gcloud
      2. Version Control/Git
      3. Integrated Developer Environments
      4. Containers (Including Docker)
    9. Summary
  4. 3. Data Ingestion
    1. Breaking Down Data Silos
      1. Less Is More
      2. Specifying Data Schema
    2. GA4 Configuration
      1. GA4 Event Types
      2. GTM Capturing GA4 Events
      3. Custom Field Configuration
      4. Modifying or Creating GA4 Events
      5. User Properties
      6. Measurement Protocol v2
    3. Exporting GA4 Data via APIs
      1. Authentication with Data API
      2. Running Data API Queries
    4. BigQuery
      1. Linking GA4 with BigQuery
      2. BigQuery SQL on Your GA4 Exports
      3. BigQuery for Other Data Sources
      4. Public BigQuery Datasets
      5. GTM Server Side
    5. Google Cloud Storage
      1. Event-Driven Storage
      2. Data Privacy
      3. CRM Database Imports via GCS
    6. Setting Up Cloud Build CI/CD with GitHub
      1. Setting Up GitHub
      2. Setting Up the GitHub Connection to Cloud Build
      3. Adding Files to the Repository
    7. Summary
  5. 4. Data Storage
    1. Data Principles
      1. Tidy Data
      2. Datasets for Different Roles
    2. BigQuery
      1. When to Use BigQuery
      2. Dataset Organization
      3. Table Tips
    3. Pub/Sub
      1. Setting Up a Pub/Sub Topic for GA4 BigQuery Exports
      2. Creating Partitioned BigQuery Tables from Your GA4 Export
      3. Server-side Push to Pub/Sub
    4. Firestore
      1. When to Use Firestore
      2. Accessing Firestore Data Via an API
    5. GCS
    6. Scheduling Data Imports
      1. Data Import Types: Streaming Versus Scheduled Batches
      2. BigQuery Views
      3. BigQuery Scheduled Queries
      4. Cloud Composer
      5. Cloud Scheduler
      6. Cloud Build
    7. Streaming Data Flows
      1. Pub/Sub for Streaming Data
      2. Apache Beam/DataFlow
      3. Streaming Via Cloud Functions
    8. Protecting User Privacy
      1. Data Privacy by Design
      2. Data Expiration in BigQuery
      3. Data Loss Prevention API
    9. Summary
  6. 5. Data Modeling
    1. GA4 Data Modeling
      1. Standard Reports and Explorations
      2. Attribution Modeling
      3. User and Session Resolution
      4. Consent Mode Modeling
      5. Audience Creation
      6. Predictive Metrics
      7. Insights
    2. Turning Data into Insight
      1. Scoping Data Outcomes
      2. Accuracy Versus Incremental Benefit
      3. Choosing Your Method of Approach
      4. Keeping Your Modeling Pipelines Up-To-Date
      5. Linking Datasets
    3. BigQuery ML
      1. Comparison of BigQuery ML Models
      2. Putting a Model into Production
    4. Machine Learning APIs
      1. Putting an ML API into Production
    5. Google Cloud AI: Vertex AI
      1. Putting a Vertex API into Production
    6. Integration with R
      1. Overview of Capabilities
      2. Docker
      3. R in Production
    7. Summary
  7. 6. Data Activation
    1. Importance of Data Activation
    2. GA4 Audiences and Google Marketing Platform
    3. Google Optimize
    4. Visualization
      1. Making Dashboards Work
      2. GA4 Dashboarding Options
      3. Data Studio
      4. Looker
      5. Other Third-Party Visualization Tools
      6. Aggregate Tables Bring Data-Driven Decisions
      7. Caching and Cost Management
    5. Creating Marketing APIs
      1. Creating Microservices
      2. Event Triggers
      3. Firestore Integrations
    6. Summary
  8. 7. Use Case: Predictive Purchases
    1. Creating the Business Case
      1. Assessing Value
      2. Estimating Resources
      3. Data Architecture
    2. Data Ingestion: GA4 Configuration
    3. Data Storage and Privacy Design
    4. Data Modeling—Exporting Audiences to Google Ads
    5. Data Activation: Testing Performance
    6. Summary
  9. 8. Use Case: Audience Segmentation
    1. Creating the Business Case
      1. Assessing Value
      2. Estimating Resources
      3. Data Architecture
    2. Data Ingestion
      1. GA4 Data Capture Configuration
      2. GA4 BigQuery Exports
    3. Data Storage: Transformations of Your Datasets
    4. Data Modeling
    5. Data Activation
      1. Setting Up GA4 Imports Via GTM SS
      2. Exporting Audiences from GA4
      3. Testing Performance
    6. Summary
  10. 9. Use Case: Real-Time Forecasting
    1. Creating the Business Case
      1. Resources Needed
      2. Data Architecture
    2. Data Ingestion
      1. GA4 Configuration
    3. Data Storage
      1. Hosting the Shiny App on Cloud Run
    4. Data Modeling
    5. Data Activation—A Real-Time Dashboard
      1. R Code for the Real-Time Shiny App
      2. GA4 Authentication with a Service Account
      3. Putting It All Together in a Shiny App
    6. Summary
  11. 10. Next Steps
    1. Motivation: How I Learned What Is in This Book
    2. Learning Resources
      1. Asking for Help
      2. Certifications
    3. Final Thoughts
  12. Index
  13. About the Author

Product information

  • Title: Learning Google Analytics
  • Author(s): Mark Edmondson
  • Release date: November 2022
  • Publisher(s): O'Reilly Media, Inc.
  • ISBN: 9781098113087