This report analyzes the website traffic and user behavior of my personal blog using data collected from Google Analytics 4 (GA4) and exported to Google BigQuery.
The purpose is to understand how users interact with my website, what type of content performs best, and how I can optimize the website for better engagement and conversions.
sql <- ” SELECT event_date, event_name, COUNT(*) AS events FROM ic-term-project-website.analytics_505865185.events_* GROUP BY event_date, event_name ORDER BY event_date ”
The data used in this report comes from: - Google Analytics 4 (GA4) - Automatic daily export to BigQuery - Dataset: analytics_505865185 - Table: events_*
Below is the code for loading and processing the data:
library(bigrquery)library(dplyr)
Attaching package: 'dplyr'
The following objects are masked from 'package:stats':
filter, lag
The following objects are masked from 'package:base':
intersect, setdiff, setequal, union
library(ggplot2)project <-"ic-term-project-website"dataset <-"analytics_505865185"sql <-"SELECT event_date, event_name, COUNT(*) AS eventsFROM `ic-term-project-website.analytics_505865185.events_*`GROUP BY event_date, event_nameORDER BY event_date"ga_data <-bq_project_query(project, sql) %>%bq_table_download()
! Using an auto-discovered, cached token.
To suppress this message, modify your code or options to clearly consent to
the use of a cached token.
See gargle's "Non-interactive auth" vignette for more details: