Skip to content
Showpiece

Interactive demos on HubSpot

Add an interactive demo to a HubSpot page.

Export the demo as one HTML file, put it online, and paste the snippet into a rich text module as embed code. Its lead form can send to HubSpot too.

Three steps

From the editor to HubSpot.

Nothing to install on your site, and nothing of ours to load.

  1. 01

    Export the demo

    Open the arrow beside Export. Under On a web page, copy the snippet, then export the file.

  2. 02

    Put it online

    Anywhere that serves a web page over https. In the snippet, change the file's name to its full address.

  3. 03

    Paste it into HubSpot

    In a rich text module, click Insert, then Embed. Paste the snippet as the embed code and click Insert.

The snippet

The snippet, ready to paste.

The editor's own snippet, with the file's full address in it.

Embed · the snippet for the pageHTML
<div style="position:relative;width:100%;padding-top:calc(62.5% + 78px);border-radius:12px;overflow:hidden">
  <iframe src="https://harbor.example/demos/harbor.html" title="Harbor's hot leads" data-demo="demo-harbor" loading="lazy" allow="fullscreen; autoplay"
    style="position:absolute;inset:0;width:100%;height:100%;border:0"></iframe>
</div>
<script>
(function () {
  var frame = document.querySelector('iframe[data-demo="demo-harbor"]');
  // What happens in the demo, sent to this page's analytics: Google Analytics, Tag Manager, Segment,
  // PostHog or Mixpanel, whichever it runs. Only the demo's own words, nothing about who's watching.
  var events = {"ready":"demo_view","step":"demo_step","button":"demo_button","choice":"demo_choice","end":"demo_complete"};
  function measure(data) {
    var name = events[data.type];
    if (!name) return;
    var props = { demo: "Harbor's hot leads" };
    for (var key in data) if (key !== "protocol" && key !== "type") props[key] = data[key];
    if (typeof window.gtag === "function") window.gtag("event", name, props);
    else if (window.dataLayer && typeof window.dataLayer.push === "function") window.dataLayer.push(Object.assign({ event: name }, props));
    if (window.analytics && typeof window.analytics.track === "function") window.analytics.track(name, props);
    if (window.posthog && typeof window.posthog.capture === "function") window.posthog.capture(name, props);
    if (window.mixpanel && typeof window.mixpanel.track === "function") window.mixpanel.track(name, props);
  }
  window.addEventListener("message", function (e) {
    if (!frame || e.source !== frame.contentWindow || !e.data || e.data.protocol !== "demo/1") return;
    measure(e.data);
  });
})();
</script>

The one change from the editor’s snippet is the address: the file’s name becomes where it is online, starting https.

The box keeps the demo’s shape at any width, with room for its controls. The file isn’t asked for until the demo’s scrolled near.

The lines under it pass views, steps and clicks to your page’s analytics, on Basic and Pro. Switch them off in Export and the snippet is the box alone.

The snippet, part by part

The demo's leads, into HubSpot

How it looks

The demo, playing from its file.

Harbor's hot leads, walked through, every email and phone number in it redacted.

harbor.htmlPlays from its file
Harbor, a CRM: a walkthrough opens its hot leads, then a contact's deal, every email and phone number as dots

This is the file itself, playing on our site. In your page it plays from wherever you put it, with its controls under it.

A walkthrough waits at each step until the viewer clicks on.

What the snippet does

From its own help

What HubSpot's help says.

Read on hubspot.com in October 2026. Each line rests on the pages linked under it.

Where it goes
A rich text module: Insert, then Embed, with the snippet as its embed code.
The snippet for the page
Yes, as embed code: in a rich text module, Insert, then Embed, paste the snippet and click Insert. HubSpot's embed takes an address only in oEmbed format, so it's the snippet, never the file's address. It needs Edit and Publish permission.
The pop-up
HubSpot's help says an embed with a <script> isn't supported at full width, and nothing more about scripts. Try it; if the button does nothing, use the snippet for the page.
The file itself
Not from HubSpot's own domain: its files tool serves an HTML file there as plain text, so it shows its source. HubSpot's answer is to connect a custom domain and serve the file from that, or put it elsewhere.

Checked October 2026, from HubSpot’s own help: Embed an external media fileUsing the files toolEdit content in rich text modules

Squarespace, Wix, Ghost and the rest: every platform, from its own help.

Questions

HubSpot and your demo.

Short answers about putting a demo on HubSpot.

Can I paste the file's address instead?

No. HubSpot's embed takes an address only in oEmbed format, which the file's isn't. Paste the snippet as embed code.

Can HubSpot host the file?

Not on HubSpot's own domain: its files tool serves an HTML file there as plain text, so it shows as code. HubSpot's developer docs say to connect a custom domain and serve it from that. Or put it anywhere else that serves a web page.

Who can add it?

Anyone with Edit and Publish permission for the page, by HubSpot's help.

Can the demo's leads go to HubSpot?

Yes. A lead form in the demo sends the viewer's email, and their name and company if you ask, to a HubSpot form of yours. Forms are Basic's and Pro's.

Does the pop-up work there?

HubSpot's help says an embed with a script isn't supported at full width, and nothing more about scripts. Try it: if the button does nothing, use the snippet for the page.

Good to know

Where it stops.

Over https
A page served over https won't show a frame from an http address, so give the snippet one that starts with https.
A server that won't be framed
Some servers keep what they serve out of other sites' frames. If the demo's box stays blank, the server holding the file has to allow it.
One address
The snippet finds the file at its address. Move or rename the file, and change the address in the snippet too.
The plans
Every plan exports the file and its snippet: Free one demo, with our mark. The pop-up and the lines for your analytics are Basic's and Pro's.

Record your first demo.

It's free to start. Add the extension and press record.