Connect Google Analytics 4 to your Wiro AI agent
Reports, realtime data and attribution from your Google Analytics 4 properties.
Which landing pages pulled lots of visits in October but almost no purchases?
On the Larchwood Outdoor property, these landing pages passed 2,000 sessions in October, but fewer than 0.5% of their sessions ended in a purchase:
/guides/winter-layering: 6,420 sessions, 0.2%/sale/tents: 3,980 sessions, 0.4%/blog/best-trail-runners: 2,760 sessions, 0.1%/collections/kids: 2,140 sessions, 0.3%
The store as a whole converted 2.1%. The tent sale page is the surprise here, since people land on it ready to buy.
Overview
What Google Analytics 4 does for your agent
Every request goes to Google's Analytics Data and Admin APIs, authorized through your own Google Cloud app and kept to the GA4 properties you pick. The agent runs reports of metrics by dimensions over up to four date ranges, five reports at a time and realtime checks of the last 30 minutes, and it reads and can change settings such as data streams, key events and custom dimensions. Google's Data API quotas apply to each property, and a large report can come back sampled or with small numbers withheld.
Use cases
What your Wiro agent can do with Google Analytics 4
- 01
A Monday traffic and conversions report by channel
Every Monday, a Scheduled Task runs a GA4 report on last week: sessions, users, key events and revenue by default channel group, next to the week before. It points out the channels that grew or fell past the threshold you set and posts the table in Chat.
- 02
Landing pages that get visits but few conversions
Ask which landing pages drew plenty of sessions last month but few key events. The agent lists them with sessions, engagement rate and key event rate, split by device and source, and suggests what to test on each page.
- 03
Campaigns that bring buyers, not just visitors
Ask the agent to rank sources, mediums and campaigns by purchases and revenue instead of sessions, looking at both first user source and session source. You get a short list of the campaigns that bring revenue and the ones that only bring traffic.
- 04
A live check during a launch or a newsletter send
While a launch or newsletter goes out, ask the agent what is happening on the site. It reads GA4 realtime data for the last 30 minutes, active users by page and country and the key events coming in, and tells you whether the new page is getting traffic.
- 05
A daily alert when key events drop
Each morning, the agent compares yesterday's key events and revenue with the same weekday last week. When one falls past your threshold, it posts the drop in Chat with the pages, devices and sources behind it, so a broken checkout or tag is caught the next day instead of at month end.
- 06
A tracking setup audit, with fixes you approve
Ask the agent to review a property's setup: data streams, key events, custom dimensions and metrics, and Google Ads links. It flags gaps, such as a purchase event that is not marked as a key event, and creates the missing key event or custom dimension once you approve it.
How it works
How Google Analytics 4 works with Wiro
- 01
Connect Google Analytics 4
Deploy an agent, open its Connectors tab, choose Google Analytics 4 and sign in with your Google Analytics 4 account.
- 02
Choose what each action may do
Set each Google Analytics 4 action to Allow, Ask or Block, in Chat and in Scheduled Tasks. By default, read-only actions run, and the rest ask first in Chat.
- 03
Ask in Chat or schedule it
Ask your agent for Google Analytics 4 work in Chat, or put it on a Scheduled Task that runs on its own.
- Where it runsInside your agent. Its requests go straight from the agent to Google Analytics 4.
- Where its data goes
analyticsdata.googleapis.comanalyticsadmin.googleapis.com - How it signs inSign in to Google Analytics 4 with your own app.
- AccountsAfter connecting, pick the Google Analytics properties the agent may work with. It cannot reach any other.
What it can do
Actions your Wiro agent can take in Google Analytics 4
By default, read-only actions run, and the rest ask first in Chat and run in Scheduled Tasks. Each agent can set any action to Allow, Ask or Block.
Read-only 7 actions
Looks things up in Google Analytics 4 and changes nothing.
| Action | What it does | Chat | Scheduled Tasks |
|---|---|---|---|
| List Google Analytics properties | Lists the GA4 properties the connected Google account can open, with their account: property ID, name, account name and account ID, and property type. | Allow | Allow |
| Run a Google Analytics report | Runs a GA4 report on one property: metrics by dimensions over up to 4 date ranges, with filters, ordering and totals. | Allow | Allow |
| Run a Google Analytics realtime report | Runs a GA4 realtime report on one property: activity in the last 30 minutes (up to 60 on GA4 360). | Allow | Allow |
| Run several Google Analytics reports | Runs up to 5 GA4 reports on one property in one call, each a RunReportRequest in the API's own JSON. | Allow | Allow |
| List Google Analytics dimensions and metrics | Lists the dimensions and metrics a GA4 property can report on, its custom definitions included: API name, UI name, category and, for metrics, the type. | Allow | Allow |
| Check Google Analytics dimension and metric compatibility | Tells whether dimensions and metrics can go in one GA4 report on a property, the usual cause of a refused report. | Allow | Allow |
| Read other Google Analytics 4 data | Reads what the actions above do not cover, straight from the Google Analytics 4 API. | Allow | Allow |
Change and delete 1 action
Changes or deletes what is already in Google Analytics 4.
| Action | What it does | Chat | Scheduled Tasks |
|---|---|---|---|
| Make other Google Analytics 4 changes | Sends any other change straight to the Google Analytics 4 API. | Ask | Allow |
How to connect
Connect Google Analytics 4 to Wiro
Open the agent's Connectors tab, choose Google Analytics 4 and sign in with your account. The consent screen shows what the agent can reach.
What the Connect dialog asks for
| Field | About |
|---|---|
| OAuth Client IDRequired |
|
| OAuth Client SecretRequired | Google shows the Client secret only once, in the dialog that opens when you create the client: copy it there, or click Download JSON to keep it in a file. After you close that dialog, Google never shows it again. If you no longer have it, open your client in Google Auth Platform → Clients, click Add secret and copy the new secret the same way. When nothing uses the old secret any more, Disable it and delete it. |
Troubleshooting
Troubleshooting Google Analytics 4
What to check when Google Analytics 4 stops working for your agent.
- Your own app's sign-in fails Check your app's settings in Google Analytics 4: the redirect URL shown in the Connect dialog must be added there, and the client secret you pasted must be the app's current one. Then sign in again.
- Access revoked in Google Analytics 4 If the access is removed in Google Analytics 4, or the sign-in can no longer renew, the connection reads Reconnect needed. Open the agent's Connectors tab, choose Google Analytics 4 and Reconnect.
- Limits set by Google Analytics 4 Google Analytics 4 limits how much an account can do, such as how many requests it takes in a minute. An action over a limit fails until the limit resets: wait and ask again, or check your Google Analytics 4 plan.
For developers
Connect Google Analytics 4 from your own product
Every call is a POST to the Wiro API with your project's API key. On a sign-in, your customers see your own app's name.
- 01
Read the connector
Detail answers without a session: what the connector needs and the tools it gives an agent.
POST /AgentConnector/Detail { "slug": "ga4" }Response { "result": true, "errors": [], "agentconnectors": [ { "slug": "ga4", "title": "Google Analytics 4", "category": "analytics", "authtype": "provider-oauth", "credentialfields": [ { "name": "clientid", "label": "OAuth Client ID", "required": true, "secret": false, "format": "text" }, { "name": "clientsecret", "label": "OAuth Client Secret", "required": true, "secret": true, "format": "password" } ], "accountpickers": [ { "key": "properties", "label": "Google Analytics properties", "multiple": true } ], "tools": [ { "name": "list_properties", "readonly": true }, { "name": "run_report", "readonly": true } ] } ] } - 02
Start the sign-in
Connect answers with the vendor's sign-in page. Open it in the browser of the person who owns the account.
POST /UserAgent/ConnectorConnect { "useragentguid": "YOUR_AGENT_GUID", "slug": "ga4", "mode": "oauth", "values": { "clientid": "YOUR_CLIENTID", "clientsecret": "YOUR_SECRET" }, "redirecturl": "https://your-app.example.com/connectors/return" }Response { "result": true, "errors": [], "status": "pending", "authorizeUrl": "https://vendor.example.com/oauth/authorize?client_id=...&state=..." } - 03
Come back to your page
After the consent screen the browser returns to your redirect URL with the outcome in its query. Read the status next; the query is only a reason to look.
Your redirect URL https://your-app.example.com/connectors/return?connector_connected=true https://your-app.example.com/connectors/return?connector_error=authorization_denied - 04
Read the status
connected, pending (a sign-in not finished), reauth (sign in again) or error. Values and tokens never come back.
POST /UserAgent/ConnectorList { "useragentguid": "YOUR_AGENT_GUID" }Response { "result": true, "errors": [], "useragentconnectors": [ { "slug": "ga4", "title": "Google Analytics 4", "authtype": "provider-oauth", "status": "connected", "accounts": {}, "savedvariables": [ "clientid", "clientsecret" ], "lasterror": null } ] } - 05
List the accounts
After connecting, list what the agent may use. It cannot reach anything else.
POST /UserAgent/ConnectorAccounts { "useragentguid": "YOUR_AGENT_GUID", "slug": "ga4" }Response { "result": true, "errors": [], "pickers": [ { "key": "properties", "label": "Google Analytics properties", "multiple": true, "candidates": [ { "id": "1234567890", "name": "Example account" } ], "selected": [] } ] } - 06
Save the accounts
Every id is checked against a fresh list, then the agent uses them, with no restart for most changes.
POST /UserAgent/ConnectorSetAccounts { "useragentguid": "YOUR_AGENT_GUID", "slug": "ga4", "accounts": { "properties": [ "1234567890" ] } }Response { "result": true, "errors": [], "restart": "scheduled" } - 07
Disconnect
Revokes a sign-in where the vendor allows it, deletes what the connection holds and removes the connector from the running agent.
POST /UserAgent/ConnectorDisconnect { "useragentguid": "YOUR_AGENT_GUID", "slug": "ga4" }Response { "result": true, "errors": [], "removed": true, "revoked": true, "restart": "scheduled" }
Questions
Google Analytics 4 and Wiro FAQ
What can a Google Analytics 4 AI agent do?
It runs GA4 reports on the properties you choose: metrics by dimensions over up to four date ranges, with filters, sorting and totals, or up to five reports in one call. It reads realtime activity, lists the dimensions and metrics a property offers, custom ones included, and checks which of them can share a report. It also reads property settings such as data streams, key events, custom definitions, audiences and Google Ads links, and can change them through an action that asks first in Chat by default.
How do I connect Google Analytics 4 to an AI agent?
Google Analytics 4 can be added from the Connectors tab of your agent, or the agent adds it when asked in Chat. The sign-in uses your own Google Cloud app: enable the Google Analytics Data API and Admin API in a project, add the analytics.readonly and analytics.edit scopes, make a Web application OAuth client whose redirect URI is the one in the Connect dialog, and copy its Client ID and Client Secret into the dialog. Then sign in with a Google account that can see your GA4 properties and pick the ones the agent may report on. Publish the app to In production, as Google ends sign-ins to apps in Testing after 7 days.
Can the agent change my GA4 settings?
Reports, realtime data and metadata never change anything. Settings changes, such as adding a key event or a custom dimension, go through one separate action, and in Chat it is held until you approve. A Scheduled Task may run it without a prompt, unless its Scheduled Tasks setting is Ask or Block, and blocking it in both places keeps the agent read-only.
Why can the agent's GA4 numbers differ from what I see in GA4?
For the same reasons two GA4 reports can differ: dates are read in the property's time zone, large reports can be sampled, and Google may hold back small numbers through data thresholds. Each report comes back with a note when sampling or thresholds applied, so the agent can say so, and it can check whether a dimension and a metric can be combined before running a report.
What limits does Google set on GA4 reports?
The Data API has quotas per property, with higher ones on Google Analytics 360. Realtime reports cover the last 30 minutes, or 60 on GA4 360, a report can compare up to four date ranges and a batch holds up to five reports. When a property's quota is used up, Google refuses further reports until it refills, so spread a Scheduled Task with many reports across the day.
Where are my Google tokens kept, and is there a cost?
The Google tokens held for GA4 are encrypted, and the AI model never receives them; your Client ID and Secret only serve the sign-in. The connector is included at no extra cost in every agent plan, and Google bills nothing for Analytics Data and Admin API calls.
Is there a GA4 MCP server to install?
No. GA4 reporting works from inside your agent through Google's own Analytics APIs, so nothing needs installing. To automate GA4 reports, ask the agent to set up a Scheduled Task, for example a Monday summary. The agent reaches only the properties you chose, and Choose Accounts changes them later.
Access
Revoke Google Analytics 4 access
Remove the app's access in your Google Analytics 4 account's connected apps settings, then disconnect it here.
Related connectors
More analytics connectors for your Wiro agent
Google Search ConsoleSearch performance, sitemaps and URL inspection for your sites.
RevenueCatSubscription revenue, MRR, churn and charts from RevenueCat.
RoasitCreative-level ROAS and attribution from Roasit.
AdaptySubscription analytics for mobile apps: revenue, conversion, retention and cohorts.
AdjustMobile attribution and campaign KPIs from Adjust: installs, events, cohorts and creative…
Put Google Analytics 4 to work with Wiro
Deploy an agent and connect Google Analytics 4 from its Connectors tab. Every agent plan includes it: Starter $5, Pro $30 and Max $100 a month.