Website embeds

Guides and example pages for adding a chat with your AI agent, a quote form, an enquiry form and more to your website.

These guides show you how to add Subcontext features to your website. Each guide covers installation, settings and troubleshooting, and includes example pages you can view, copy and download.

What you want on your website Guide
A chat window with your AI agent Webchat
A quote for one of your products, through to buying it Quote form
An enquiry form for a campaign, or a way to send leads from your own form Lead form
An AI helper beside a form, answering questions as people fill it in Form guide
The "Nurture with AI" adviser tool inside your portal or CRM Nurture
Your tools, offered to AI assistants in your visitors' browsers WebMCP
Your own server or code using the Subcontext API, with an access token Access tokens (OAuth)

Most installs start with a short snippet you copy from your Subcontext dashboard and paste into your page. The guides also cover the JavaScript options for developers who want more control.

To give every embed your colours and font, pass them all the same theme object. See Theming the embeds.

To keep an ad click from the page a visitor lands on until they fill in a form on another page, and to decide when the embeds may store it, see Ad clicks across pages.

Using the example pages#

Each embed's guide ends with an Examples page: webchat, quote form, form guide, lead form, Nurture and WebMCP. Each example is a single, complete web page with no other files. Choose View and copy to read its code, or Download to save it.

  1. Open an example and read the comment at the top. It says what the page shows and what to change.
  2. Replace the placeholders with your own values. They're in capitals, such as YOUR_AGENT_ID or lfk_YOUR_KEY, and each has a comment saying where to find it in your Subcontext dashboard. None of them are secret. They're the same values that appear in your website's code.
  3. Put the page on a test page of your website. Some embeds only work on websites you've told Subcontext about, so add that site's address first. Each guide says where. Opening the file from your computer won't work.

Some examples do real things, such as sending a lead, starting a quote, or texting or emailing a client. Use your own name, email address and phone number when you try them.

If your website has a content security policy#

A content security policy lists the places a website may load things from. If your website has one, allow Subcontext:

  • script-src https://js.subcontext.com
  • connect-src https://subcontext.com wss://subcontext.com

Some embeds need more. Each guide lists what.

Need help?#

Email hello@subcontext.com.

In this section

Stuck, or something missing?

Get in touch and a person on the team will help.

Contact us