Explore with AI
Open this article in an AI assistant, with a prompt that asks it for a summary and the takeaways.
A KPI dashboard is one page showing the few numbers a team has agreed to run on, each against its target, so anyone can tell in under a minute whether things are on track. This guide covers how to choose those numbers, example sets for four teams, layout rules, and build rules an AI model can follow to produce the dashboard as one HTML file that you publish once and refresh at the same link.
What is a KPI dashboard, and how is it different from a report?
A KPI (key performance indicator) is a metric with an owner, a target and a period attached. A KPI dashboard puts five to nine of them on one page and answers one question, "are we on track?", the same way every period. A report answers "what happened, and why?" and is written fresh each time.
- Length: a dashboard fits on one screen before the detail starts; a report runs as long as its argument.
- Cadence: a dashboard keeps its layout and changes its numbers; a report changes both.
- Reading: a dashboard is scanned in seconds and revisited; a report is read once, start to finish.
A dashboard that needs three paragraphs of explanation has become a report. Write the report separately and link to it from the tile that moved.
How do you choose the KPIs for a dashboard?
Pick 5 to 9. Fewer than five usually leaves out a lever the team can pull; more than nine and nobody holds the page in their head, so it turns into an inventory of everything measurable. Before a metric gets a tile, write down four things:
- A definition two people would compute identically. "New pipeline" is a label; "sum of amount on opportunities created this week at stage 1 or later, excluding renewals" is a definition.
- An owner: one named person, not a department, who explains the number when it moves.
- A target: the value that counts as on track, taken from your plan.
- A period: the window the number covers (this week, month to date, trailing 90 days), matching its target's window.
Then make two cuts. The action test: if this number moved 20 percent tomorrow, would anyone do something different? If not, it belongs in a report. The lead/lag mix: keep a few leading indicators the team can act on this week (pipeline created, demos held) beside the lagging results that show whether it worked (bookings, churn). Where a metric can be hit in a way that hurts, pair it with the one that would show it: calls made with meetings held.
KPI dashboard examples for sales, marketing, customer success and operations
These sets say what to measure, not what good looks like; the targets come from your own plan.
Sales (weekly)
- New pipeline created this week, in currency
- Win rate: closed-won divided by all closed, trailing 90 days
- Bookings against quota, month to date
- Pipeline coverage: open pipeline divided by remaining quota this quarter
- Average sales cycle in days, for deals closed this quarter
- Proposals sent, and the share opened within 48 hours (measurable only if proposals go out as tracked links)
Marketing (weekly or monthly)
- Marketing-qualified leads
- Lead-to-opportunity conversion rate
- Pipeline sourced by marketing, in currency
- Customer acquisition cost by channel
- Conversion rate on the landing pages carrying paid traffic
Customer success (monthly)
- Gross revenue retention
- Net revenue retention
- Logo churn, as a count and a rate
- Time to first value, in days from signature
- Accounts flagged at risk, and the share with a recovery plan
Operations (weekly)
- On-time delivery rate
- Cycle time from order or ticket opened to closed
- Backlog age: share of open items older than your service window
- Cost per order, unit or ticket
- Rework or error rate
- Capacity utilization
How should you lay out a KPI dashboard?
Layout decides whether "are we on track?" is answered at a glance or after a hunt.
- Headline numbers first. The top row holds one tile per KPI with the current value set large, because that is the first question every reader brings.
- Put a trend beside every number. A small line of the last 8 to 13 periods sits next to the value; a number without its history cannot tell a good week from a good trend.
- Compare every number to its target, the same way on every tile. Show percent of target and reserve one status color for off-target tiles; if every tile is colored, none stands out.
- Use one chart type per question. Change over time is a line, comparing categories is a horizontal bar, parts of a whole is a stacked bar, actual against target is a bar with a target mark, so readers decode each type once.
- Order the page by reading priority: header with name, period and as-of time; tiles; charts; then the detail table, which serves whoever asks "why?" without crowding everyone else.
- Print the as-of time on the page. A dashboard without one invites decisions on old numbers.
- Keep the layout fixed between periods. Readers learn where to look, and only the numbers move.
How to create a KPI dashboard with AI: the build rules
An AI dashboard, in practice, is an HTML page a model writes from your numbers. Give Claude, ChatGPT, Gemini or Cursor an export and the rules below; with HTMLvault's MCP server connected, the same chat publishes the page with create_link and returns a private link. A paste-ready version of the rules closes this guide.
- Produce one self-contained HTML file, with all CSS in one
<style>block in the<head>. HTMLvault serves the document as written and adds no stylesheet or fonts of its own, so the page carries its own styling and loads its own fonts or uses a system font stack. - Put every figure in one
<script type="application/json" id="kpi-data">block at the top of the<body>, and hard-code no number anywhere else. An agent can then change numbers without touching the layout, and script text is stored exactly as written, so the stored block matches the one you wrote. - Write one KPI per line, starting with its id and value. A patch's find string must occur exactly once, and with unique ids a line beginning
{"id": "win_rate", "value":is unique by construction. - Draw charts as inline SVG, or load one charting library from a CDN. Chart.js from a CDN runs as written; a second library is a second rendering path for the next agent to untangle. SVG vs PNG for AI-generated reports covers when an image is the better choice.
- Keep every
<script>and<style>outside<svg>. Inside an SVG they parse as markup, and one holding a tag, a character reference or a CDATA section can be refused; an SVG<style>of plain CSS is fine. - Never write
<img src="data:...">. Publishing removes data: URLs from src. Use an https URL or inline SVG; base64 also costs output tokens and counts against the 5 MB document limit. - Close every element explicitly, including
</p>,</li>,</td>,</tr>and</tbody>. Malformed HTML is refused, not repaired, and omitted end tags can push a long table past the 1,000-level nesting limit. - Give every section, tile and chart a stable id or data- attribute, and never use an HTML comment as a marker. Comments are dropped at publish, so a patch anchored to one finds nothing.
- Write boolean attributes with a value:
hidden="hidden", not a barehidden. Publishing removes attributes with an empty value, alt excepted. - Keep dates out of the
<title>and og:description, as in "Revenue KPIs, weekly". They become the preview card when the link is pasted into Slack or email, and this link gets pasted every week.
Worked example: a KPI dashboard template
The skeleton below is the whole pattern: data at the top, an empty layout, one script that fills it. It shows two KPIs; a real page carries five to nine.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Revenue KPIs, weekly</title>
<meta property="og:description" content="Revenue KPIs against target, refreshed every Monday.">
<style>
body { font-family: system-ui, sans-serif; margin: 0; padding: 32px; background: #f8fafc; color: #0f1117; }
#kpi-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.tile { background: #fff; border: 1px solid #dbdde1; border-radius: 8px; padding: 16px; }
.value { font-size: 28px; font-weight: 600; }
.off { color: #dc2626; }
</style>
</head>
<body>
<script type="application/json" id="kpi-data">
{"as_of": "Week 19, Mon 06:00", "kpis": [
{"id": "new_pipeline", "value": 412000, "target": 450000, "label": "New pipeline", "owner": "Head of Sales", "period": "this week", "format": "usd", "trend": [380000, 395000, 441000, 402000, 412000]},
{"id": "win_rate", "value": 0.21, "target": 0.30, "label": "Win rate", "owner": "Head of Sales", "period": "trailing 90 days", "format": "pct", "trend": [0.29, 0.28, 0.25, 0.23, 0.21]}
]}
</script>
<header id="kpi-header">
<h1>Revenue KPIs, weekly</h1>
<p>As of <span id="as-of"></span></p>
</header>
<section id="kpi-tiles"></section>
<script>
const d = JSON.parse(document.getElementById("kpi-data").textContent);
document.getElementById("as-of").textContent = d.as_of;
const fmt = (k) => k.format === "pct" ? Math.round(k.value * 100) + "%" : "$" + Math.round(k.value / 1000) + "K";
const spark = (t) => {
const lo = Math.min(...t), span = Math.max(...t) - lo || 1;
const pts = t.map((v, i) => i * 100 / (t.length - 1) + "," + (28 - (v - lo) / span * 24)).join(" ");
return '<svg viewBox="0 0 100 30" width="100" height="30" aria-hidden="true"><polyline fill="none" stroke="#5a52cc" stroke-width="2" points="' + pts + '"></polyline></svg>';
};
document.getElementById("kpi-tiles").innerHTML = d.kpis.map((k) => {
const pct = Math.round(k.value / k.target * 100);
return '<article class="tile" data-kpi="' + k.id + '"><h2>' + k.label + '</h2><p class="value">' + fmt(k) + '</p>' + spark(k.trend)
+ '<p' + (pct < 90 ? ' class="off"' : '') + '>' + pct + '% of target, ' + k.period + ', owner: ' + k.owner + '</p></article>';
}).join("");
</script>
</body>
</html>
The renderer parses the block, writes each value into a tile, draws the trend as an SVG polyline and marks a tile off-target below 90 percent. For a metric where lower is better, such as sales cycle, add "better": "lower" after the value and invert the comparison. If a long detail table is too big for the model to write in one response, build the page in append mode: start a draft with create_draft_link, send chunks of up to 200 KB with append_html, and finalize on the last call. Nothing is public, and no checks run, until then.
How do you keep a KPI dashboard current at the same link?
Emailing the dashboard as a file each week puts a new copy in every inbox, and the old copies keep looking authoritative. Publish it once instead, pin the link where the team already looks (the meeting invite, a channel topic, a bookmark), and update the page in place. On HTMLvault, editing never changes the URL, whether you replace the whole page or patch three characters of it.
Replace the whole page on a schedule
If a script already renders the full page from your warehouse or CRM, send the new HTML through the REST API with PATCH /api/v1/links/{slug} and an html field, from a scheduled job, Zapier or anything that can call an API with an API key. An agent does the same with update_link. Whole-page replacement is also the right call when the KPI set or the layout changes.
Patch single numbers without touching the layout
A patch (patch_link over MCP, or the same PATCH endpoint with patches) replaces an exact substring of the stored HTML. The rules:
- Matching is plain text, never regex.
- Without replace_all, each find string must occur exactly once in the page.
- One call takes up to 200 patches and applies them all or none.
- Find strings match the stored bytes, not what you sent. Publishing drops the DOCTYPE and comments, lowercases tag names, double-quotes attribute values and re-encodes character references, so read the page with get_link (or preview the stored form with scan_html and
normalize: "full") before patching markup.
The kpi-data block avoids most of that, because script text is stored exactly as written. Correcting one number mid-week is one patch:
find: {"id": "win_rate", "value": 0.21,
replace: {"id": "win_rate", "value": 0.24,
The Monday refresh is one call: a patch per KPI line, each finding the whole line as stored and replacing it with the new value and trend, plus one for the as_of value. Because the call is all or nothing, the page never shows half of this week beside half of last week. Edit published HTML without breaking your links covers both edit paths step by step.
See who opens it and how far they scroll
Per-link analytics record views, unique and repeat viewers, scroll depth, time on page, country and city, device and referrer. On a dashboard, read them as feedback on the page itself:
- Repeat viewers early in the week mean the page has become the meeting's reference; a few unique viewers by Wednesday means it answers a question nobody asked.
- Scroll depth that stops at the tiles means the charts below are rarely seen: cut one, or move the one people need higher.
- One tracked link per recipient or per channel shows which audience reads it, the leadership channel or the all-hands email. Channels per link start on Pro.
- A webhook on link.viewed starts the next step the moment someone reads, through Zapier, Clay or your own code, such as a note to the KPI owners that leadership has opened this week's numbers.
What a static HTML dashboard can't do
- It is not live BI. The page is a snapshot as of its last refresh. Readers cannot query the warehouse, drill into rows that were never embedded, or filter beyond what the page's own script does with the data it carries. If people need to slice any dimension at any moment, that is a BI tool's job; the HTML dashboard is the agreed weekly view.
- It is only as fresh as its refresh schedule. If Monday's job fails, the page shows last week's numbers without complaint. Render the as_of value where nobody can miss it and have the job alert someone when its call fails; all-or-nothing patches prevent a half-updated page, not a stale one.
- One stored document is at most 5 MB. Embedded detail tables count toward it, so long row-level detail belongs on its own page.
- A standing link needs a plan that lets it stay up. On Free, links expire after 30 days; on Pro and above, expiry is configurable from one hour to never.
- Everything in the data block is readable by anyone with the link, through view-source if not on screen. Every publish and edit is checked against your account's PII and secret-scanning policy (regex-based, no AI tokens) and every outside URL against Google's unsafe-URL lists, so the week an export arrives with an email column, your policy decides what happens instead of nobody noticing. Keep row-level customer data out of the block unless readers need it, and add a password if the link will travel past the team.
Prompt you can reuse
Paste this into Claude, ChatGPT or any assistant connected to HTMLvault, fill in the brackets, and attach the data.
Build a KPI dashboard as one self-contained HTML file from the attached data.
Content
- KPIs: [5 to 9, each with definition, owner, target and period]
- Header: dashboard name, period, and the as-of time from the data.
- One tile per KPI: current value large, a sparkline of its trend beside it,
percent of target under it. Color only the off-target tiles.
- Below the tiles: one chart per question (a line for change over time,
a horizontal bar for comparing categories), then the detail table.
Build rules
- All CSS in one <style> block in the <head>; use a system font stack.
- Every number lives in one <script type="application/json" id="kpi-data">
block at the top of the <body>: one KPI per line, each line starting
{"id": "...", "value": ...}. Hard-code no number anywhere else.
- One script after it renders the tiles and draws charts as inline SVG
(or with a single charting library from a CDN).
- No <script> or <style> inside an <svg>.
- Close every element explicitly, including </p>, </li>, </td>,
</tr> and </tbody>.
- Give every section and chart a unique id. Never use HTML comments as markers.
- No <img src="data:...">. Boolean attributes get a value: hidden="hidden".
- No date in the <title> or og:description.
Publish it with create_link and return the URL. On later runs, read the stored
page with get_link and update only the kpi-data lines with patch_link, in one call.
Once that is set up, nobody has to remember to send the Monday dashboard as a file. The job patches seven lines before the 9 a.m. review, and the link already sitting in the meeting invite shows this week's numbers. By lunch, the operator who owns it can see who opened it and whether anyone scrolled past the tiles.
