Every marketer knows this scenario: a key business question about user behavior on the site pops up, but the answer is hidden in the clutter of data in Google Analytics 4. So the request goes into the analysts' queue, lands in the nearest sprint, and you have to wait days, or sometimes weeks, for a ready report.
The problem is rarely a lack of data or motivation; the most common bottleneck is time and the need to know SQL. What if you had a virtual analyst on your team who knows your GA4 data inside out, understands your company's business definitions, operates according to proven practices, and answers questions in an average of 60 seconds?
During our last webinar (co-organized with Google Cloud), Salestube experts (Michał Wrąbel - Intelligence Division Director and Michał Trawczyński - Analytics Engineer) showed how a dedicated AI agent for GA4, built in the Gemini Enterprise environment, works in practice.
Why isn't "regular" AI enough for GA4 analysis?
Throwing raw GA4 data (exported to BigQuery) into a standard language model with a request to summarize sales is a direct path to costly mistakes. The data structure in BigQuery is complex - each row is an event, tables are split by day, and key values are deeply nested.
A model lacking business context can fall into one of the typical traps:
Scan the entire data history (instead of one week), generating massive cloud costs.
Double-count revenue, counting the order value as many times as there were products in the cart.
Incorrectly attribute sales channels, confusing the source of a user's first visit from months ago with the channel that closed the transaction.
The worst part is that in such situations AI doesn't return an error; it simply provides a confident, but completely false number.
The Solution: An AI Agent "Anchored" in Your Business
The agent we created is built on the Google Agent Development Kit, runs on the Gemini Enterprise Agent Platform, and is available in your Gemini Enterprise application alongside other agents. It works directly on raw, unsampled data from the GA4 export to BigQuery. Its reliability rests on four layers, each responsible for a different aspect:
- Semantic Layer in Knowledge Catalog, a single place where the business meaning of your data is recorded: whether we count revenue net or gross, how we define traffic channels, and what synonyms your team uses. When you ask about a "funnel" or "revenue", the agent checks here first to see what exactly that means in your company.
- Verified Table Functions in BigQuery. Key metrics, such as the e-commerce funnel or daily transactions, are saved as ready-to-use functions prepared by our analysts. The same question always triggers the same, verified logic, so two people won't get two different numbers when asking about the same thing.
- Knowledge of GA4. The agent understands the export schema and the rules for working with it, for example, nested fields and daily tables. It uses this knowledge when no pre-made function fits the question.
- Guardrails. The agent checks the available date range and never assumes what "today" is. It operates strictly in read-only mode and checks the query cost before executing it. Date limits prevent accidental scanning of the entire data history.
Thanks to this, the agent does not guess. If a question can be handled with an approved function, the agent uses it. If not, it builds the query independently based on its GA4 knowledge and explicitly marks that the response extends beyond the approved layer. In every answer, it displays its reasoning process, the definition used, and the SQL query, providing numbers exclusively from the query results.
Live Case Study: The Mystery of the 30% Revenue Drop
What does this look like in practice for a marketer? We stepped into the role of an E-commerce Marketing Manager and asked the agent a series of questions in natural language:
Performance question: "What was the revenue in the last week of July?" In a matter of seconds, the agent provided the exact amount and the number of transactions based on the approved business function.
Comparison and alarm: After comparing it with the previous week, it turned out that revenue dropped by nearly 30%. On a standard dashboard, this would look like a fire in the company.
Diagnosing the cause: The agent broke down the revenue into three factors: sessions, conversion rate, and average order value (AOV). It turned out that the conversion rate actually increased, and almost the entire drop was due to a drastic reduction in AOV in the Unassigned channel on Desktop devices.
Independent AI investigation: When we asked what caused the drop in that specific segment, the agent, without additional prompts, performed a statistical distribution analysis of order values down to the pseudo-anonymous user ID level. This part of the analysis went beyond the approved functions, so the agent wrote the query independently and clearly indicated it.
Conclusion? The median value of a typical order barely changed. Accounting for 3/4 of the entire "crisis" drop was a single wholesale buyer (or test bot) who, the week before, had placed nearly a hundred huge orders for a few specific products, and barely a few during the analyzed week. Without the agent, reaching this conclusion would have taken an analyst hours of painstaking data mining.
Security and Architecture Under Full Control
The agent queries the GA4 export right where it resides: inside your BigQuery project. The agent's logic runs in a dedicated, isolated Google Cloud project in the EU region, and users interact with it via your Gemini Enterprise application.
Read-Only Mode: The agent cannot overwrite or delete data in BigQuery.
Full Interaction Transparency: Every query sent by the agent to BigQuery is logged in your Cloud Audit Logs. Gemini Enterprise allows you to verify who asked what, when, and what answer was received, as well as track the agent's full reasoning path, including invoked tools.
No Third-Party Servers: Everything operates within Google Cloud, without MCP servers or third-party connectors.
Access Management: One door, your keys: the agent connects to data via a single service account with read-only access restricted to the GA4 dataset. You grant these permissions and can revoke them at any time.
How to Deploy Such a Solution in Your Organization?
Deploying an analytical agent is a modular process that can be launched based on infrastructure you likely already possess. To get started, you need three elements:
GA4 Data Export to BigQuery (if you don't have it set up yet, it's worth enabling today, as data is not backfilled).
Gemini Enterprise Environment in Google Cloud.
A partner who knows GA4 inside out—and that's where we come in. You designate the person responsible for key business metrics, and our Data Insights team, with over 10 years of experience in data and analytics, translates them into a semantic layer, verified SQL functions in BigQuery, and a fully functional agent.
At Salestube, we combine over a decade of experience in the media space (Google Marketing Platform) and data engineering (Google Cloud). We help our clients translate business knowledge into language understandable by AI, provide ready-made, logically tested SQL queries (e.g., for excluding bot traffic or advanced CLV analysis integrated with CRM data), and deploy complete agents directly within the client's environment.
Want to relieve your analytics team and give marketers instant access to reliable GA4 insights? Contact us- let's talk about how we can build and tailor an AI agent to your business data and goals.




