Marketing analytics

From naveedharri/benai-skills · View interactive version

Marketing analytics is an AI agent skill from the GitHub repository naveedharri/benai-skills. Build and refresh a single-page marketing analytics dashboard (Marketing Pulse) that answers attention, conversion, revenue, and retention every morning, with every number carrying its delta and its source. Two modes: SETUP (first run - interviews for sources like Stripe, YouTube/PostHog, newsletter

How to use this skill

Skill file

Marketing Analytics

One page, four questions: attention, conversion, revenue, retention. Every number carries its trend and its source. A scheduled task invokes this skill with a timeframe; the skill does the rest.

Mode selection

SETUP (first run)

  1. Locate or create the dashboard folder. Ask where it should live (default: marketing-pulse/ in the user's project folder). Copy assets/dashboard-template.html in as dashboard.html.
  2. Interview for sources. Which of these does the business run, and through which tool?
  1. Probe the connectors for each approved source (ToolSearch if deferred). For gaps: offer to connect, or mark the block pending: true - the template renders honest placeholders. Never fake a number.
  2. Write config.md in the dashboard folder: each source, the exact tool/IDs used, the metric definitions chosen, deploy target (Vercel / live artifact / local file), and anything learned probing (rate limits, missing fields). references/source-wiring.md shows a complete worked example.
  3. Run the first REFRESH end to end, then tell the user the one-line prompt to put in a scheduled task, e.g.:

Use the marketing-analytics skill to refresh the marketing dashboard for yesterday.

REFRESH (the scheduled run)

  1. Read config.md + the current data.js. Resolve the timeframe to complete days (24h = the last complete day; 7d/30d windows end on it).
  2. Pull every configured source for the window. Follow references/source-wiring.md for the field-tested access patterns and gotchas (Stripe filter shapes, PostHog queries, API lags). Oversized API responses: save to file and extract with jq/scripts - never page raw dumps through context.
  3. Rewrite data.js to the contract in references/data-contract.md. Keep the header comments (they are the documentation). Every metric gets its delta (24h and 7d where the source allows).
  4. Append the daily snapshot to history/YYYY-MM-DD.json (the whole DASHBOARD_DATA object). This is the append-only DB that unlocks month-over-month.
  5. Write the daily brief (the brief array): 3-5 sentences, numbers-first. Sentence 1 = the headline (revenue/net movement). Then: what drove any spike, which content converted, one retention/community observation, and at most one concrete action. No filler, no hype.
  6. Verify: open dashboard.html and confirm it renders with the new data (no NaN, no empty sections that should have data).
  7. Deploy per config (e.g. vercel deploy --prod --yes from the folder, or update the live artifact). Skip silently if config says local-only.
  8. Report: the live URL plus the 3 numbers that moved most, with deltas.

Hard rules

Self-improvement

This skill is never finished. Improve it as you use it.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.