Add it to your website
There are two ways to install the widget, and the Embed panel gives you the code for both:
- Floating button — one script tag. The widget opens from a button in the corner of every page, or from your own button. It works on any site where you can edit the HTML or paste code into a “custom code” or “code injection” box — which covers Framer, WordPress, Webflow, Squarespace, Shopify, Wix and hand-written HTML alike.
- Inline (iframe) — the widget sits inside a section of one page, like a form. You paste it into your builder’s Embed or HTML element, so it works even where custom code is not available. See Placing it inside your page.
If you are adding it to an app you build yourself, see Adding it to your own app.
Get your snippet
Section titled “Get your snippet”Your snippet is unique to your widget. Copy it from NineOffer rather than from this page.
-
Publish your flow. An unpublished flow has nothing for the script to serve, and the Embed panel withholds the snippet until you publish. See Publishing changes.
-
Open the Embed panel. It is in the Widget Builder, alongside the design and question panels.
-
Copy the snippet. The panel has a copy button; use it rather than selecting the text by hand, so you cannot truncate the widget ID.
-
Paste it into your site, immediately before the closing
</body>tag. -
Reload your page and confirm the widget appears.
What the snippet looks like
Section titled “What the snippet looks like”Roughly this, with your own widget ID in place of the example:
<script async src="https://app.nineoffer.com/widget.js?id=00000000-0000-0000-0000-000000000000" data-widget-id="00000000-0000-0000-0000-000000000000" data-show-button="true"></script>The widget ID appears twice on purpose: in the script address (?id=) and as
data-widget-id. If your site builder only lets you paste a script address and
no tag, use the address alone; the Embed panel has a Copy script address
only button for that. A caching plugin that strips query strings from scripts
leaves the attribute to carry the ID.
data-show-button is false when the widget is in custom button mode; the
Embed panel sets it for you.
Where to paste it
Section titled “Where to paste it”Immediately before </body>, on every page the widget should appear
on. If your site uses a shared footer include, put it there once.
Appearance → Theme File Editor → footer.php, before </body>. On a
managed host, use a header-and-footer-scripts plugin instead of editing
theme files directly, so a theme update cannot wipe it.
Project Settings → Custom Code → Footer Code. Publish the site afterwards; custom code does not take effect on the Designer preview.
Settings → Advanced → Code Injection → Footer.
Online Store → Themes → Edit code → theme.liquid, before </body>.
Site Settings → Custom Code → End of <body> tag, then publish.
Custom code does not run in the Framer canvas or preview, only on the
published site, and it may require a paid Framer site plan. If yours does
not include it, use the inline option
with Framer’s Embed component instead.
Settings → Custom Code → Add Custom Code. Paste the snippet, choose All pages, and place it in Body – end. Custom code needs a Wix premium plan with a connected domain.
Put it in the footer rather than the head. The script loads async and will not
block your page either way, but footer placement means it can find the elements
it needs to attach to.
Placing it inside your page
Section titled “Placing it inside your page”Choose Inline (iframe) in the Embed panel to get this version instead. It is a plain iframe, roughly:
<iframe src="https://app.nineoffer.com/w/00000000-0000-0000-0000-000000000000?layout=inline" title="Get an estimate" width="100%" height="420" style="border: 0; display: block;"></iframe>As with the script, copy your own from the Embed panel — the all-zeroes ID will not load anything.
-
Add an embed element where the widget should go — your builder’s Embed, HTML or Code element, placed in the section you want. In Webflow that is the Embed element, in WordPress the Custom HTML block, in Framer the Embed component.
-
Paste the iframe code into it. If the element asks for a URL rather than code, paste just the address from the
src="…"part. -
Give the element a height of 420 pixels if your builder sizes it separately from the code, and let it fill the width of its column.
-
Publish and check the live page.
The widget is 384 pixels wide and shrinks to fit a narrower column, such as on a phone. In a wider column it lines up left, centre or right according to the Widget position on page setting in the Embed panel — the same one that places the floating button.
Unlike the floating button, the inline widget is always showing: there is no launcher, and custom button mode does not apply. It appears only on the pages you place it on.
Sharing a link instead
Section titled “Sharing a link instead”Where you cannot add a script — a link in your Instagram bio, a QR code on a flyer, an email signature, a message to a customer — share the widget as a page of its own. In the Embed panel choose Share link, optionally type a title, and copy the link:
https://app.nineoffer.com/w/YOUR-WIDGET-ID?layout=page&title=Get%20an%20estimateThe widget opens centred on a plain page, with the title above it and in the browser tab. On a phone it fills the screen. It always shows your published flow, and leads it collects arrive under Leads like any other.
Using your own button
Section titled “Using your own button”If you set the widget to custom button mode in Widget Design, it will not render its own launcher. You trigger it from an element already on your page instead — your own “Get a quote” button.
In a site builder — Framer, Wix, Squarespace, Webflow — set the button’s
link to #nineoffer. Every builder lets you set a link, and that is all the
widget needs:
<a href="#nineoffer">Get a quote</a>Without editing the button at all, type a CSS selector for it into the
Existing button field in the Embed panel, for example #hero-cta or
.get-quote. It is added to the snippet as data-trigger, and the widget opens
when anything matching it is clicked, including buttons your site renders later:
<script async src="https://app.nineoffer.com/widget.js?id=YOUR-WIDGET-ID" data-widget-id="YOUR-WIDGET-ID" data-show-button="false" data-trigger="#hero-cta, .get-quote"></script>The Embed panel also shows the steps for Framer, Webflow, Wix, Squarespace, WordPress and plain HTML, with the right place to paste in each.
In your own HTML you can do the same, or add data-nineoffer-widget to any
element instead. The attribute goes on the element itself, not on the script
tag:
<button data-nineoffer-widget>Get a quote</button>The script still goes in the footer as above. Any number of elements can open
the widget, and elements added to the page later — by a slider or a single-page
app — work too. A page opened at a URL ending in #nineoffer opens the widget
straight away, so you can link to it from an email or an ad as well.
Both work with the floating launcher switched on, too: a “Get a quote” button in your page content can sit alongside the bubble in the corner.
This is worth the extra step. A call to action inside your page content is read; a floating bubble in the corner is frequently not.
Adding it to your own app
Section titled “Adding it to your own app”The widget runs in your visitor’s browser, so it does not matter what your
server is written in — Node, C#, Python, PHP or Ruby all install it the same
way. Put the snippet once in the layout template every page shares, just before
</body>.
| Framework | Layout file |
|---|---|
| ASP.NET (C#) | Views/Shared/_Layout.cshtml |
| Django | templates/base.html |
| Flask | the base template your pages {% extends %} |
| Express (Node) | your EJS, Pug or Handlebars layout |
| Rails | app/views/layouts/application.html.erb |
| Laravel | resources/views/layouts/app.blade.php |
The snippet is plain HTML, so it goes into any of these unchanged.
In Next.js, load it once from the root layout (app/layout.tsx):
import Script from 'next/script'
export default function RootLayout({ children }) { return ( <html lang="en"> <body> {children} <Script src="https://app.nineoffer.com/widget.js" data-widget-id="YOUR-WIDGET-ID" data-show-button="false" strategy="afterInteractive" /> </body> </html> )}In a Vite or Create React App project, paste the snippet into
index.html instead.
Then open the widget from any component:
<button onClick={() => window.NineOffer?.open()}>Get a quote</button>Paste the snippet into index.html, before </body>, and call
window.NineOffer.open() from your own button’s click handler.
Use the values from your own snippet in place of YOUR-WIDGET-ID and the
src. Set data-show-button="false" when you open the widget from your own
button, or leave it true to keep the floating launcher.
The JavaScript API
Section titled “The JavaScript API”Once the script has loaded, window.NineOffer has four functions:
| Call | Does |
|---|---|
NineOffer.open() |
Opens the widget. |
NineOffer.close() |
Folds it back. |
NineOffer.toggle() |
Opens it if closed, closes it if open. |
NineOffer.destroy() |
Takes the widget off the page. For an app that wants it gone on certain routes; a later snippet can load it again. |
A call made while the widget is still loading its design is held and carried
out as soon as it is ready. Before the script itself has loaded,
window.NineOffer does not exist yet — hence the ?. above.
In TypeScript, declare it once so the call type-checks:
declare global { interface Window { NineOffer?: { open(): void; close(): void; toggle(): void } }}export {}Keyboard and screen readers
Section titled “Keyboard and screen readers”The widget can be used without a mouse. Opening it moves focus inside, so pressing Enter on your button or the launcher lands the visitor on the first control. Escape folds it, including while focus is inside the widget, and focus returns to the button that opened it. On a phone, where the widget fills the screen, Tab stays inside it until it is folded.
Questions are announced as they appear. Choices are exposed as a radio group or checkboxes with the question as their label, the answer fields carry the question as their label, and the progress bar reports how far along the visitor is.
Tracking what visitors do
Section titled “Tracking what visitors do”The widget tells your page what is happening, so you can count it in Google Tag Manager, Google Analytics, Meta Pixel or your own code. Nothing is set up for you to turn on: the events are sent as soon as the snippet is on the page.
| Event | When | Detail |
|---|---|---|
open |
The widget is unfolded. | |
close |
It is folded again. | |
start |
The visitor presses the first button. | |
step |
A question comes up. | step, totalSteps |
lead |
A lead was saved. | leadId, total, currency |
error |
Sending failed. | reason |
totalSteps is the number of questions on the route as far as it is known: where a question branches it counts up to that question, then grows once the visitor picks a branch (the widget’s own “Step 2 of 8” does the same). Use step for drop-off, not totalSteps.
Every event also carries widgetId. The detail is only ever a step number, an
id and the estimate the lead was priced at — never an answer, a name or an email
address.
In Google Tag Manager, each event is pushed to the dataLayer as
nineoffer_open, nineoffer_start, nineoffer_step, nineoffer_lead and so
on, with the detail under nineoffer. Make a Custom Event trigger named
nineoffer_lead, add a Data Layer Variable nineoffer.total for the value, and
fire your conversion tag from it. A page with no dataLayer simply gets no
pushes.
In your own code, each is also a window event named nineoffer: and the
event name:
window.addEventListener('nineoffer:lead', (event) => { gtag('event', 'generate_lead', { value: event.detail.total, currency: event.detail.currency, })})With the inline widget (the iframe from Placing it inside your page) there is no script to turn the events into window events, so listen for the messages the iframe sends instead:
window.addEventListener('message', (event) => { const data = event.data if (data?.source !== 'nineoffer' || data.type !== 'event') return if (data.name === 'lead') console.log(data.detail.total)})Check event.origin against your widget address if the page also embeds other
frames.
Checking it worked
Section titled “Checking it worked”- The widget or your trigger button appears on the page after a reload.
- Opening it shows the first question of your published flow, not an older one.
- Completing the flow produces a lead under Leads.
Run through it once yourself, end to end, on the live site. It is the only check that covers the whole chain.
Sites with a Content-Security-Policy
Section titled “Sites with a Content-Security-Policy”Most sites have none and need nothing here. If yours sends a
Content-Security-Policy header (security plugins and some hosts add one), allow
the address your snippet loads from, shown in the Embed panel under
Not showing up on your site?. Below, https://app.nineoffer.com stands for
that address:
| Directive | Allow | Why |
|---|---|---|
script-src |
https://app.nineoffer.com |
Loads widget.js. |
connect-src |
https://app.nineoffer.com |
The script fetches your widget’s design. |
frame-src |
https://app.nineoffer.com |
The questions run in a frame. |
img-src |
data: |
Only if you chose a custom launcher icon. |
Nothing is needed in style-src: the script applies its styling without an
inline <style> element, so a policy without 'unsafe-inline' does not break it.
If the widget is blocked, the browser console names the directive that refused it.
Troubleshooting
Section titled “Troubleshooting”Nothing appears. The snippet is usually in the wrong place — confirm it is
inside <body>, not in the head or outside the tag entirely. On Webflow and
Squarespace, confirm you published after saving.
It appears, but the questions are wrong or out of date. The flow was edited but not published. The script always serves the current published version.
Nothing appears, and a speed or caching plugin is on. Plugins that delay or combine scripts (Cloudflare Rocket Loader, WP Rocket “delay JavaScript”, Autoptimize) can interfere. The script copes with the common ways they rewrite it, but if the widget still does not show, exclude widget.js from the plugin’s optimisation, and check the browser console for a line starting with [NineOffer].
It disappears after navigating to another page. Sites that replace the whole page body on navigation (Turbo, htmx boost, Livewire navigate) are handled: the widget puts itself back. If you still see it vanish, tell us which framework.
It overlaps something in the corner. Change the widget’s position under Widget Design, or switch to custom button mode.
It works on some pages and not others. The snippet is on a per-page template rather than a shared one. Move it into the layout or footer include your whole site uses.

