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

Your G2 satisfaction score, implementation score, and category rankings fluctuate quarterly. When scores change, your messaging should adapt — leaning into strengths and addressing emerging weaknesses. You pull your latest G2 scores and compare them to previous periods and competitors, then use Mave to generate updated positioning recommendations. Flow: G2 GET /products/{id} + category data → Score trends → Mavera POST /mave/chat → Messaging adjustment recommendations

Code

import os, requests, time

G2 = os.environ["G2_API_KEY"]
MV = os.environ["MAVERA_API_KEY"]
G2_BASE = "https://data.g2.com/api/v1"
G2_H = {"Authorization": f"Token token={G2}", "Content-Type": "application/vnd.api+json"}
MV_H = {"Authorization": f"Bearer {MV}", "Content-Type": "application/json"}

# 1. Pull product scores (replace with your product ID)
PRODUCT_ID = "your-product-id"
product = requests.get(f"{G2_BASE}/products/{PRODUCT_ID}",
    headers=G2_H).json().get("data", {})
attrs = product.get("attributes", {})

scores = {
    "satisfaction": attrs.get("satisfaction_score", 0),
    "market_presence": attrs.get("market_presence_score", 0),
    "implementation": attrs.get("implementation_score", 0),
    "results": attrs.get("results_score", 0),
    "review_count": attrs.get("review_count", 0),
    "avg_rating": attrs.get("average_rating", 0),
}

# 2. Pull competitor scores for comparison
COMPETITOR_IDS = ["comp-a-id", "comp-b-id", "comp-c-id"]
comp_scores = []
for cid in COMPETITOR_IDS:
    r = requests.get(f"{G2_BASE}/products/{cid}", headers=G2_H)
    if r.status_code == 200:
        ca = r.json().get("data", {}).get("attributes", {})
        comp_scores.append({
            "name": ca.get("name", "Unknown"),
            "satisfaction": ca.get("satisfaction_score", 0),
            "market_presence": ca.get("market_presence_score", 0),
            "avg_rating": ca.get("average_rating", 0),
            "review_count": ca.get("review_count", 0),
        })
    time.sleep(0.1)

# 3. Simulate historical trend (in production, store and compare)
previous_scores = {
    "satisfaction": scores["satisfaction"] - 3,
    "market_presence": scores["market_presence"] + 2,
    "implementation": scores["implementation"] - 1,
}

# 4. Mave positioning analysis
score_block = "\n".join(f"- {k}: {v}" for k, v in scores.items())
comp_block = "\n".join(
    f"- {c['name']}: Satisfaction={c['satisfaction']}, Presence={c['market_presence']}, Rating={c['avg_rating']}, Reviews={c['review_count']}"
    for c in comp_scores
)
trend_block = "\n".join(
    f"- {k}: {previous_scores[k]}{scores[k]} ({'+' if scores[k]>previous_scores[k] else ''}{scores[k]-previous_scores[k]})"
    for k in previous_scores
)

analysis = requests.post("https://app.mavera.io/api/v1/mave/chat",
    headers=MV_H,
    json={"message": f"""Analyze our G2 market position and recommend messaging adjustments.

OUR SCORES:
{score_block}

COMPETITOR COMPARISON:
{comp_block}

SCORE TRENDS (previous → current):
{trend_block}

Produce:
1. Position summary (leader/contender/niche/high performer quadrant)
2. Strengths to amplify in messaging (where we beat competitors)
3. Weaknesses to address (where competitors beat us)
4. Specific messaging updates (what to say differently this quarter)
5. Review generation strategy (how to improve review volume and scores)
6. Competitive talking points for sales"""}).json()

print("=== G2 Market Positioning Analysis ===")
print(analysis.get("content", "")[:2000])

Example Output

=== G2 Market Positioning Analysis ===

## Position: High Performer (moving toward Leader)
Satisfaction: 89 (top 10% in category). Market Presence: 42 (below leader threshold of 60).
Gap: Need 50+ more reviews and enterprise logos to reach Leader quadrant.

## Strengths to Amplify
- Satisfaction score 89 vs CompetitorA's 76 — "Highest-rated in category on G2"
- Implementation score rising (+3) — "Fastest time-to-value in our category"
- Average rating 4.7 vs category avg 4.2 — "4.7/5 on G2 — rated by real users"

## Weaknesses to Address
- Market Presence 42 vs CompetitorA's 78 — they have 3x our review volume
- Implementation dropped 1pt — investigate onboarding complaints

## Messaging Updates This Quarter
- Homepage: Add G2 badge + "Highest satisfaction score in category"
- Sales decks: Replace old competitor comparison with current G2 data
- Email signatures: "Rated 4.7/5 on G2 | 200+ reviews"
- Paid ads: Test "G2 High Performer" badge in creative

## Review Generation Strategy
- In-app prompt after positive NPS (7+) → G2 review link
- CSM ask after successful QBR → "Would you share your experience on G2?"
- Target: 50 new reviews this quarter to cross Leader threshold

Error Handling

Find your G2 product ID via GET /products?filter[name]=YourProduct or from your G2 admin dashboard URL.
Not all products have all score types. Newer products may lack satisfaction_score until they reach the minimum review threshold (typically 10+).
G2 API doesn’t provide historical scores. Store scores in your database on a weekly/monthly schedule to build trend data.