BigQuery GA4 Query Library
35+ battle-tested BigQuery SQL queries for GA4 export data. Users, sessions, events, funnels, cohorts, attribution, revenue, traffic sources. Fill in your project and dataset once; every query is ready to run.
Measurement Intelligence
GA4 UI hides most of your data behind sampling. BigQuery doesn't.
Any mid-market or enterprise GA4 property should have BigQuery export enabled: it's free on standard GA4 and gives you raw, unsampled event data. The hard part is knowing which SQL to write. This library has the queries actual analytics teams use.
Configuration
Filter by category
Queries
Next steps
GA4 Measurement Protocol: send custom events straight to GA4 from your backend
For high-value events, don't rely on browser-side tags that can be blocked.
Frequently asked questions
What does this tool provide?
14 ready-to-run SQL queries for GA4 export data in BigQuery. Covers users, sessions, funnel, cohorts, ecommerce, custom events, attribution.
What is GA4 BigQuery export?
GA4's raw event-level data piped daily (or streaming) to BigQuery. Free up to 1M events/day; standard BigQuery billing thereafter.
Why query GA4 in BigQuery instead of the UI?
Full raw access, custom metrics, joins to other datasets, no sampling. The GA4 UI samples heavily on complex queries.
How do I enable BigQuery export?
GA4 and Admin and BigQuery Links and Link. Requires a GCP project. Linking is free; BigQuery storage + queries billed.
Does the tool execute queries?
No. It provides SQL you paste into BigQuery console. The site doesn't have access to your data.
How does the tool handle project / dataset substitution?
Enter your project and dataset once; the tool substitutes across all queries.
What are the most useful queries?
Session attribution with first-touch + last-touch channels. 7-day retention cohorts. Revenue by channel. Custom event conversion rates.
Can I modify the queries?
Yes. The SQL is editable in BigQuery. The library is a starting point, not a locked tool.
What is the cost of these queries?
BigQuery charges per TB scanned. Typical GA4 queries scan 1 to 10GB for a month of data. Pennies per query. Partitioned tables help.
Do the queries work on GA4 free vs 360?
Standard GA4 BigQuery export is available free. GA4 360 adds streaming export and higher daily event limits.
What about Universal Analytics BigQuery data?
UA BigQuery schema differs from GA4. These queries target GA4 only.
Free · no account
SEORCE for Chrome, Edge and Firefox
Audits the page you are on: headings, meta tags, schema, indexability, and whether AI crawlers can read it. Export the result as a PDF. Free, with no account.
It audits one page at a time and does not track AI answers. About the extension
Traffic from search and AI
See which visits came from search and AI.
SEORCE Web Analytics runs from one script tag, with Google Search Console connected. It shows visits from every AI source, from search and from campaigns, and it is free on every plan.
3,000+ users · Free forever plan, no card needed