AnveVoice

Add a Voice AI Agent to Kentico Xperience

Add the AnveVoice voice agent to an Xperience by Kentico site through the shared Razor layout or the Tag Manager package, with consent and preview notes.

How to add AnveVoice to Xperience by Kentico

In Xperience by Kentico, the cleanest place for the AnveVoice tag is the shared Razor layout, _Layout.cshtml, so every page rendered through it loads the voice agent. If marketers should control the tag without a code release, the Kentico.Xperience.TagManager package lets them add it as a Custom code snippet in the admin UI. Steps checked against the official documentation on 2026-10-14.

At a glance

  • Where the code goes: ~/Views/Shared/_Layout.cshtml (or a Tag Management record with a Custom code snippet)
  • Coding needed: One Razor edit and a redeploy; none after setup if you use Tag Manager
  • Version note: Tag Manager package 6.1.0 targets Xperience 31.4.0 or later and .NET 8
  • Time: About 2 minutes of edits plus your normal deployment

What this guide covers

The steps follow the Xperience by Kentico documentation, where a site is an ASP.NET Core application whose pages are rendered through Razor views and a layout. Kentico's own guides place site-wide scripts in that layout. Older Kentico releases and sites built on the legacy Portal Engine are outside the pages we checked, so confirm the layout file location in your own project before copying paths. You need an AnveVoice embed ID. Create a free account at app.anvevoice.app, build your voice bot, and copy the ID from the dashboard. Replace YOUR_EMBED_ID in the tag below with it.

  • 1. Prepare the tag — Keep this line handy. The async attribute means it never blocks rendering, and the script ignores a second copy if two end up on one page. Code: <script src="https://anvevoice.app/embed.js?embedId=YOUR_EMBED_ID" async></script>

Method 1: edit the shared layout

Kentico's activity-tracking guide edits ~/Views/Shared/_Layout.cshtml and adds its tracking view component at the end of the head element. The AnveVoice tag can follow the same pattern or sit just above the closing body tag. Because the tag is asynchronous, either position works; the body position keeps it away from your head markup. Kentico's own tracking script is gated on visitor consent: its view component renders only when the current contact may be tracked. The AnveVoice tag is not gated automatically. If your cookie policy requires consent before third-party scripts, render it inside the same consent check or use Method 2 with a consent attached.

  • 1. Open the layout — In your web project, open Views/Shared/_Layout.cshtml. If your site uses several layouts, for example one for landing pages and one for articles, note each file that renders a full HTML document.
  • 2. Paste the tag — Add the AnveVoice script line directly above </body>. If you would rather keep third-party scripts together with Kentico's tracking component, put it just before </head> instead.
  • 3. Rebuild and deploy — Razor changes ship with your application, so build and deploy through your normal pipeline. Nothing needs configuring inside the Xperience administration.

Method 2: Tag Manager package

The Kentico.Xperience.TagManager package, published on NuGet, adds a Tag Management application to the administration. Its listing describes registering the services in Program.cs and then creating records that render at chosen positions on the page. This route suits teams where editors, not developers, should add or remove tags.

  • 1. Install and register — Add the Kentico.Xperience.TagManager package, then call builder.Services.AddKenticoTagManager(builder.Configuration) in Program.cs. The listing pairs package 6.1.0 with Xperience 31.4.0 or later on .NET 8, so check the version matrix for older projects.
  • 2. Create the record — Open the Tag Management application, create a record, name it, choose the channel, and select Custom code snippet. Paste the AnveVoice tag as the full code.
  • 3. Choose location and consent — Pick Bottom of the body for the render position. Attach a consent if your site requires one, and leave the content type filter empty to render on all pages, or select specific content types to limit it.
  • 4. Enable rendering — Tick Enable tag rendering and save. The listing says snippets show on live pages once their consent is accepted; by default they do not display in admin preview or the Page Builder.

Preview, Page Builder and consent behaviour

Tag Manager records have a setting for where they appear: admin preview, Page Builder, both, or neither, with neither as the default. That default is why editors sometimes report that the voice button is missing while they edit even though the live site shows it. For a voice agent you generally want visitors to see it on the live channel only, so the default is usually right. When a visitor changes their consent, the page does not re-render by itself. The package documents a JavaScript call, window.xperience.tagManager.updateCodeSnippets(), that refreshes the rendered snippets after a consent change. Wire that call into your consent banner if you gate the tag.

Check that it works

  • 1. Load a live page — Open a public page in a private window so you are not carrying an admin session, and accept consent if your banner appears.
  • 2. Find the button — A round microphone button should appear bottom-right. Click it, allow the microphone, and ask something your site answers.
  • 3. Confirm one script — In browser developer tools, search the page for anvevoice.app/embed.js. It should appear once. If it appears twice, the layout and a Tag Management record both contain it.

Common problems

  • Nothing renders after editing the layout: the change has not reached the running server yet, or the page uses a different layout file than the one you edited.
  • Tag Manager record saved but invisible: Enable tag rendering is unticked, the consent is not accepted, or the content type filter excludes the page you are testing.
  • Button shows on pages but not in the editor: expected, since preview and Page Builder display is off by default for Tag Manager records.
  • Microphone prompt never appears: the site must be served over HTTPS, including your staging hostname.

Sources

  • Xperience by Kentico docs: Enable activity tracking (layout and head placement) (https://docs.kentico.com/guides/development/activities-and-marketing/enable-activity-tracking) — checked 2026-10-14
  • Kentico.Xperience.TagManager package (NuGet listing) (https://www.nuget.org/packages/Kentico.Xperience.TagManager) — checked 2026-10-14

Related

  • How to add AnveVoice to a DNN site
  • How to add AnveVoice to a Grav site
  • How to add AnveVoice to a ProcessWire site
  • How to add AnveVoice to a plain HTML website

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.