ga4_list_accounts_properties
Google Analytics 4 read low risk
Part of the GA4 Analytics Agent.
What it does
List every Google Analytics 4 account and property the connected Google account can see (Analytics Admin API v1beta accountSummaries.list, all pages): each account's id and name with its properties' id, name and type. With several Google logins connected, the list is the union of every login that has Google Analytics access, without duplicates; a login that cannot be read is named as 'Google login N' in the warnings (never by email). Optional search keeps only accounts or properties whose name contains the text (case-insensitive), so a client's property can be found by its brand name. Read-only. Returns {accounts:[{account_id, display_name, properties:[{property_id, display_name, property_type}]}], account_count, property_count}. Use it whenever the user names a client, site or brand but not a GA4 property id.
When to use it
Use first whenever a GA4 question names a client, site or brand but no property id: list the accounts and properties (search by name), confirm the right one with the user if several match, then run ga4_run_report with its property_id.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
search | string | no | Optional text to find in account or property names (e.g. the client's brand). |
Safeguards
Policy
GA4 is a separate Google product, scope and property from Google Ads: read only what the connected Google account is authorized to see (analytics.readonly), never another tenant's properties, and never merge GA4 figures with Google Ads figures without labeling each.
Reminder
Show only properties the connected account can see; if a login could not be read, say so instead of presenting the list as complete.
Errors
| Error class | Means | What to do | Retry |
|---|---|---|---|
platform_unavailable | The Google Analytics Admin API is not switched on for Scalix yet. | Tell the user it is on Scalix's side; meanwhile ask them for the GA4 property id (GA4 Admin -> Property settings) and use the ga4_run_* tools with it. | no |
needs_reauth | The Google connection's token is dead, or it was made before Scalix asked for Google Analytics. | Reconnect Google in the Scalix dashboard and accept the Google Analytics permission. | no |
rate_limited | Google Analytics rate limit hit. | Wait a minute, then call again. | yes |
Edge cases
- A Google account with no Analytics access returns an empty list, not an error.
- If search matches nothing, call again without it and show the user the names.
- Several properties can share a brand name (staging, old Universal-era names): ask which one.