Cursor install notes
- Skill root: this folder (scripts + references live here).
- Vendor source:
~/.cursor/skills/_vendor/ai-marketing-skills/ (git pull to update).
- Telemetry is optional; skip
telemetry/*.py unless you opt in.
- Run Python from this skill directory so relative paths resolve.
- Prefer
python on Windows if python3 is missing.
AI Revenue Intelligence
Working directory
cd ~/.cursor/skills/ams-revenue-intelligence
# Windows: cd $env:USERPROFILE\.cursor\skills\ams-revenue-intelligence
AI-powered revenue intelligence: sales call insight extraction, content-to-revenue attribution, and multi-source client reporting.
When to Use
- User wants to extract insights from Gong sales call transcripts
- User needs to identify objections, buying signals, or competitive mentions in calls
- User wants to prove content ROI by mapping content to closed deals
- User needs revenue attribution across first-touch and multi-touch models
- User wants to generate a unified client report from GA4 + HubSpot + Ahrefs + Gong
- User asks about content gaps in the buyer journey
- User needs anomaly detection across marketing metrics
Tools
Gong-to-Insight Pipeline (gong_insight_pipeline.py)
Extracts structured intelligence from sales call transcripts. Works with Gong API or plain transcript files.
# Analyze a single transcript file
python gong_insight_pipeline.py --file transcript.txt
# Analyze multiple transcript files
python gong_insight_pipeline.py --dir ./transcripts/
# Pull recent calls from Gong API (last 7 days)
python gong_insight_pipeline.py --gong --days 7
# Pull specific call by ID
python gong_insight_pipeline.py --gong --call-id abc123
# Output as JSON file
python gong_insight_pipeline.py --file transcript.txt --output insights.json
# Generate content topics from recurring objections
python gong_insight_pipeline.py --dir ./transcripts/ --content-topics
# Generate follow-up suggestions for outbound sequences
python gong_insight_pipeline.py --file transcript.txt --follow-ups
What it extracts:
- Objections (categorized: pricing, timing, competition, authority, need)
- Buying signals (budget confirmed, timeline mentioned, decision maker engaged, champion identified)
- Competitive mentions (who was mentioned, context: positive/negative/neutral)
- Pricing discussions (anchors, pushback, willingness indicators)
- Content topic suggestions from recurring objection patterns
- Personalized follow-up drafts based on call context
Output: Structured JSON to stdout or file. Each call produces an insights object with objections, buying_signals, competitive_mentions, pricing_discussions, content_topics, and follow_ups arrays.
Revenue Attribution Mapper (revenue_attribution.py)
Maps content pieces to pipeline and closed revenue. Proves content ROI with first-touch and multi-touch attribution.
# Run full attribution report (GA4 + HubSpot)
python revenue_attribution.py --report
# First-touch attribution only
python revenue_attribution.py --report --model first-touch
# Multi-touch (linear) attribution
python revenue_attribution.py --report --model linear
# Time-decay attribution
python revenue_attribution.py --report --model time-decay
# Filter by date range
python revenue_attribution.py --report --start 2025-01-01 --end 2025-03-31
# Calculate cost-per-acquisition by content type
python revenue_attribution.py --cpa --costs content_costs.json
# Identify content gaps in the buyer journey
python revenue_attribution.py --gaps
# Output as JSON
python revenue_attribution.py --report --json --output attribution.json
What it produces:
- Content-to-revenue mapping (which blog posts, videos, podcasts drove deals)
- First-touch, linear, and time-decay attribution models
- Cost-per-acquisition by content type (blog, video, podcast, webinar)
- Content ROI report with revenue per piece
- Content gap analysis (funnel stages with no attribution)
- Top-performing content ranked by attributed revenue
Data sources: GA4 (page paths, sessions, conversions) + HubSpot (deals, touchpoints, close dates)
Multi-Source Client Report Generator (client_report_generator.py)
Generates unified client-ready BI reports from GA4, HubSpot, Ahrefs, and Gong.
# Generate full client report
python client_report_generator.py --client "Acme Corp"
# Specify date range
python client_report_generator.py --client "Acme Corp" --start 2025-03-01 --end 2025-03-31
# Output as markdown
python client_report_generator.py --client "Acme Corp" --format markdown --output report.md
# Output as JSON (for rendering in slides/dashboards)
python client_report_generator.py --client "Acme Corp" --format json --output report.json
# Skip specific data sources
python client_report_generator.py --client "Acme Corp" --skip gong
python client_report_generator.py --client "Acme Corp" --skip ahrefs,gong
# Enable anomaly detection
python client_report_generator.py --client "Acme Corp" --anomalies
# Compare to previous period
python client_report_generator.py --client "Acme Corp" --compare previous-month
What it produces:
- Executive summary with key metrics and period-over-period changes
- Traffic section: sessions, users, top pages, channel breakdown (GA4)
- Pipeline section: deals created, moved, closed, revenue (HubSpot)
- SEO section: keyword rankings, backlinks, domain rating changes (Ahrefs)
- Call quality section: talk ratios, objection frequency, win rates (Gong)
- Anomaly flags: unusual spikes/drops with severity and context
- Output as structured markdown or JSON
Configuration
All scripts read from environment variables. Copy .env.example to .env and fill in your values.
Required Environment Variables
| Variable |
Used By |
Description |
GONG_API_KEY |
Gong Pipeline, Client Report |
Gong API access key |
GONG_API_BASE_URL |
Gong Pipeline, Client Report |
Gong API base URL |
HUBSPOT_API_KEY |
Attribution, Client Report |
HubSpot private app token |
GA4_PROPERTY_ID |
Attribution, Client Report |
GA4 property ID |
GA4_CREDENTIALS_JSON |
Attribution, Client Report |
Path to GA4 service account JSON |
Optional Environment Variables
| Variable |
Used By |
Description |
AHREFS_TOKEN |
Client Report |
Ahrefs API token |
OUTPUT_DIR |
All |
Directory for output files (default: ./output) |
Data Flow
Gong Transcripts → Insight Pipeline → Objections, Signals, Competitors → Content Topics + Follow-ups
GA4 + HubSpot → Attribution Mapper → Content ROI, CPA, Gap Analysis → Revenue Proof
GA4 + HubSpot + Ahrefs + Gong → Client Report → Executive Summary + Anomalies → Client Deliverable
Recommended Workflow
- Weekly: Run
gong_insight_pipeline.py --gong --days 7 to extract call intelligence
- Monthly: Run
revenue_attribution.py --report to prove content ROI
- Monthly: Run
client_report_generator.py for each client deliverable
- Quarterly: Run
revenue_attribution.py --gaps to find content gaps
- Ongoing: Feed Gong insight follow-ups into outbound sequences
Revenue Analytics Feedback Loop
Any recommendation that changes outbound, sales language, routing, content investment, or client reporting should get a readback.
Before recommending:
- Define the baseline window and candidate window.
- Pull source data from HubSpot, Gong, GA4, Ahrefs, and any outbound platform available.
- Identify the primary metric before looking at the result, otherwise the analysis becomes KPI karaoke.
After the change:
- Pull analytics after the readback date.
- Compare baseline vs candidate.
- Separate owner/participant effects, list quality, campaign changes, seasonality, and attribution gaps.
- Promote, keep testing, rollback, or mark unproven.
Common primary metrics:
- positive reply rate
- booked meeting rate
- qualified opportunity movement
- pipeline created
- speed-to-lead
- content-assisted revenue
- conversion rate
- objection frequency reduction
Every promoted playbook patch should include the change made, source systems, baseline window, candidate window, metric winner, caveats, and rollback rule.
Dependencies
pip install -r requirements.txt
1---2name: ivx-ams-revenue-intelligence3description: Prove content ROI and extract strategy from sales calls: Gong insights, revenue attribution, client reports. Use for call insights, content attribution, or client reporting.4---56## Cursor install notes78- Skill root: this folder (scripts + references live here).9- Vendor source: `~/.cursor/skills/_vendor/ai-marketing-skills/` (git pull to update).10- Telemetry is optional; skip `telemetry/*.py` unless you opt in.11- Run Python from this skill directory so relative paths resolve.12- Prefer `python` on Windows if `python3` is missing.1314# AI Revenue Intelligence1516## Working directory1718```bash19cd ~/.cursor/skills/ams-revenue-intelligence20# Windows: cd $env:USERPROFILE\.cursor\skills\ams-revenue-intelligence21```2223AI-powered revenue intelligence: sales call insight extraction, content-to-revenue attribution, and multi-source client reporting.2425## When to Use2627- User wants to extract insights from Gong sales call transcripts28- User needs to identify objections, buying signals, or competitive mentions in calls29- User wants to prove content ROI by mapping content to closed deals30- User needs revenue attribution across first-touch and multi-touch models31- User wants to generate a unified client report from GA4 + HubSpot + Ahrefs + Gong32- User asks about content gaps in the buyer journey33- User needs anomaly detection across marketing metrics3435## Tools3637### Gong-to-Insight Pipeline (`gong_insight_pipeline.py`)3839Extracts structured intelligence from sales call transcripts. Works with Gong API or plain transcript files.4041```bash42# Analyze a single transcript file43python gong_insight_pipeline.py --file transcript.txt4445# Analyze multiple transcript files46python gong_insight_pipeline.py --dir ./transcripts/4748# Pull recent calls from Gong API (last 7 days)49python gong_insight_pipeline.py --gong --days 75051# Pull specific call by ID52python gong_insight_pipeline.py --gong --call-id abc1235354# Output as JSON file55python gong_insight_pipeline.py --file transcript.txt --output insights.json5657# Generate content topics from recurring objections58python gong_insight_pipeline.py --dir ./transcripts/ --content-topics5960# Generate follow-up suggestions for outbound sequences61python gong_insight_pipeline.py --file transcript.txt --follow-ups62```6364**What it extracts:**65- Objections (categorized: pricing, timing, competition, authority, need)66- Buying signals (budget confirmed, timeline mentioned, decision maker engaged, champion identified)67- Competitive mentions (who was mentioned, context: positive/negative/neutral)68- Pricing discussions (anchors, pushback, willingness indicators)69- Content topic suggestions from recurring objection patterns70- Personalized follow-up drafts based on call context7172**Output:** Structured JSON to stdout or file. Each call produces an `insights` object with `objections`, `buying_signals`, `competitive_mentions`, `pricing_discussions`, `content_topics`, and `follow_ups` arrays.7374### Revenue Attribution Mapper (`revenue_attribution.py`)7576Maps content pieces to pipeline and closed revenue. Proves content ROI with first-touch and multi-touch attribution.7778```bash79# Run full attribution report (GA4 + HubSpot)80python revenue_attribution.py --report8182# First-touch attribution only83python revenue_attribution.py --report --model first-touch8485# Multi-touch (linear) attribution86python revenue_attribution.py --report --model linear8788# Time-decay attribution89python revenue_attribution.py --report --model time-decay9091# Filter by date range92python revenue_attribution.py --report --start 2025-01-01 --end 2025-03-319394# Calculate cost-per-acquisition by content type95python revenue_attribution.py --cpa --costs content_costs.json9697# Identify content gaps in the buyer journey98python revenue_attribution.py --gaps99100# Output as JSON101python revenue_attribution.py --report --json --output attribution.json102```103104**What it produces:**105- Content-to-revenue mapping (which blog posts, videos, podcasts drove deals)106- First-touch, linear, and time-decay attribution models107- Cost-per-acquisition by content type (blog, video, podcast, webinar)108- Content ROI report with revenue per piece109- Content gap analysis (funnel stages with no attribution)110- Top-performing content ranked by attributed revenue111112**Data sources:** GA4 (page paths, sessions, conversions) + HubSpot (deals, touchpoints, close dates)113114### Multi-Source Client Report Generator (`client_report_generator.py`)115116Generates unified client-ready BI reports from GA4, HubSpot, Ahrefs, and Gong.117118```bash119# Generate full client report120python client_report_generator.py --client "Acme Corp"121122# Specify date range123python client_report_generator.py --client "Acme Corp" --start 2025-03-01 --end 2025-03-31124125# Output as markdown126python client_report_generator.py --client "Acme Corp" --format markdown --output report.md127128# Output as JSON (for rendering in slides/dashboards)129python client_report_generator.py --client "Acme Corp" --format json --output report.json130131# Skip specific data sources132python client_report_generator.py --client "Acme Corp" --skip gong133python client_report_generator.py --client "Acme Corp" --skip ahrefs,gong134135# Enable anomaly detection136python client_report_generator.py --client "Acme Corp" --anomalies137138# Compare to previous period139python client_report_generator.py --client "Acme Corp" --compare previous-month140```141142**What it produces:**143- Executive summary with key metrics and period-over-period changes144- Traffic section: sessions, users, top pages, channel breakdown (GA4)145- Pipeline section: deals created, moved, closed, revenue (HubSpot)146- SEO section: keyword rankings, backlinks, domain rating changes (Ahrefs)147- Call quality section: talk ratios, objection frequency, win rates (Gong)148- Anomaly flags: unusual spikes/drops with severity and context149- Output as structured markdown or JSON150151## Configuration152153All scripts read from environment variables. Copy `.env.example` to `.env` and fill in your values.154155### Required Environment Variables156157| Variable | Used By | Description |158|----------|---------|-------------|159| `GONG_API_KEY` | Gong Pipeline, Client Report | Gong API access key |160| `GONG_API_BASE_URL` | Gong Pipeline, Client Report | Gong API base URL |161| `HUBSPOT_API_KEY` | Attribution, Client Report | HubSpot private app token |162| `GA4_PROPERTY_ID` | Attribution, Client Report | GA4 property ID |163| `GA4_CREDENTIALS_JSON` | Attribution, Client Report | Path to GA4 service account JSON |164165### Optional Environment Variables166167| Variable | Used By | Description |168|----------|---------|-------------|169| `AHREFS_TOKEN` | Client Report | Ahrefs API token |170| `OUTPUT_DIR` | All | Directory for output files (default: `./output`) |171172## Data Flow173174```175Gong Transcripts → Insight Pipeline → Objections, Signals, Competitors → Content Topics + Follow-ups176GA4 + HubSpot → Attribution Mapper → Content ROI, CPA, Gap Analysis → Revenue Proof177GA4 + HubSpot + Ahrefs + Gong → Client Report → Executive Summary + Anomalies → Client Deliverable178```179180## Recommended Workflow1811821. **Weekly:** Run `gong_insight_pipeline.py --gong --days 7` to extract call intelligence1832. **Monthly:** Run `revenue_attribution.py --report` to prove content ROI1843. **Monthly:** Run `client_report_generator.py` for each client deliverable1854. **Quarterly:** Run `revenue_attribution.py --gaps` to find content gaps1865. **Ongoing:** Feed Gong insight follow-ups into outbound sequences187188## Revenue Analytics Feedback Loop189190Any recommendation that changes outbound, sales language, routing, content investment, or client reporting should get a readback.191192Before recommending:193- Define the baseline window and candidate window.194- Pull source data from HubSpot, Gong, GA4, Ahrefs, and any outbound platform available.195- Identify the primary metric before looking at the result, otherwise the analysis becomes KPI karaoke.196197After the change:1981. Pull analytics after the readback date.1992. Compare baseline vs candidate.2003. Separate owner/participant effects, list quality, campaign changes, seasonality, and attribution gaps.2014. Promote, keep testing, rollback, or mark unproven.202203Common primary metrics:204- positive reply rate205- booked meeting rate206- qualified opportunity movement207- pipeline created208- speed-to-lead209- content-assisted revenue210- conversion rate211- objection frequency reduction212213Every promoted playbook patch should include the change made, source systems, baseline window, candidate window, metric winner, caveats, and rollback rule.214215## Dependencies216217```bash218pip install -r requirements.txt219```