Start with 100 FREE messages

Embed a chat widget anywhere your HTML allows a script tag

Asyntai gives you a single line of markup that turns any webpage into a conversational surface. Place the embed code in your header, a template partial, or a tag manager container — the widget renders automatically on every page the tag reaches.

Preview the embedded widget on your own pages

Type your URL below and see exactly how the chat widget would render once the embed code is in place

Embed mechanics

To embed a chat widget, you use the same pattern every developer already knows

The embed code follows the same convention as Google Analytics, a Facebook Pixel, or a Hotjar recorder. A single asynchronous script tag referencing your unique site identifier. No npm package, no build step, no framework adapter, no server-side rendering hook. If the page can parse HTML, the widget can live there.

  • Async loading preserves render orderThe embed tag carries the async attribute, which means your page content paints first. The chat launcher appears after the document is interactive, never blocking layout or delaying the elements visitors came to see.
  • Framework-agnostic by designStatic HTML, server-rendered PHP, a React SPA, a Next.js hybrid, a Jekyll static site, a Django template — the embed code does not care what produced the markup. It bootstraps from the global document scope independently of your application lifecycle.
  • Scoped CSS prevents style collisionsThe widget encapsulates its own styles. Your stylesheet cannot accidentally bleed into the chat interface, and the widget's styles cannot override your buttons, fonts, or layout. Both worlds stay visually independent after the embed.
Embed chat widget code snippet in HTML
Embed chat widget placement across CMS platforms
Where to place it

You can embed a chat widget through any CMS header field — that is all you need

The embed code belongs in the HTML head section. Every mainstream platform provides a way to reach that section without touching raw theme files: WordPress has a header-scripts field or plugin, Shopify has theme.liquid, Wix and Squarespace offer code-injection panels, Webflow has a project-level custom-code area. The widget activates the moment the tag is present.

  • CMS header fieldsWordPress Customizer header scripts, Shopify theme.liquid head block, Squarespace code injection, Wix custom code under Settings, Webflow project settings custom code, Ghost code injection, HubSpot CMS site header HTML — all of these accept the embed tag verbatim.
  • Tag manager containersGoogle Tag Manager, Matomo Tag Manager, or Tealium iQ can fire the embed code as a custom HTML tag. Trigger it on "All Pages" and the widget appears sitewide without modifying your theme at all.
  • Direct template editingFor custom-built sites, the embed tag drops into your master layout template — base.html, layout.php, _document.tsx, application.html.erb — wherever the shared head block lives. One edit, every route covered.
Installation

The exact embed code and where it goes

After signing up, your Asyntai dashboard generates the embed code pre-filled with your site identifier. Copy it and paste it before the closing </head> tag in your site. Here is the structure of the tag you will receive.

  1. Create a free Asyntai account and locate the embed code on the Install tab of your dashboard.
  2. Open whatever surface controls your site's head section — CMS field, theme file, or tag manager.
  3. Paste the embed code before the closing head tag and save.
  4. Open your site in a fresh browser tab. The chat launcher renders in the corner, confirming the embed succeeded.
your-template.html
<!-- Asyntai embed chat widget -->
<script src="https://asyntai.com/widget.js"
  data-id="your-site-id" async>
</script>

# Embed complete. Widget active on every page this head reaches.

Embed chat widget — FAQs

Practical questions developers and site owners ask before they embed a chat widget.

Can I embed the chat widget on specific pages instead of sitewide?

