Analytics
Measurement and intelligence — what happened, what competitors are doing, and what the system should learn from both.
Back to the workflows index.
What this vertical means here
Analytics OS is the fifth spoke off Mktg OS on page 1. Page 3 adds
Deep Analytics / Call Analytics and Competition Research; page 5 lists
Dashboard / Analytics as deliverable ⑤.
The live surfaces here are strong — competitor analysis and the learning profile are among the more sophisticated things in the product — but they are intelligence, feeding content decisions. The measurement half, reporting on outcomes, is thin.
Workflows
| Workflow | Status | Where |
|---|---|---|
| Competitor analysis — competitors, reels, comparison | ✅ Live | Competitor Analysis |
| Reel topic derivation — per-reel topic + summary, vision retry | ✅ Live | Competitors tab, Discovery + Daily Studio |
| Instagram learning profile (v2) — OAuth → metric sync → analysis | ✅ Live | Learning |
| Platform admin dashboard — activity + token analytics | ✅ Live | Admin → Dashboard |
Feed scoring — one evidence-based composite, feedRank (relevance · brand fit · authority · authenticity, gated by compliance and a relevance floor) | ✅ Live | Discovery, Daily Studio, News — all rank on it |
| Review Insights — article-rejection stats + AI-tagged reviewer behaviour patterns | ✅ Live | Review Insights page (compliance learning) |
| Health checks | ✅ Live | /health, Admin → Health; alerts on error rate, latency, probes, queue backlog, stale jobs, spend, breakers, stalled workers, pipeline backlog, Mongo down |
| Monitoring console — metrics, errors, integrations, jobs, unit economics | ✅ Live | Monitor app (:3005) |
| Integration observability — every outbound call (LLM adapters, moderation, Tavily, Apify, Semrush, AnswerThePublic, ZeroGPT, GNews, NewsAPI, Instagram Graph, CMS, Higgsfield, Ideogram) timed and its failures ledgered | ✅ Live | Monitor → Integrations |
| Unit economics — cost per action and per finished piece, split by tenant and by provider, as a daily trend over 14/30/90 days | ✅ Live | Monitor → Unit economics |
| Unified Dashboard / Analytics | 🟡 Partial | Deliverable ⑤ — admin dashboard exists; no tenant-facing marketing dashboard |
| Deep Analytics / Call Analytics | ⬜ Planned | Page 3 |
| Program measurement | ⬜ Planned | A6 on page 2 |
| Attribution | ⬜ Planned | Implied, never drawn |
What's live, in detail
Competitor analysis
Two separate stores, bridged rather than merged:
- Your own account lives in the learning store — connections, reels, metric snapshots, written by the Instagram Graph sync.
- Competitors live in the
ops_ca_*store.
buildComparison bridges them: it refreshes the own-profile row when it's older
than 6 hours, in parallel with the competitor reads and behind an 8-second
timeout, so a slow Instagram call can never blank the comparison. Competitors
refresh in batches of 3.
Own-profile sync prefers the Meta provider (real Graph data via the stored OAuth token) and falls back to Apify only when Meta returns no follower count — i.e. a personal account.
Reel topics
Genuinely careful work, and worth understanding before changing:
- Captions are stripped of promo boilerplate first — "follow for more" describes the account, not the reel.
- Candidate topics are rejected by a promo filter at every exit: deterministic fallback, LLM output, and hashtag pick alike.
- Unresolved reels report a
NO_TOPICsentinel rather than inventing a category. - Only those get one cover-frame vision retry, capped per refresh, SSRF-guarded.
The same vision call returns a 1–2 sentence summary of what the reel covers, overwriting the deterministic one — which describes the caption's shape (hook, style, CTA) and reads as boilerplate on topic cards. Both are persisted, so changing the prompt requires a refresh to take effect.
This is deliberately not the learning page's media pipeline, which downloads the video and needs ffmpeg + Whisper — far too heavy for a per-refresh path.
Learning profile
OAuth connect → cron metric sync → reel analysis → learning profile (v2). Feeds hook formulas and creator voice into ATL script generation.
Token analytics
The platform admin dashboard tracks usage by feature and operation — every agent
call is attributed (feed, compliance, blogs, with operations like
draft_generation, quality_repair, feed_review, blog_review).
This is no longer the only place the system measures itself. Every outbound call — not only LLMs but scraping, detection, keyword, image and video providers — is timed and its failure ledgered, so a Tavily outage during a fetch or a CMS login loop shows on the monitor console's Integrations page instead of being invisible. The same console adds unit economics on the usage ledger: cost per action and cost per finished piece, with a per-stage breakdown, per-tenant and per-provider splits, and a daily trend so a step is a prompt change and a spike is one bad piece. A dated price history means a rate correction restates old rows rather than only future ones; unpriced spend (Higgsfield and Ideogram until an operator sets a plan rate) is counted and named, never summed as zero. Every background loop stamps a heartbeat, so a dead worker is an alert rather than a growing queue.
Feed scoring
Every displayed score is computed from counted evidence — a rubric band held
within its range, term coverage, an evidence inventory (quotes, attributed
figures, named sources), domain tiers plus document signals, reviewer history —
never from a bare model number. They blend into one composite, feedRank
(relevance 0.35, brand fit 0.25, authority 0.2, authenticity 0.2), multiplied by
a compliance gate and a relevance gate so an off-topic archive page cannot ride
authority into the feed. Discovery's "Best" sort, Daily Studio and the News page
all rank on the same number.
Review Insights
The first shipped "learn from what we have done" loop. Reviewer actions — approve/reject with a reason (compulsory on reject), finding dismissals, CMS-gate acknowledgements — land as durable feedback events, and a learning agent distils them into a per-tenant pattern report, each pattern tagged user-scoped or company-scoped. Rendered on the Review Insights page in two tabs: article rejections (counted directly from the events, real from the first rejection) and compliance behaviours (the agent's advisory patterns). Read-only v1: it informs humans and never suppresses a finding.
What's missing
A tenant-facing marketing dashboard. Deliverable ⑤ on page 5 is
Dashboard / Analytics. What exists is a platform admin dashboard — activity
and token spend. A marketing lead has no view of what their content did.
Content performance. The system knows what it produced. It does not report on how any of it performed after publishing. Instagram metrics sync for learning, not for reporting.
Deep analytics / call analytics. Page 3 names it twice. Nothing exists.
Program measurement (A6). Page 2 sets rupee targets per play; nothing
measures against them. See Program.
The feedback loops. Page 6 tags three as end-state, all of them analytics work:
- Learn from what we have done →
ES- Scan competition to get insights →
ES- Scan category to get insights →
ES
The second is partially served by competitor analysis. The first is now genuinely started: the Learning Agent has two shipped sub-agents. The Source Profiler learns and verifies scrape rules per news source (every model claim tested against real pages before it may steer the crawl), and Compliance Feedback Learning learns from reviewer behaviour — why advice is ignored, what gets rejected and why — surfaced on the Review Insights page. Reviewer decisions also feed authority scoring directly (a Bayesian ±10 from review history). What is still open is closing the loop on query generation and ranking weights automatically — score calibration reports the evidence per component, but a human still changes the weights — and the third loop (category scanning) is not started.
Dependencies
| Needs | For |
|---|---|
| Meta / Instagram Graph OAuth | Own-profile metrics, learning |
| Apify | Competitor scraping, personal-account fallback |
| OpenAI vision | Reel cover-frame topic + summary |
Coolify cron → /api/internal/instagram-sync | Metric sync |
Coolify cron → /api/internal/news-fetch | Daily sweep, competitor refresh |
| ffmpeg + Whisper | Learning-page media pipeline only |
| Prometheus + Loki + Alertmanager | The monitor console's metrics, logs and alerts; the Mongo ledger works without them |
| AnswerThePublic | Reader questions for blog FAQs — one platform account, 200 searches/month, ledgered |
| Higgsfield / Ideogram | Video clips / text layerization — counted per unit, unpriced until an operator sets a rate |
The daily sweep fires competitor refresh per modules.competitors.enabled
tenant and does not await it — it is a paid Apify scrape plus an LLM topic
pass that can run for minutes. That module flag is the cost control.
Workflow specs in this folder
- Competitor Analysis
- Instagram Learning Profile
- Marketing Dashboard
- Reel Topic Derivation
- Token & Activity Analytics
Roadmap source
Pages 1 (Analytics OS spoke), 3 (Deep Analytics, Competition Research,
monitoring/optimization), 5 (deliverable ⑤), 6 (the three ES feedback loops).
See ../../roadmap_ref_extracted.md.