Mode reports can be embedded directly in other webpages, such as private wikis, blogs, or other public websites. When you embed a report, it will appear as a box on your page that contains the full contents of your report, including charts, tables, and other custom visualizations.
Here’s an example of an embedded report, from this blog post.
Clicking the link in the footer will allow you to view the content in Mode.
To embed a report, click on Share when you’re editing or viewing a report. In the popup, click “Embed.”
This opens an embed dialogue. Mode provides two options for embedding reports—a Javascript snippet and an iframe. The Javascript snippet is more dynamic and will size itself automatically to fit the length of the report, but requires running Javascript on the site where its embedded (most sites support this). The iframe option works on most sites, but requires you to set the height manually.
When using the iframe code, you can specify the height and width you’d like. By default, the height is set to 300 pixels (this is the size of Mode’s default charts), and the width is 100% so it will fill the portion of the page in which it is embedded. To make the iframe taller, simply change the value in the code snippet. You can use absolute numbers (like “300”) to set the height in pixels, or you can use a relative scale (like “25%”). Here’s a sample embed snippet for reference:
<iframe src="https://modeanalytics.com/benn/reports/35c937ba174f/runs/3cc6946d3f43/embed" width="100%" height="300" frameborder="0"></iframe>
The Javascript snippet will size itself automatically to fit the length of the report, but requires that you have the ability to run javascript on the site in which you are embedding it. For this reason, it may not work on some blogging or publishing sites.
When you copy the embed link, it will show a particular run by default, regardless of whether it is the most recent run of that report. Note /runs/3cc6946d3f43/ in the snippet below:
<iframe src="https://modeanalytics.com/benn/reports/35c937ba174f/runs/3cc6946d3f43/embed" width="100%" height="300" frameborder="0"></iframe>
If you’d prefer that the embed always show the latest run, remove the run id (/runs/3cc6946d3f43/) from the snippet:
<iframe src="https://modeanalytics.com/benn/reports/35c937ba174f/embed" width="100%" height="300" frameborder="0"></iframe>
Finally, you can set the embed to refresh when the page loads so that viewers will get up-to-the-minute results. With this option you can also pass parameters to the report. More on that here.
By default, embeds can be seen by people who have access to the embedded report.
You can allow anyone—including people who are logged out or do not have access to your organization—to see embedded private reports using secret embeds.
Plus Plan customers can also programmatically embed reports with specific parameters that can’t be changed. Using White-Label Embeds, you can provide customers and partners access to specific data—and only that specific data.
Last Updated December 16, 2015