AnveVoice

Add a Voice AI Agent to Statamic (2026 Guide)

Add the AnveVoice voice agent to a Statamic site by putting one script tag in layout.antlers.html (or the Blade layout), with static cache notes.

How to add AnveVoice to a Statamic site

Statamic wraps every page in a layout view, so you add the AnveVoice tag once to that layout, near the end of the body. By default the layout is resources/views/layout.antlers.html. Clear the static cache afterwards if you use it. Steps checked against the official documentation on 2026-10-14.

At a glance

  • Where the code goes: resources/views/layout.antlers.html (or layout.blade.php), just before the closing body tag
  • Coding needed: Paste one line into a view file; deployment of the file required
  • Plan limits: None: Statamic sites are your own Laravel codebase
  • Time: About 5 minutes

Before you start

Sign up at app.anvevoice.app (Free plan: $0, 50,000 tokens a month, one bot, no card) and copy your embed ID. Statamic's control panel manages content, not front-end markup, so there is no script box in the CP; the change lives in a view file in your project. Statamic's views documentation says views are stored in resources/views and that the layout holds the shared markup, such as the head section, header, navigation, footer and JavaScript includes. Template content is inserted where the layout places the {{ template_content }} variable. The docs also show adding a script tag near the end of the body of the layout, which is the pattern to follow here.

  • 1. Copy your install tag — Replace YOUR_EMBED_ID with the ID shown in your AnveVoice dashboard (app.anvevoice.app). Optional URL parameters are &position=bottom-left and &theme=dark. Code: <script src="https://anvevoice.app/embed.js?embedId=YOUR_EMBED_ID" async></script>

Method 1: the default Antlers layout

  • 1. Open the layout — Edit resources/views/layout.antlers.html. Statamic uses this file unless you tell it otherwise.
  • 2. Find the end of the body — Scroll to the closing body tag. Any existing site scripts, such as /js/site.js, will usually sit just above it.
  • 3. Paste the tag — Add the AnveVoice tag on a new line below your site's own scripts. The tag contains no curly braces, so Antlers leaves it exactly as written.
  • 4. Deploy and clear caches — Ship the file to your server. Then clear Statamic's caches: in the control panel open Utilities > Cache Manager, or run php please static:clear if you use static caching, and php artisan view:clear for compiled views.

Method 2: a Blade layout or another layout

Statamic renders views ending in .blade.php with Blade instead of Antlers, so a Blade site would put the same tag in layout.blade.php. You can also point the whole site at a different layout in config/statamic/system.php, and individual entries or sections can choose another layout through the layout variable. Wherever you add the tag, remember that every layout you use needs it; a second layout without the tag will not show the voice button. If you build with partials, create a small partial such as _voice.antlers.html holding the tag and include it from each layout with the partial tag. Statamic recommends an underscore prefix for files that exist only as partials. That keeps the embed ID in one place when several layouts exist.

Statamic-specific points

Static caching is the usual surprise. If you serve pre-generated HTML through Statamic's static caching, existing cached pages keep their old markup until the cache is cleared or regenerated, so the button will seem to be missing on some URLs and present on others. Clearing the static cache after the deploy resolves this. Environment control: if you only want the assistant live on production, wrap the tag in a check for your environment, for example a Blade @production directive or an Antlers condition on a config value, so local development and staging stay quiet. Headless Statamic: if you use Statamic only through its API or GraphQL for a separate front end, the layout is not involved, and the tag belongs in that other front end.

Check that it works

  • 1. Open a few URLs in a private window — Try the home page, an entry page and a collection index.
  • 2. Use the voice button — The round microphone button should appear bottom-right. Allow the microphone (HTTPS required) and ask about your content.
  • 3. Check the HTML — Search the source for anvevoice.app/embed.js; it should appear once.

Common problems on Statamic

  • Button missing on some pages: those pages use a different layout, or are served from stale static cache.
  • Change not live: the view file was edited locally but not deployed, or compiled views are stale; run php artisan view:clear.
  • Tag appears twice: it exists in the layout and in a partial that the layout also includes.
  • Antlers error on save: a stray curly brace was pasted next to the tag; the tag itself contains none.
  • No microphone prompt on a local test: browsers treat localhost differently from a live HTTP site; test on an HTTPS URL.

Sources

  • Statamic docs: views, layouts and templates (https://statamic.dev/frontend/views) — checked 2026-10-14
  • Statamic docs: views (Markdown version) (https://statamic.dev/frontend/views.md) — checked 2026-10-14

Related

  • How to add AnveVoice to a Craft CMS site
  • How to add AnveVoice to a Laravel application
  • How to add AnveVoice to an Umbraco site
  • How to add AnveVoice to a Drupal site

Try AnveVoice on your site

Free plan: $0, 50,000 tokens a month, no card. Get your embed ID in the dashboard, then paste one tag.