Web integration of DigDash dashboards and objects
- Embedding a dashboard in a web page
- Embedding a portlet (graph or other element) in a web page
- Configuring a multi-domain integration
DigDash makes it easy to integrate its dashboards or objects (charts, filters, comments, etc.) into an existing web page. Depending on the level of customisation required and the context of use, several methods are available:
- Via iFrame: this method involves inserting a complete DigDash dashboard or a chart into an <iframe> tag. Other types of objects (filters, comments, legends, etc.) cannot be embedded.
This is a simple solution to implement, ideal for quickly displaying standalone content. The dashboard or page is completely separate from the rest of the site, which reduces the risk of style conflicts with the parent page. However, it offers little flexibility or interactivity. Via embedded JavaScript: this method allows you to insert a dashboard or specific elements (such as a chart, a filter or a legend) directly into the structure of the web page itself. It offers greater flexibility and interactivity but may present risks of style or script conflicts with the parent page. This can be achieved:
- by using custom HTML tags (<dd-portlet>, <dd-dashboard>) — a simple solution that requires no JavaScript code; suitable for simple pages or where JavaScript is not permitted.
- or via JavaScript scripts, for more refined and dynamic integration (filtering, interactions between components, conditional display, etc.).
ℹ iFramemode: Security constraints
Some browsers, such as Chrome, may refuse to pass on cookies from a page embedded via an iframe if that iframe is not on the same domain as the page embedding it. An error then appears in the browser console, regarding a SameSite attribute that is not defined.
TheSameSite attribute cannot be set on an unsecured cookie. Therefore, the cookie must also have a Secure attribute to allow SameSite=None to be set. And the Secure attribute can only be set if the connection is via HTTPS.
Consequently, embedding a dashboard page or a viewflow page as an iframe –if the iframe and the page embedding it are on different domains – requires the use of an HTTPS connection and the configuration of cookies.
The following Mozilla document explains this restriction: https://developer.mozilla.org/fr/docs/Web/HTTP/Headers/Set-Cookie/SameSite