Finding Your IDs
Find a metric ID
Get the value for the metric-id attribute of dbn-metric, to embed one chart.
Use <dbn-metric> to show one metric instead of a whole dashboard. It needs the metric’s ID.
Steps
- Go to Data Studio > Data Apps and open your data app.
- Select the Embeds tab, then Add embed.
- Select the Workspace. For Embed type, select Metric.
- Select the Dashboard that holds the metric, then the Metric.
- Select Create embed.
- In the new row, copy the Key. Or select Get snippet and copy the
metric-idvalue.
<dbn-metric token="GUEST_TOKEN" metric-id="monthly-revenue" style="display:block;height:400px"></dbn-metric>You have the metric ID. Next, create a guest token.
The Metric ID column on a workspace’s metrics list on Home shows the same value.
If something goes wrong
- The console says
dbn-metric: no metric-id was set. Setmetric-id. In HTML, write it in kebab case, notmetricId. - The card does not load. The metric must be an embed of the data app the guest token was made for.