Event Performance
This SQL template aggregates Google Analytics event data by month, summarizing event counts, user counts, average events per user, and total revenue for each event. It groups the data by period and event name, then orders the results by event count in descending order.
- Grain
- See the notes
- Built from
- 1Raw tables
- 1Core
- 1Analytics
- Reads from Google Analytics 4
- events_overview
- Ships as
- Weld and dbt SQL, open source on GitHub
1-- core.google_analytics_4.event_performance
2-- Event Performance. This SQL template aggregates Google Analytics event data by
3-- month, summarizing event counts, user counts, average events per user, and total
4-- revenue for each event. It groups the data by period and event name, then orders
5-- the results by event count in descending order.
6--
7-- From the weld.app template library. Not reconciled against Google Analytics 4;
8-- check the output against the source before relying on it.
9
10SELECT
11 DATE_TRUNC(date, MONTH) AS period, -- Change to 'DAY' for daily overview
12 event_name,
13 SUM(event_count) AS event_count,
14 SUM(total_users) AS total_users,
15 AVG(event_count_per_user) AS event_count_per_user,
16 SUM(total_revenue) AS total_revenue
17FROM
18 {{raw.google_analytics_4.events_overview}}
19GROUP BY
20 period, event_name
21ORDER BY
22 event_count DESCThis model and the 1 it depends on. Deploy them together; refs like {{staging.…}} resolve to the matching folders in Weld, and the dbt view uses source() and ref().
How it counts. And where it stops.
The "Event Performance" SQL model for Google Analytics integration provides a comprehensive overview of event metrics over specified periods, such as months or days. By aggregating data from the Google Analytics 4 events overview, this model calculates total event counts, user counts, average events per user, and total revenue generated by events. This SQL model is particularly useful for understanding user engagement and behavior, identifying high-performing events, and assessing the revenue impact of different events. It enables businesses to make data-driven decisions to optimize their event strategies and improve overall performance.
Raw tables it reads
- raw.google_analytics_4.events_overview
More Google Analytics 4 models
Put Google Analytics 4 in front
of your agents.
Connect Google Analytics 4, deploy the models, and ask questions in Claude, Cursor or ChatGPT. Free for 14 days, no credit card.