Skip to main content

Scenario

Your GA4 property has thousands of converting visitors segmented by age, gender, country, and device — but your personas are based on gut feel. You pull a RunReport crossing userAgeBracket, userGender, country, and deviceCategory with conversion metrics, identify the top-performing demographic intersections, and create a Mavera Custom Persona for each. The result is a persona library calibrated to your actual converting audience.

Architecture

Code

Example Output

Error Handling

GA4 can’t classify all users by age/gender — especially those without Google sign-in. The code filters these out. Expect 20–40% of traffic to be unclassified.
GA4 applies thresholding to protect user privacy. Small segments may be hidden. Widen your date range or reduce dimension cardinality to get more data.
50,000 requests/day is generous, but bursts of 10+ concurrent requests hit the per-property limit. Add 300ms delays between calls and retry on 429 with exponential backoff.
If you get 403 PERMISSION_DENIED, verify the service account email is added as a Viewer (or higher) in GA4 → Admin → Property Access Management.

What’s Next

GA4 Integration

Back to GA4 integration overview

Interest Category → Content Strategy

Build a content plan from audience interests

Personas API

Full reference for POST /api/v1/personas

Mave Agent

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