Analytics
Unified marketing analytics skill. Pulls real data from HubSpot, LinkedIn, X, and YouTube via CLI scripts.
How It Works
Each platform has a standalone TypeScript script in scripts/. Run them with npx tsx from the repo root. They read credentials from .env and output markdown tables to stdout.
All scripts live in: .claude/skills/analytics/scripts/
Platform Status
| Platform |
Status |
Env Vars Needed |
| HubSpot |
Ready |
HUBSPOT_PRIVATE_APP_TOKEN |
| LinkedIn |
Needs setup |
LINKEDIN_ACCESS_TOKEN, LINKEDIN_ORG_ID |
| X / Twitter |
Needs setup |
X_BEARER_TOKEN, X_USERNAME |
| YouTube |
Needs setup |
YOUTUBE_ACCESS_TOKEN, YOUTUBE_CHANNEL_ID |
Setup instructions for each platform are in setup/.
Commands
HubSpot Email Performance
npx tsx .claude/skills/analytics/scripts/hubspot-emails.ts [period] [limit]
- period: 7d, 30d, 90d, all (default: 30d)
- limit: number of top emails to show (default: 10)
- Output: aggregate metrics (sent, delivered, open rate, click rate, CTOR, bounce rate) + top emails table
HubSpot Landing Page Analytics
npx tsx .claude/skills/analytics/scripts/hubspot-pages.ts [period] [limit]
- period: 7d, 30d, 90d (default: 30d)
- limit: number of pages to show (default: 10)
- Output: summary (views, submissions, conversion rate) + page breakdown + traffic sources
HubSpot Campaign Performance
npx tsx .claude/skills/analytics/scripts/hubspot-campaigns.ts [period] [limit]
- period: 7d, 30d, 90d, all (default: 30d)
- limit: number of campaigns to show (default: 5)
- Output: campaign overview + per-campaign asset metrics (emails, pages, forms, blog posts)
LinkedIn Analytics
npx tsx .claude/skills/analytics/scripts/linkedin.ts [command] [period] [limit]
- command: overview, posts, followers (default: overview)
- period: 7d, 30d, 90d (default: 30d)
- limit: number of posts to show (default: 10)
- Output: follower count + follower growth + post performance (impressions, clicks, likes, engagement)
X (Twitter) Analytics
npx tsx .claude/skills/analytics/scripts/x-analytics.ts [command] [period] [limit]
- command: posts, profile (default: posts)
- period: 7d, 30d, 90d (default: 30d)
- limit: number of tweets to show (default: 20)
- Output: profile stats + aggregate tweet metrics + top tweets by impressions
YouTube Analytics
npx tsx .claude/skills/analytics/scripts/youtube.ts [command] [period] [limit]
- command: channel, videos (default: channel)
- period: 7d, 30d, 90d (default: 30d)
- limit: number of videos to show (default: 10)
- Output: channel overview + period metrics (views, watch time, subs, engagement) + top videos
Dispatch Logic
When the user asks a performance question, run the appropriate script(s):
| User asks about... |
Script to run |
| Email open rates, click rates, email performance |
hubspot-emails.ts |
| Landing page views, conversions, bounce rates |
hubspot-pages.ts |
| Campaign results, which campaign performed best |
hubspot-campaigns.ts |
| LinkedIn engagement, post performance, followers |
linkedin.ts |
| Twitter/X metrics, tweet impressions, follower count |
x-analytics.ts |
| YouTube views, subscribers, watch time, video performance |
youtube.ts |
| "How are we doing?" / "What's working?" / cross-platform |
Run all configured platforms |
| Baseline metrics before creating new content |
Run the relevant platform script |
| Comparing channels |
Run multiple platform scripts and summarize |
Proactive Usage
Don't wait for the user to ask "show me analytics." Run the appropriate script whenever:
- Planning new content: Pull current metrics to set baselines
- Evaluating what worked: Show real numbers, not guesses
- CRO work: Pull landing page data before making recommendations
- Social content planning: Check what posts performed best before drafting new ones
- Email sequence work: Pull email performance to establish benchmarks
- Reporting or reviews: Always lead with real data
Interpreting Results
When presenting analytics data, don't just dump the table. Add context:
- Call out standouts (best/worst performers, unusual spikes or drops)
- Compare to benchmarks when relevant (B2B SaaS averages: email open 20-25%, click 2-3%, landing page conversion 3-5%)
- Connect to actions ("Our top post was about X, suggesting the audience responds to Y")
- Note data gaps ("LinkedIn analytics not yet configured, so we can only compare HubSpot and X")
Error Handling
If a script fails with a missing env var error, check the setup doc for that platform and guide the user through configuration. Don't guess at credentials or make up data.
Output Location
Output location: marketing/reports/[report-slug]/ — confirm the project slug with the user before creating files.
Related Skills
- tracking-setup: For setting up website analytics tracking (GA4, GTM, events, consent mode)
- social-content: For creating social posts informed by analytics data
- page-cro: For optimizing pages based on landing page analytics
- email-sequence: For designing email flows using email performance baselines
1---2name: analytics3description: Pull performance metrics from HubSpot, LinkedIn, X, and YouTube. Use when the user asks 'how are we doing,' 'what's our engagement,' 'show me metrics,' 'analytics,' 'email performance,' 'landing page stats,' 'campaign results,' 'LinkedIn analytics,' 'X analytics,' 'Twitter stats,' 'YouTube metrics,' or any question about marketing performance that real data can answer.4---56# Analytics78Unified marketing analytics skill. Pulls real data from HubSpot, LinkedIn, X, and YouTube via CLI scripts.910## How It Works1112Each platform has a standalone TypeScript script in `scripts/`. Run them with `npx tsx` from the repo root. They read credentials from `.env` and output markdown tables to stdout.1314**All scripts live in:** `.claude/skills/analytics/scripts/`1516## Platform Status1718| Platform | Status | Env Vars Needed |19|----------|--------|-----------------|20| HubSpot | Ready | `HUBSPOT_PRIVATE_APP_TOKEN` |21| LinkedIn | Needs setup | `LINKEDIN_ACCESS_TOKEN`, `LINKEDIN_ORG_ID` |22| X / Twitter | Needs setup | `X_BEARER_TOKEN`, `X_USERNAME` |23| YouTube | Needs setup | `YOUTUBE_ACCESS_TOKEN`, `YOUTUBE_CHANNEL_ID` |2425Setup instructions for each platform are in `setup/`.2627## Commands2829### HubSpot Email Performance3031```bash32npx tsx .claude/skills/analytics/scripts/hubspot-emails.ts [period] [limit]33```34- **period:** 7d, 30d, 90d, all (default: 30d)35- **limit:** number of top emails to show (default: 10)36- **Output:** aggregate metrics (sent, delivered, open rate, click rate, CTOR, bounce rate) + top emails table3738### HubSpot Landing Page Analytics3940```bash41npx tsx .claude/skills/analytics/scripts/hubspot-pages.ts [period] [limit]42```43- **period:** 7d, 30d, 90d (default: 30d)44- **limit:** number of pages to show (default: 10)45- **Output:** summary (views, submissions, conversion rate) + page breakdown + traffic sources4647### HubSpot Campaign Performance4849```bash50npx tsx .claude/skills/analytics/scripts/hubspot-campaigns.ts [period] [limit]51```52- **period:** 7d, 30d, 90d, all (default: 30d)53- **limit:** number of campaigns to show (default: 5)54- **Output:** campaign overview + per-campaign asset metrics (emails, pages, forms, blog posts)5556### LinkedIn Analytics5758```bash59npx tsx .claude/skills/analytics/scripts/linkedin.ts [command] [period] [limit]60```61- **command:** overview, posts, followers (default: overview)62- **period:** 7d, 30d, 90d (default: 30d)63- **limit:** number of posts to show (default: 10)64- **Output:** follower count + follower growth + post performance (impressions, clicks, likes, engagement)6566### X (Twitter) Analytics6768```bash69npx tsx .claude/skills/analytics/scripts/x-analytics.ts [command] [period] [limit]70```71- **command:** posts, profile (default: posts)72- **period:** 7d, 30d, 90d (default: 30d)73- **limit:** number of tweets to show (default: 20)74- **Output:** profile stats + aggregate tweet metrics + top tweets by impressions7576### YouTube Analytics7778```bash79npx tsx .claude/skills/analytics/scripts/youtube.ts [command] [period] [limit]80```81- **command:** channel, videos (default: channel)82- **period:** 7d, 30d, 90d (default: 30d)83- **limit:** number of videos to show (default: 10)84- **Output:** channel overview + period metrics (views, watch time, subs, engagement) + top videos8586## Dispatch Logic8788When the user asks a performance question, run the appropriate script(s):8990| User asks about... | Script to run |91|---------------------|---------------|92| Email open rates, click rates, email performance | `hubspot-emails.ts` |93| Landing page views, conversions, bounce rates | `hubspot-pages.ts` |94| Campaign results, which campaign performed best | `hubspot-campaigns.ts` |95| LinkedIn engagement, post performance, followers | `linkedin.ts` |96| Twitter/X metrics, tweet impressions, follower count | `x-analytics.ts` |97| YouTube views, subscribers, watch time, video performance | `youtube.ts` |98| "How are we doing?" / "What's working?" / cross-platform | Run all configured platforms |99| Baseline metrics before creating new content | Run the relevant platform script |100| Comparing channels | Run multiple platform scripts and summarize |101102## Proactive Usage103104Don't wait for the user to ask "show me analytics." Run the appropriate script whenever:105106- **Planning new content:** Pull current metrics to set baselines107- **Evaluating what worked:** Show real numbers, not guesses108- **CRO work:** Pull landing page data before making recommendations109- **Social content planning:** Check what posts performed best before drafting new ones110- **Email sequence work:** Pull email performance to establish benchmarks111- **Reporting or reviews:** Always lead with real data112113## Interpreting Results114115When presenting analytics data, don't just dump the table. Add context:1161171. **Call out standouts** (best/worst performers, unusual spikes or drops)1182. **Compare to benchmarks** when relevant (B2B SaaS averages: email open 20-25%, click 2-3%, landing page conversion 3-5%)1193. **Connect to actions** ("Our top post was about X, suggesting the audience responds to Y")1204. **Note data gaps** ("LinkedIn analytics not yet configured, so we can only compare HubSpot and X")121122## Error Handling123124If a script fails with a missing env var error, check the setup doc for that platform and guide the user through configuration. Don't guess at credentials or make up data.125126## Output Location127128**Output location:** `marketing/reports/[report-slug]/` — confirm the project slug with the user before creating files.129130---131132## Related Skills133134- **tracking-setup**: For setting up website analytics tracking (GA4, GTM, events, consent mode)135- **social-content**: For creating social posts informed by analytics data136- **page-cro**: For optimizing pages based on landing page analytics137- **email-sequence**: For designing email flows using email performance baselines