Keitaro — Tracker Management for Affiliate Marketers
Full Keitaro tracker control via natural language. Manage campaigns, flows,
landings, reports, and optimization through the Admin API.
Quick Reference
| Command |
What it does |
/keitaro setup |
Connect to Keitaro API, verify access, save config |
/keitaro campaigns |
Create/list/update/delete campaigns |
/keitaro flows |
Manage traffic flows, weights, filters, A/B tests |
/keitaro reports |
Analytics: ROI, CR, EPC by campaign/flow/landing/geo/device |
/keitaro optimize |
Auto-optimize: kill losers, scale winners, rebalance weights |
/keitaro landing |
Generate landing/prelanding content for any vertical |
/keitaro audit |
Audit campaign setup: dead flows, broken postbacks, misconfig |
Context Intake (Required — Always Do This First)
Before any operation, ensure Keitaro API connection is configured.
Check for KEITARO_URL and KEITARO_API_KEY environment variables.
If not set, run /keitaro setup first.
Ask these questions upfront if not already known:
- Vertical — What are you running? Gambling, Crypto, Nutra, Dating, Finance,
Sweepstakes, E-commerce, Health/Medical, Insurance, Software, Other
- GEOs — Target countries
- Traffic source — Where traffic comes from (Facebook, Google, TikTok, Push, Pop, Native, SEO)
- Goal — What metric matters most? ROI, CR, EPC, Revenue, Volume
If the user provides context upfront (e.g. "create campaign for gambling DE"),
extract it and proceed without re-asking.
API Connection
All API calls go through the Keitaro Admin API:
Base URL: {KEITARO_URL}/admin_api/v1
Headers: Api-Key: {KEITARO_API_KEY}
Use the scripts/keitaro_api.py helper for all API operations.
Run via: python3 ~/.claude/skills/keitaro/scripts/keitaro_api.py <action> [args]
Orchestration Logic
When the user invokes /keitaro:
- Check API connection — verify KEITARO_URL and KEITARO_API_KEY are set
- Parse command — route to appropriate sub-skill
- Collect context — vertical, GEO, traffic source if needed
- Execute — call Keitaro API via helper script
- Report — show results in clean, readable format
For /keitaro audit, spawn subagents in parallel:
- campaign-analyzer — analyze campaign performance across all campaigns
- flow-optimizer — check flow health, dead landings, weight distribution
Reference Files
Load on-demand as needed — do NOT load all at startup.
Path resolution: All references are installed at ~/.claude/skills/keitaro/references/.
references/keitaro-api.md — Full Admin API reference (endpoints, methods, params)
references/verticals.md — Vertical-specific benchmarks (CR, EPC, ROI targets by vertical+GEO)
references/optimization-rules.md — Kill rules, scaling rules, weight distribution logic
references/landing-specs.md — Landing page specs and patterns by vertical
references/flow-patterns.md — Common flow patterns (white/offer, A/B, geo-split, device-split)
Safety System
The API helper has built-in safety at 3 levels:
Level 1: Dry Run Mode
Always use --dry-run first when unsure about an operation.
It shows exactly what API calls would be made without executing them.
python3 ~/.claude/skills/keitaro/scripts/keitaro_api.py --dry-run campaign disable --id 12
Level 2: Automatic Snapshots
Before any destructive operation (disable, delete, update stream), the script
automatically saves a JSON snapshot of the current state to ~/.claude/keitaro-snapshots/.
This allows manual rollback if something goes wrong.
Level 3: Live Traffic Detection
Before modifying a campaign or stream, the script checks for recent traffic.
If clicks were detected in the last 24h, it prints a warning:
[SAFETY] WARNING: Campaign #12 has LIVE TRAFFIC!
[SAFETY] Last 24h: 5,432 clicks, $271.60 spent
[SAFETY] Modifying this campaign may affect active traffic.
Level 4: Last-Flow Protection
Disabling the only active flow in a campaign is BLOCKED by default.
This prevents accidentally killing all traffic to a campaign.
Use --force to override (you must explicitly confirm).
Quality Gates
Hard rules — never violate these:
- ALWAYS use
--dry-run first for any destructive operation you're not 100% sure about
- Never delete a campaign without explicit user confirmation
- Never change flows on campaigns with active traffic without warning the user first
- Kill Rule: flag any flow/landing with ROI < -30% over 100+ clicks for pause
- Scale Rule: flows with ROI > 30% over 200+ clicks are candidates for weight increase
- Always verify postback URL is configured before marking campaign as ready
- Never expose API key in outputs or logs
- Always show estimated impact before bulk operations ("this will affect X campaigns")
- Never disable the last active flow in a campaign (blocks traffic completely)
- For bulk operations (more than 3 items), always run
--dry-run first, show output to user, then execute
Optimization Thresholds
Default thresholds (user can override):
| Metric |
Kill |
Warning |
Good |
Scale |
| ROI |
< -30% |
-30% to 0% |
0% to 30% |
> 30% |
| CR |
< 0.5% |
0.5% to 1% |
1% to 3% |
> 3% |
| EPC |
< $0.05 |
$0.05-0.15 |
$0.15-0.50 |
> $0.50 |
| Min clicks for decision |
100 |
— |
— |
200 |
These vary by vertical — load references/verticals.md for vertical-specific thresholds.
Sub-Skills
This skill orchestrates 7 specialized sub-skills:
- keitaro-setup — API connection and initial configuration
- keitaro-campaigns — Campaign CRUD operations
- keitaro-flows — Flow and traffic distribution management
- keitaro-reports — Analytics and reporting
- keitaro-optimize — Auto-optimization engine
- keitaro-landing — Landing page generation and management
- keitaro-audit — Campaign health audit
Output Format
All reports follow this structure:
## [Report Title]
**Period:** [date range]
**Campaigns analyzed:** [count]
### Summary
[Key findings in 2-3 bullets]
### Details
[Tables with metrics]
### Actions
- [Prioritized action items with expected impact]
1---2name: keitaro3description: Keitaro tracker management for affiliate marketers and media buyers. Manage campaigns, flows, landings, reports, and optimization via natural language through Keitaro Admin API. Supports all verticals: gambling, crypto, nutra, dating, finance, sweepstakes, e-commerce. Triggers on: keitaro, tracker, campaigns, flows, landings, TDS, traffic distribution, affiliate tracking, media buying, postback, conversion tracking, ROI optimization, split test.4license: MIT5---6
7# Keitaro — Tracker Management for Affiliate Marketers
8
9Full Keitaro tracker control via natural language. Manage campaigns, flows,
10landings, reports, and optimization through the Admin API.
11
12## Quick Reference
13
14| Command | What it does |
15|---------|-------------|
16| `/keitaro setup` | Connect to Keitaro API, verify access, save config |
17| `/keitaro campaigns` | Create/list/update/delete campaigns |
18| `/keitaro flows` | Manage traffic flows, weights, filters, A/B tests |
19| `/keitaro reports` | Analytics: ROI, CR, EPC by campaign/flow/landing/geo/device |
20| `/keitaro optimize` | Auto-optimize: kill losers, scale winners, rebalance weights |
21| `/keitaro landing` | Generate landing/prelanding content for any vertical |
22| `/keitaro audit` | Audit campaign setup: dead flows, broken postbacks, misconfig |
23
24## Context Intake (Required — Always Do This First)
25
26Before any operation, ensure Keitaro API connection is configured.
27Check for `KEITARO_URL` and `KEITARO_API_KEY` environment variables.
28
29If not set, run `/keitaro setup` first.
30
31Ask these questions upfront if not already known:
32
331. **Vertical** — What are you running? Gambling, Crypto, Nutra, Dating, Finance,
34 Sweepstakes, E-commerce, Health/Medical, Insurance, Software, Other
352. **GEOs** — Target countries
363. **Traffic source** — Where traffic comes from (Facebook, Google, TikTok, Push, Pop, Native, SEO)
374. **Goal** — What metric matters most? ROI, CR, EPC, Revenue, Volume
38
39If the user provides context upfront (e.g. "create campaign for gambling DE"),
40extract it and proceed without re-asking.
41
42## API Connection
43
44All API calls go through the Keitaro Admin API:
45
46```
47Base URL: {KEITARO_URL}/admin_api/v1
48Headers: Api-Key: {KEITARO_API_KEY}
49```
50
51Use the `scripts/keitaro_api.py` helper for all API operations.
52Run via: `python3 ~/.claude/skills/keitaro/scripts/keitaro_api.py <action> [args]`
53
54## Orchestration Logic
55
56When the user invokes `/keitaro`:
57
581. **Check API connection** — verify KEITARO_URL and KEITARO_API_KEY are set
592. **Parse command** — route to appropriate sub-skill
603. **Collect context** — vertical, GEO, traffic source if needed
614. **Execute** — call Keitaro API via helper script
625. **Report** — show results in clean, readable format
63
64For `/keitaro audit`, spawn subagents in parallel:
65- **campaign-analyzer** — analyze campaign performance across all campaigns
66- **flow-optimizer** — check flow health, dead landings, weight distribution
67
68## Reference Files
69
70Load on-demand as needed — do NOT load all at startup.
71
72**Path resolution:** All references are installed at `~/.claude/skills/keitaro/references/`.
73
74- `references/keitaro-api.md` — Full Admin API reference (endpoints, methods, params)
75- `references/verticals.md` — Vertical-specific benchmarks (CR, EPC, ROI targets by vertical+GEO)
76- `references/optimization-rules.md` — Kill rules, scaling rules, weight distribution logic
77- `references/landing-specs.md` — Landing page specs and patterns by vertical
78- `references/flow-patterns.md` — Common flow patterns (white/offer, A/B, geo-split, device-split)
79
80## Safety System
81
82The API helper has built-in safety at 3 levels:
83
84### Level 1: Dry Run Mode
85**Always use `--dry-run` first** when unsure about an operation.
86It shows exactly what API calls would be made without executing them.
87```bash
88python3 ~/.claude/skills/keitaro/scripts/keitaro_api.py --dry-run campaign disable --id 12
89```
90
91### Level 2: Automatic Snapshots
92Before any destructive operation (disable, delete, update stream), the script
93automatically saves a JSON snapshot of the current state to `~/.claude/keitaro-snapshots/`.
94This allows manual rollback if something goes wrong.
95
96### Level 3: Live Traffic Detection
97Before modifying a campaign or stream, the script checks for recent traffic.
98If clicks were detected in the last 24h, it prints a warning:
99```
100[SAFETY] WARNING: Campaign #12 has LIVE TRAFFIC!
101[SAFETY] Last 24h: 5,432 clicks, $271.60 spent
102[SAFETY] Modifying this campaign may affect active traffic.
103```
104
105### Level 4: Last-Flow Protection
106Disabling the **only active flow** in a campaign is BLOCKED by default.
107This prevents accidentally killing all traffic to a campaign.
108Use `--force` to override (you must explicitly confirm).
109
110## Quality Gates
111
112Hard rules — never violate these:
113
114- **ALWAYS use `--dry-run` first** for any destructive operation you're not 100% sure about
115- Never delete a campaign without explicit user confirmation
116- Never change flows on campaigns with active traffic without warning the user first
117- Kill Rule: flag any flow/landing with ROI < -30% over 100+ clicks for pause
118- Scale Rule: flows with ROI > 30% over 200+ clicks are candidates for weight increase
119- Always verify postback URL is configured before marking campaign as ready
120- Never expose API key in outputs or logs
121- Always show estimated impact before bulk operations ("this will affect X campaigns")
122- **Never disable the last active flow** in a campaign (blocks traffic completely)
123- For bulk operations (more than 3 items), always run `--dry-run` first, show output to user, then execute
124
125## Optimization Thresholds
126
127Default thresholds (user can override):
128
129| Metric | Kill | Warning | Good | Scale |
130|--------|------|---------|------|-------|
131| ROI | < -30% | -30% to 0% | 0% to 30% | > 30% |
132| CR | < 0.5% | 0.5% to 1% | 1% to 3% | > 3% |
133| EPC | < $0.05 | $0.05-0.15 | $0.15-0.50 | > $0.50 |
134| Min clicks for decision | 100 | — | — | 200 |
135
136These vary by vertical — load `references/verticals.md` for vertical-specific thresholds.
137
138## Sub-Skills
139
140This skill orchestrates 7 specialized sub-skills:
141
1421. **keitaro-setup** — API connection and initial configuration
1432. **keitaro-campaigns** — Campaign CRUD operations
1443. **keitaro-flows** — Flow and traffic distribution management
1454. **keitaro-reports** — Analytics and reporting
1465. **keitaro-optimize** — Auto-optimization engine
1476. **keitaro-landing** — Landing page generation and management
1487. **keitaro-audit** — Campaign health audit
149
150## Output Format
151
152All reports follow this structure:
153
154```markdown
155## [Report Title]
156**Period:** [date range]
157**Campaigns analyzed:** [count]
158
159### Summary
160[Key findings in 2-3 bullets]
161
162### Details
163[Tables with metrics]
164
165### Actions
166- [Prioritized action items with expected impact]
167```