Analyze which audience segments each active Intelligems experiment is winning in. Shows device type, visitor type, and traffic source breakdowns with confidence levels. Use when you want to see segment-level performance of A/B tests.
npx playbooks add skill victorpay1/intelligems-plugins --skill intelligems-segment-analysis
Analyze segment-level performance of active Intelligems experiments.
Shows which segments (device, visitor type, traffic source) each experiment is winning in, with:
---
---
Ask the user for their Intelligems API key.
If they don't provide it upfront, ask:
> "What's your Intelligems API key? You can get one by contacting support@intelligems.io"
IMPORTANT: Never use a hardcoded or default API key. The user must provide their own.
---
Create a project directory with the analysis script:
mkdir -p intelligems-segment-analysis
cd intelligems-segment-analysis
Copy from references/config.py:
# Intelligems Segment Analysis Configuration
# API Configuration
API_BASE = "https://api.intelligems.io/v25-10-beta"
# Thresholds (Intelligems Philosophy: 80% is enough)
MIN_CONFIDENCE = 0.80 # 80% probability to beat baseline
MIN_RUNTIME_DAYS = 14 # Don't make status judgments until test runs 2+ weeks
# Segment types to analyze
SEGMENT_TYPES = [
("device_type", "BY DEVICE"),
("visitor_type", "BY VISITOR TYPE"),
("source_channel", "BY TRAFFIC SOURCE"),
]
Copy the full script from references/segment_analysis.py.
Create .env file with the user's API key:
INTELLIGEMS_API_KEY=<user's key here>
pip install requests python-dotenv tabulate
---
python segment_analysis.py
---
Status meanings:
Example output:
======================================================================
Homepage Price Test
Runtime: 21 days | Visitors: 45,000 | Orders: 320
======================================================================
📱 BY DEVICE
╭─────────┬──────────┬────────┬───────────┬─────────────┬──────────┬────────────╮
│ Segment │ Visitors │ Orders │ Variation │ Status │ RPV Lift │ Confidence │
├─────────┼──────────┼────────┼───────────┼─────────────┼──────────┼────────────┤
│ Mobile │ 32,000 │ 180 │ +5% │ Doing well │ +12.3% │ 87% │
│ Desktop │ 13,000 │ 140 │ +5% │ Inconclusive│ +4.2% │ 62% │
╰─────────┴──────────┴────────┴───────────┴─────────────┴──────────┴────────────╯
This shows the +5% price variant is winning on mobile (87% confidence) but inconclusive on desktop.
---
"INTELLIGEMS_API_KEY not found"
.env file exists with the keyexport INTELLIGEMS_API_KEY=your_key"No active experiments found"
"Error fetching experiments"
---
references/segment_analysis.py - Full analysis scriptreferences/config.py - Configuration filereferences/setup-guide.md - Detailed setup instructionsWeekly roundup of top Claude Code skills, MCP servers, and AI coding tips.