You can embed metrics to display them alongside other web content, in the context where they are most relevant to your viewers. When you load an embedded metric, you get the freshest data available, because you're connecting directly to your data on Tableau Server or Tableau Cloud.
Embedded metrics work with the same web browsers that are supported by Tableau Cloud and Tableau Server. For a list of supported browsers, see the Technical Specifications. Though embedding is supported by Safari, viewers must turn off “Prevent cross-site tracking” to see embedded content.
The embed code and parameters for embedded metrics differ from those used for embedded views. For information about embedded views, see Embed Views into Webpages.
Note: Your Tableau administrator can limit the sites where embedding is allowed or disable embedding entirely. If your embedded metric doesn't load, check with your administrator to make sure that the site where you have embedded it is on the embedding allow list. For more information, see Tableau Site Settings for Embedding.
Copy the embed code
The fastest way to embed a metric is by copying the embed code provided by Tableau.
- On Tableau Cloud or Tableau Server, navigate to the details page for the metric that you want to embed.
- Click the Share Metric button.
- Click Copy Embed Code.
- Paste the embed code into the webpage where you want to embed the metric.
Write your own embed code
Parameters for embed code
|string||The URL of the metric on Tableau Server or Tableau Cloud.||
|string||The URL that viewers will be directed to if they click on the metric. If no target is specified, the embedded metric will link to the source URL.||
Authentication for embedded metrics
Embedded metrics follow the same licensing and permission restrictions used on Tableau Server and Tableau Cloud. To see an embedded metric, the viewer must sign in to an account on the Tableau site that the metric is embedded from. Unlike embedded views, embedded metrics don't allow for the use of a Guest account to display metrics to viewers who are not signed in.
Viewers who haven’t signed in to Tableau Server or Tableau Cloud in another tab will be prompted to sign in from the embedded metric itself. To successfully sign in from an embedded metric, the viewer’s browser must be must be configured to allow third-party cookies.
Embedded metrics support all authentication methods for Tableau Server and Tableau Cloud, with the exception of trusted authentication. For metrics embedded from Tableau Server, the server must use HTTPS to secure communication.
To enable a single sign-on experience for embedded metrics, your Tableau administrator must configure a trust relationship between Tableau Server and an external authorization server (Tableau Server only) or a Tableau connected app and a webpage. For more information, see Register EAS to Enable SSO for Embedded Content(Link opens in a new window) in the Tableau Server help or Configure Tableau Connected Apps to Enable SSO for Embedded Content(Link opens in a new window) in the Tableau Cloud help.
How metric URLs are structured
Metrics must be hosted on Tableau Server or Tableau Cloud. You can’t embed a metric from a local file.
Metric URL structure
- Tableau Cloud site:
- Tableau Server single site (or the Default site):
- Tableau Server multi-site:
- Tableau Cloud site:
- Tableau Server: