@this-npm-test-org/connection-ga4
v0.1.3
Published
Web analytics: sessions, page views, conversions, user behavior, and real-time data.
Readme
Google Analytics 4 Connection
Connects your agent to Google Analytics 4 for web analytics data. Pull session data, page views, conversion metrics, traffic sources, and user behavior reports. Read-only access via the GA4 Data API.
Authentication
OAuth2 or service account.
client_email— Service account emailprivate_key— Service account private key (JSON keyfile)property_id— GA4 property ID (numeric)
Endpoints
Reports
POST /v1beta/{property}/runReport— Run custom report with dimensions and metricsPOST /v1beta/{property}/batchRunReports— Run multiple reports in one requestPOST /v1beta/{property}/runRealtimeReport— Get real-time active users and events
Metadata
GET /v1beta/{property}/metadata— List available dimensions and metrics
Audiences
GET /v1alpha/{property}/audiences— List configured audiences with user counts
Rules
- Rate limit: 10 requests/second per property
- The agent builds report requests from natural language — dimensions and metrics mapped automatically
- Date ranges default to last 28 days unless specified
- Large reports (>10K rows) are sampled — the agent notes when data is sampled
- Real-time data has a 1-2 minute delay
