# Google Analytics (GA4)

> Read GA4 reports via OAuth.

Lets an agent read GA4 property summaries and run Analytics reports.

## What it can do

| Method | What it does |
| --- | --- |
| `analytics_list_property_summaries` | List GA4 properties accessible to the connected account. |
| `analytics_run_report` | Run a GA4 Data API report - property_id, dates, and dimension/metric API names. |

## How to get credentials

Google OAuth - no token to copy.

1. Start setup and enter the Google email that has GA access.
2. Approve (`analytics.readonly`).

`property_id` comes from the GA4 admin panel - the numeric ID under
**Property Settings**.

## Fields to fill in FlyMyAI

| FlyMyAI field | Where it comes from |
| --- | --- |
| `USER_GOOGLE_EMAIL` | The Google account with GA access |

## Troubleshooting

- **Property not in `list_property_summaries`** - your account isn't
  added to that GA4 property. Ask the property admin to grant *Viewer*.
- **Metric/dimension not accepted** - pass the API name (e.g.
  `activeUsers`), not the UI label.

## Links

- [GA4 API reference](https://developers.google.com/analytics/devguides/reporting/data/v1/rest)
