Skip to main content

Scenario

Different channels attract different people — your organic search visitors behave differently than your paid social visitors. You pull sessionSource and sessionMedium crossed with userAgeBracket and userGender, then map each channel-demographic pair to a Mavera persona. The result is a persona library where each entry represents a specific channel-audience intersection, enabling channel-specific messaging.

Architecture

Code

Example Output

Error Handling

Crossing 4 dimensions can produce thousands of rows. The code caps at 500 rows and filters out (not set). For large properties, consider running separate reports per channel.
Direct traffic includes bookmarks, typed URLs, and unattributable sources. It often has the largest volume but least actionable demographic data. Consider separating it from other channels.
If sources show as (not set), your campaigns may lack UTM parameters. Add utm_source, utm_medium, and utm_campaign to all marketing links.

What’s Next

GA4 Integration

Back to GA4 integration overview

Real-Time Audience → Trending Response

Diagnose traffic spikes in real time

Device Behavior → Creative Format Recommendations

Optimize creative formats per device

Personas API

Full reference for POST /api/v1/personas