Skip to main content
Every example renders the same iframe and listener as the HTML embed. Only the way the title and keywords are filled in changes. Replace YOUR_WIDGET_ID with the ID from your widget page.
If your dashboard snippet includes d, kv and sig parameters, keep them in the URL in every example below. See Embed security.

Template languages

After each iframe, paste the listener <script> from your dashboard snippet unchanged.

Script tag that reads the page

If you can’t edit template variables, you can mount the widget from the page itself. This script turns every <aside data-polyembed> slot into a widget, using the slot’s data-title and data-keywords, or falling back to the page’s og:title, <meta name="keywords"> and document.title. It’s the approach used by the demo news site.
Article template
/assets/polyembed.js
Hiding the whole <aside> on polyembed:hide also removes any heading or border you wrap around the widget.

React and Next.js

PolyEmbed.tsx
Use it in an article page:
app/news/[slug]/page.tsx

Choosing good keywords

Use your CMS’s tags if they’re specific. If your tags are broad sections, leave keywords empty and let the title do the matching, or use a field your editors fill per story. See Market matching.