Video | Tableau | Data visualisation | Analytics

Embed Metrics: New in Tableau 2021.4

Tableau 2021.4 finally lets you embed metrics, not just dashboards, and it's as simple as pasting an embed code into your portal.

Part ofWhat's new in Tableau 2021.4
Watch on YouTube
  • Tableau 2021.4 lets you embed individual metrics, not just dashboards, via the 'Share metric' option which provides an embed code
  • The embed code has two parts: an asset tag (e.g. tableau-metric) pointing to the metric's location and ID, and a JavaScript line using Tableau's metric API to render it
  • You can find the metric ID in the URL and use the Tableau Server REST API to dynamically load metrics rather than copying embed codes manually
  • Embedded metrics render inside an iframe using React rather than VizQL, meaning they build interactive elements rather than static images
  • Single sign-on makes embedding straightforward as users are already authenticated, so you can drop the embed code into most portals that accept HTML
  • When embedding multiple metrics you only need the JavaScript API line once; additional metrics just need their asset tag

Tableau 2021.4 extends embedding beyond dashboards to individual metrics, so you can drop a live, interactive metric card straight into any web page or portal using a simple embed code.

You have a Tableau metric published on Tableau Online/Server and want to surface it outside Tableau, such as on an intranet portal or web page. The demo pastes the embed code into a plain HTML boilerplate opened in a code editor, but the same code works in any HTML-accepting platform.

The Breakdown
  1. Grab the embed code from Share metric 0:41

    Open the metric, use Share metric, and copy the embed code rather than sharing a link. This is the starting point for embedding any metric.

  2. Understand the two parts of the code 1:01

    The code contains an asset tag identifying where the metric lives and its ID, plus a JavaScript API line that fetches, authenticates and renders it with the right formatting. You need both parts present for the metric to display.

  3. Paste into your HTML page 2:35

    Paste the copied code into the HTML file at the point where you want the metric to appear; a basic HTML5 boilerplate is enough to test it. Once saved and refreshed, the metric renders live in the page.

  4. Find the metric ID for dynamic loading 3:21

    The asset tag's ID matches the ID visible in the metric's URL, so rather than manually copying embed codes each time, you could use the Tableau Server REST API to look up metric IDs and build embed URLs dynamically as metrics are created.

  5. Inspect how it actually renders 4:43

    Using browser developer tools shows the metric is built inside an iframe, with Tableau generating a self-contained mini web page in that space. This is worth knowing if you're troubleshooting styling or embedding behaviour.

  6. It's React, not VizQL 5:41

    Embedded metrics are built with React rather than Tableau's usual VizQL rendering, producing individual interactive elements rather than a static image.

  7. Adding more than one metric 6:54

    When embedding a second metric on the same page, you only need one copy of the JavaScript API line — additional metrics just need their own asset tag pasted in, not a repeated script reference.

Worth Knowing
  • This simple embed approach assumes single sign-on, since it relies on users already being authenticated; without SSO you'd need to handle authentication separately.
  • Because it renders via React inside an iframe rather than VizQL, it behaves differently from typical Tableau dashboard embeds.
  • Duplicating the JavaScript API line when adding extra metrics isn't necessary and can be left out once it's already on the page.
Use It When

Reach for this when you want to surface a single live metric — not a full dashboard — inside an intranet portal, internal tool or web page, especially where users are already signed in via SSO.

How this Rollup was made provenance & method

A Rollup is drafted by AI from the video's transcript, then reviewed and edited by Tim. Everything used to produce this one is listed below — the model, the exact prompt, and the source video — so the process is transparent and reproducible.

Transcription
On-device — NVIDIA Parakeet v3 for recent videos, OpenAI Whisper large-v3 for earlier ones. The transcript never leaves the machine or gets published.
Drafting
Claude Sonnet 5 in the cloud, from that transcript.
Prompt
The exact Rollup prompt (v2) — the full system prompt, unedited.
Source video
Watch on YouTube
Drafted
5 July 2026 at 09:38
Reviewed & edited
5 July 2026 at 09:41 · by Tim Ngwena

Model + prompt + video is everything you'd need to recreate a Rollup like this yourself. The one thing we don't share is the transcript.

Rights. The video and its transcript are the property of TN Media Ltd. Unauthorised use or download is prohibited. © TN Media Ltd.