Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.mavera.io/llms.txt

Use this file to discover all available pages before exploring further.

Google Analytics 4 holds your audience truth — who visits, where they come from, what they do, and where they drop off. These seven jobs pull that data through Mavera’s surfaces (Custom Personas, Mave Agent, Focus Groups, Generate) so your personas, content, and creative are grounded in real behavioral data instead of assumptions.

API Reference Card

DetailValue
Base URLhttps://analyticsdata.googleapis.com/v1beta
AuthOAuth 2.0 via service account (GOOGLE_APPLICATION_CREDENTIALS JSON key file)
Rate limits50,000 requests/project/day; 10 concurrent requests/property
Python clientgoogle-analytics-data — official GA4 Data API client
Mavera basehttps://app.mavera.io/api/v1
Mavera authAuthorization: Bearer mvra_live_...
All examples use three environment variables: GOOGLE_APPLICATION_CREDENTIALS (path to service account JSON), GA4_PROPERTY_ID (numeric property ID, e.g. 123456789), and MAVERA_API_KEY. Python examples use the google-analytics-data client library; JavaScript examples use the REST API directly with a service account access token.

Prerequisites

1

GA4 property with data

You need an active GA4 property with at least 30 days of traffic. Find the property ID in GA4 → Admin → Property Settings.
2

Service account with GA4 access

Create a service account in Google Cloud, download the JSON key, then add the service account email as a Viewer in GA4 → Admin → Property Access Management.
3

Enable the Analytics Data API

In Google Cloud Console, navigate to APIs & Services → Enable the Google Analytics Data API.
4

Install dependencies

pip install google-analytics-data requests
5

Environment variables

export GOOGLE_APPLICATION_CREDENTIALS="/path/to/service-account.json"
export GA4_PROPERTY_ID="123456789"
export MAVERA_API_KEY="mvra_live_xxxxx"

Jobs

#JobGA4 DataMavera SurfaceOutput
1Audience Demographics → Persona CreationRunReport: age, gender, country, device, conversionsCustom PersonasHigh-value intersection personas
2Interest Category → Content StrategyInterests dimension reportMave AgentContent plan bridging product + interests
3Conversion Path → Focus Group ValidationFunnel report with step drop-offFocus GroupsPersona feedback on drop-off points
4Landing Page Performance → Content RefreshTop landing pages with bounce + engagementGenerateAudience-specific copy rewrites
5Real-Time Audience → Trending ResponseReal-time active users by page/sourceMave AgentSpike diagnosis + response plan
6Acquisition Channel × Persona MappingSession source/medium × demographicsCustom PersonasChannel-demographic persona map
7Device Behavior → Creative Format RecommendationsDevice category, resolution, engagementMave AgentFormat adjustments per device

Rate Limits & Production Notes

GA4 API EndpointLimitStrategy
RunReport10 concurrent per property; 50,000/dayQueue reports; use date range caching
RunRealtimeReportSame quota poolPoll at max 1/minute for dashboards
RunFunnelReportSame quota poolCache results; funnels rarely need real-time refresh
The GA4 Data API enforces 10 concurrent requests per property. If you run jobs 1–7 in parallel, you’ll exceed this limit. Run sequentially or batch with 300ms delays. Retry on 429 with exponential backoff.
Production checklist:
ConcernRecommendation
Service account key rotationRotate keys every 90 days via Google Cloud IAM. Store in a secrets manager, never in code.
Date rangesAlways use relative ranges (30daysAgo) for scheduled jobs. Absolute dates risk stale data.
Data freshnessStandard GA4 properties have 24–48h processing delay for non-real-time reports. Real-time reports cover the last 30 minutes only.
SamplingReports over 10M events may be sampled. Use shorter date ranges or the GA4 BigQuery export for unsampled data.
Mavera creditsMonitor at Dashboard. Mave chat calls consume credits proportional to prompt length.
ThresholdingGA4 redacts rows with small user counts to protect privacy. If critical segments are missing, reduce dimension cardinality or extend date ranges.

What’s Next

All Integrations

50+ API integrations with full code

GA4 Data API Docs

Official GA4 Data API reference

Personas API

Full reference for POST /api/v1/personas

Focus Groups API

Full reference for POST /api/v1/focus-groups

Mave Agent

Full reference for POST /api/v1/mave/chat

Generate API

Full reference for POST /api/v1/generations