Skip to content

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.

Your snippet is unique to your widget. Copy it from NineOffer rather than from this page.

  1. 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.

  2. Open the Embed panel. It is in the Widget Builder, alongside the design and question panels.

  3. 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.

  4. Paste it into your site, immediately before the closing </body> tag.

  5. Reload your page and confirm the widget appears.

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.

Immediately before </body>, on every page the widget should appear on. If your site uses a shared footer include, put it there once.

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.

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.

  1. 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.

  2. Paste the iframe code into it. If the element asks for a URL rather than code, paste just the address from the src="…" part.

  3. 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.

  4. 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.

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%20estimate

The 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.

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.

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.

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.

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 {}

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.

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.

  • 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.

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.

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.