Natural language to SQL demos beautifully on a clean orders table and falls apart the moment you point it at the GA4 BigQuery export.
The GA4 schema is a trap for LLMs
GA4 stores events, not one row per session. The parameters you want live in event_params, a repeated key-value array you have to UNNEST before you can filter on them.
Scope is everywhere: event, session, and user each mean something different, and user_pseudo_id is not user_id. Data is spread across sharded events_YYYYMMDD tables, so a date filter is really a table filter.
Even the date is a trap: filtering on _TABLE_SUFFIX across events_YYYYMMDD is nothing like a WHERE on a plain date column, and a model rarely guesses it.
A model that treats all of this like a flat table writes wrong SQL that still runs.
A concrete break
Ask a naive model for "sessions yesterday" and it counts event rows, because it doesn't know a session id is buried in the params:
SELECT (SELECT value.int_value FROM UNNEST(event_params) WHERE key = 'ga_session_id') AS session_id FROM `project.analytics_123.events_*` WHERE event_name = 'session_start'
Nothing in the plain-English question tells the model to UNNEST the params or to dedupe session ids, so it skips both and returns a confident wrong count.
Where natural language to SQL still helps
Over a modeled layer, it works. If you first flatten GA4 into clean sessions and events tables with Dataform or dbt, the hard part is already done.
Now a "sessions" table has one row per session and a plain session_id column. Point the model at that, and plain English suddenly maps to correct SQL, because the schema finally matches how people ask questions.
The fix isn't a smarter prompt, it's a better table. Once "sessions yesterday" is a trivial COUNT over one row per session, the model gets it right on the first try, because you moved the intelligence from the query into the schema, where it belongs.
Natural language to SQL doesn't break because the AI is dumb. It breaks because the GA4 export is shaped for collection, not for questions. Model the data first, and the demo finally matches reality.
Want a stronger data analyst role or a raise? Grab the FREE Product Analyst Playbook and get the exact roadmap to your next offer.
