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.

Scenario

GA4 captures user interests based on browsing behavior — categories like “Technology/Software”, “Business/Finance”, “Travel/Adventure”. You pull an interest category report, identify the top affinity categories among your visitors, and send them to Mave with the instruction to research content opportunities that bridge your product with those interests. The result is a content strategy that meets your audience where they already spend attention.

Architecture

Code

import os, requests
from google.analytics.data_v1beta import BetaAnalyticsDataClient
from google.analytics.data_v1beta.types import (
    RunReportRequest, Dimension, Metric, DateRange, OrderBy,
)

PROPERTY_ID = os.environ["GA4_PROPERTY_ID"]
MV = os.environ["MAVERA_API_KEY"]

client = BetaAnalyticsDataClient()

affinity_report = client.run_report(RunReportRequest(
    property=f"properties/{PROPERTY_ID}",
    dimensions=[Dimension(name="brandingInterest")],
    metrics=[
        Metric(name="totalUsers"),
        Metric(name="sessions"),
        Metric(name="engagementRate"),
        Metric(name="conversions"),
    ],
    date_ranges=[DateRange(start_date="30daysAgo", end_date="today")],
    order_bys=[OrderBy(metric=OrderBy.MetricOrderBy(metric_name="totalUsers"), desc=True)],
    limit=30,
))

interests = []
for row in affinity_report.rows:
    cat = row.dimension_values[0].value
    if cat == "(not set)":
        continue
    interests.append({
        "category": cat,
        "users": int(row.metric_values[0].value),
        "sessions": int(row.metric_values[1].value),
        "engagement": float(row.metric_values[2].value),
        "conversions": int(row.metric_values[3].value),
    })

total_users = sum(i["users"] for i in interests) or 1

interest_block = "\n".join(
    f"- {i['category']}: {i['users']} users ({i['users']/total_users:.0%}), "
    f"engagement: {i['engagement']:.1%}, conv: {i['conversions']}"
    for i in interests[:20]
)

PRODUCT_CONTEXT = "B2B marketing intelligence platform that helps teams create personas, run focus groups, and generate brand-aligned content."

mave = requests.post(
    "https://app.mavera.io/api/v1/mave/chat",
    headers={"Authorization": f"Bearer {MV}", "Content-Type": "application/json"},
    json={"message": f"""Research content opportunities that bridge our product with our audience's interests.

OUR PRODUCT: {PRODUCT_CONTEXT}

AUDIENCE INTEREST CATEGORIES (from GA4, last 30 days):
{interest_block}

For each promising interest-product intersection:
1. Why this interest category connects to our product
2. Content angle (blog, webinar, case study, social series, etc.)
3. Suggested title and hook
4. Target keyword themes
5. Which existing interest group this serves

Prioritize intersections with high engagement rate AND conversion potential.
Group into 3 tiers: immediate opportunities, medium-term content, and long-tail experiments."""},
).json()

print("--- Interest-Based Content Strategy ---")
print(mave.get("content", "")[:3000])
print(f"\nSources: {len(mave.get('sources', []))}")

Example Output

--- Interest-Based Content Strategy ---

## Tier 1: Immediate Opportunities

### Technology/Software × Persona Intelligence
Your audience already thinks in terms of tech tooling.
→ Blog: "How AI Personas Replace 6 Months of User Research"
→ Keywords: AI persona tools, synthetic user research, automated focus groups

### Business/Finance × ROI-Driven Content
High conversion rate (3.2%) — these users evaluate tools on ROI.
→ Case study: "How [Company] Cut Content Testing Costs by 70% with Synthetic Personas"
→ Webinar: "The CFO's Guide to AI-Powered Market Research"

## Tier 2: Medium-Term Content

### Marketing/Advertising × Brand Voice
Natural overlap — your audience runs campaigns daily.
→ Series: "Brand Voice Extraction: From 50 Blog Posts to a Consistent Voice in 10 Minutes"
→ Keywords: brand voice AI, content consistency tools

## Tier 3: Long-Tail Experiments

### Travel/Adventure × Remote Research
Surprising interest category with 12% of users, 1.8% engagement rate.
→ Angle: "How Remote-First Teams Run Focus Groups Without Flying Anywhere"

Sources: 4

Error Handling

The brandingInterest dimension requires Google Signals to be enabled in GA4 → Admin → Data Settings → Data Collection. Without it, all values return (not set).
Smaller properties (under 10k monthly users) may have too few classified users for meaningful interest data. Extend the date range to 90 days for better coverage.

What’s Next

GA4 Integration

Back to GA4 integration overview

Audience Demographics → Persona Creation

Create personas from GA4 demographic data

Conversion Path → Focus Group Validation

Validate funnel drop-offs with focus groups

Mave Agent

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