Yes. If you place the embed code inside a template that renders on specific routes only — a product-page layout, a help-center shell, a pricing template — the widget will appear exclusively on those pages. Alternatively, use a tag manager trigger to fire the tag on URLs matching a pattern (e.g., /products/* or /help/*) and leave it off everywhere else.

Does the embed code conflict with other third-party scripts on my page?

No. The widget loads in its own isolated scope and does not attach to your global namespace beyond a single configuration object. It coexists with analytics scripts, advertising pixels, consent management platforms, A/B testing tools, and other chat or support widgets without interference. The scoped CSS strategy prevents style collisions in both directions.

Can I embed the widget through Google Tag Manager instead of editing my theme?

Yes — create a custom HTML tag in GTM, paste the embed code, set the trigger to "All Pages" (or a specific page group), and publish the container. The widget appears wherever the container fires. This is the preferred method for marketing teams who manage third-party scripts centrally without developer involvement.

What happens if I accidentally embed the code twice on the same page?

The widget detects duplicate initialization and only boots once. If both your theme template and a tag manager fire the embed code, a single widget instance renders. No duplicate launchers, no console errors, no doubled message traffic. The deduplication is built into the loader script.

Does the embedded widget support multiple languages automatically?

Yes. The widget interface ships localized in 36 languages, and the AI identifies each visitor's language from their opening message. You embed once; the widget adapts per visitor. A Portuguese-speaking visitor sees Portuguese UI labels and receives Portuguese answers, while a Swedish visitor on the same page sees Swedish — no per-language embed codes or configuration flags required.

Can logged-in users receive personalized responses from the embedded widget?

On Standard and Pro plans, populate window.Asyntai.userContext with visitor-specific attributes before the embed script executes. The AI uses those attributes — name, plan, account status, recent activity — to personalize every response for that session. Your application controls what data is exposed; the widget only reads what you explicitly push.

How much does it cost to embed the chat widget?

The embed code itself is free and unlimited — you can place it on as many pages as your site has. Pricing is based on monthly conversation volume: 100 messages free, $39 per month for 2,500 messages on Starter. The number of sites the widget can cover scales with the plan tier: 1 free, 2 Starter, 3 Standard, up to 10 on Pro.

Where do conversations and captured leads go after embed?

Every conversation flows into your Asyntai dashboard in real time, tagged with the page URL where it originated. When the AI captures a visitor's email during a handoff, the contact and full transcript are stored together. Email notifications deliver the same data to whatever inbox you configure, making it easy to route into your CRM or support tool without additional integration work.

Embed chat widget — the anatomy of one line of code that changes how your site communicates

Embedding a chat widget on a website is, at its mechanical core, a trivially simple act: place a script tag in the HTML head, save, and the widget appears on every page that tag reaches. The same motion you would perform to add a tracking pixel or a font stylesheet adds a fully functional AI-powered conversation layer to your site. Yet the simplicity of the embed step masks a surprising amount of depth in what happens afterward — how the widget initializes, how it stays out of the way of your existing markup, how it loads content from a remote intelligence layer, and how it adapts its behavior per visitor and per page. This walkthrough traces that arc from the first paste to the running experience, because understanding the embed is really understanding the architecture of how modern third-party tools integrate with websites without asking permission from the tech stack.

The embed code itself is a standard HTML script element with two attributes: a source URL pointing to the widget loader hosted on Asyntai's infrastructure, and a data-id attribute containing the unique identifier assigned to your site when you registered. The async attribute tells the browser to download and execute the script without blocking anything else on the page. This means the visitor sees your hero section, your navigation, your images, your interactive elements — everything renders on the normal timeline. The chat launcher materializes in the designated corner only after the page is already interactive. From a performance standpoint, the embed behaves identically to how Google Tag Manager, a Meta conversion pixel, or a Hotjar recorder integrates: it rides along without interfering with the critical rendering path.

What happens after the browser executes the embed tag is worth tracing because it explains why the widget feels instant despite loading after the page. The loader script checks the data-id attribute, calls the Asyntai configuration API with that identifier, and receives a payload containing the widget's visual settings (color, position, avatar, welcome message), behavioral rules, and a reference to the knowledge base trained on your content. The loader then injects the widget's UI into the document inside a shadow-like scope, attaches its own stylesheet that cannot collide with your page's CSS, and renders the launcher button. All of this completes in roughly the time it takes for a single round-trip network request. The visitor perceives the launcher appearing naturally as the page settles, not as a delayed afterthought.

CSS isolation is the engineering detail that separates a professional embed from a fragile one. Websites carry wildly different stylesheets — some use Tailwind utility classes, some use Bootstrap, some use hand-rolled CSS with aggressive selectors, some use CSS-in-JS with runtime injection. A chat widget that dumps its own styles into the global scope risks being overridden by your reset stylesheet, or worse, overriding your carefully crafted buttons and typography. The Asyntai widget encapsulates its interface in a way that your styles cannot reach inward and the widget's styles cannot leak outward. The practical benefit: you will never debug a scenario where embedding the chat widget broke your navigation dropdown or where your font-family declaration turned the chat text into a serif it was never meant to be.

Placement flexibility for the embed chat widget is broader than most guides suggest. The canonical location is the head element, where most installations land. But the tag also functions when placed at the bottom of the body, inside a div loaded by a tag manager, or injected dynamically by a consent-management platform after the visitor accepts non-essential cookies. For teams operating under GDPR, you configure your consent tool to inject the embed chat widget code upon acceptance, and the widget initializes only for consenting visitors — no special integration required.

Tag manager deployment is the dominant method for marketing teams who manage scripts centrally. In Google Tag Manager, paste the embed chat widget code into a custom HTML tag, set the trigger to "All Pages" or a specific URL condition, and publish the container. The widget goes live without touching your site's source code. For organizations where theme changes require a developer sprint and QA, tag-manager embedding compresses the deployment timeline from days to minutes.

Single-page applications present a wrinkle that the embed chat widget handles transparently. In an SPA built with React, Vue, or Angular, navigation occurs via client-side routing — the URL changes but the page does not reload. The widget detects route changes and re-evaluates its configuration accordingly: welcome messages update per route, auto-trigger rules re-fire if the new path qualifies, and conversation context persists. You embed the chat widget once in the shell document and it stays coherent across every navigation event.

The intelligence behind the embed chat widget is what makes the code worth placing. Once live, the widget answers visitor questions from the knowledge base you trained during setup — your crawled pages, your uploaded documents, your written behavioral instructions. The embed code is the delivery vehicle; the AI is the payload. A visitor opening the chat on your pricing page and asking a comparative question receives an answer grounded in your published pricing content. A visitor on your documentation hub asking a troubleshooting question receives step-by-step guidance sourced from your technical articles. The widget does not generate responses from general internet knowledge; it is constrained to the material you provided. That constraint is what makes the embedded chat trustworthy enough to deploy on a business-critical page without supervision.

Multilingual behavior activates automatically when you embed a chat widget through Asyntai, with no per-language configuration. The widget interface localizes into 36 languages based on visitor interaction. When a Japanese visitor types a question in Japanese, the interface labels shift to Japanese and the AI composes a Japanese response synthesized from whatever language your documentation is written in. When a Dutch visitor types in Dutch, the same happens in Dutch. You do not need separate embed codes per language, separate widget instances per locale, or a translation plugin running alongside the chat. The single embed code you placed once handles the full linguistic range of your global audience.

Personalization through User Context adds a runtime dimension to the embed that static content cannot replicate. On Standard and Pro plans, your application populates a window.Asyntai.userContext JavaScript object before the embed script fires. That object carries whatever visitor-specific attributes you choose to share: a first name, an account tier, a subscription renewal date, a recent order identifier, a role within a team. The widget reads those attributes on initialization and incorporates them into every AI response for that session. The mechanism is push-only — your application writes the data; the widget reads it — so there is no API credential to manage, no database connection to configure, and no risk of the widget accessing more data than you intended. For logged-in experiences, this transforms the embedded widget from a generic FAQ surface into a contextually aware assistant.

Lead capture is the business outcome that justifies the embed for most commercial sites. Visitors who have questions but no immediate path to answers leave silently — they do not fill out contact forms, they do not write emails, they do not call phone numbers listed in the footer. The embedded chat widget intercepts that departure by offering a conversational alternative. The visitor asks a question, receives an immediate answer, and when the conversation reaches a natural handoff point — a request beyond the AI's scope, a demo inquiry, a custom quote — the widget collects the visitor's email and optionally a phone number. That lead, along with the full conversation transcript, lands in your Asyntai dashboard and, if email notifications are enabled, directly in your team's inbox. The transcript gives your follow-up team more context than any form submission ever could.

Analytics produced by the embedded widget become a feedback loop for your website's content strategy. The dashboard surfaces which pages generate the most chat volume, which questions visitors ask most frequently, which topics the AI resolves confidently versus which require escalation, and what language distribution your actual audience exhibits. Over weeks, these patterns coalesce into a clear editorial roadmap: the FAQ answer that needs expanding, the product description that is generating confusion, the pricing detail that is buried too deep for visitors to find organically. The embedded chat widget is not only answering questions — it is telling you which parts of your website need rewriting to make those questions unnecessary in the first place.

Pricing aligns with usage rather than with the act of embedding. The embed code itself is free to place on as many pages as your site contains. What scales with cost is conversation volume: 100 messages per month on the free tier, 2,500 messages at $39 per month on Starter, scaling upward from there. Site limits also tier with the plan — 1, 2, 3, or up to 20 distinct websites under a single account — relevant for agencies or multi-brand operators who embed the widget across a portfolio. Compared to per-seat pricing on human-staffed live chat platforms, where adding a third shift or a second language multiplies agent costs, the per-conversation model stays flat regardless of when or in what language the conversations happen.

The teams that benefit most from embedding a chat widget share a common profile: they have pages that attract visitors with questions, and they lack the staff or the hours to answer every one of those questions in real time. SaaS companies embed on marketing sites and product documentation to catch trial-conversion and onboarding questions. Ecommerce stores embed across product and policy pages to resolve pre-purchase hesitation. Service businesses embed on landing pages and portfolio sites to qualify inbound interest while the team is busy delivering for existing clients. Educational institutions embed on admissions and course-catalog pages to handle the volume of prospective-student inquiries. In every scenario, the embed converts a static page into a responsive surface, and the AI handles the conversational labor that the team cannot staff around the clock. The entire transformation starts with a single line of markup placed in the head of your HTML document.