AnveVoice

Add a Voice AI Agent to Shopware 6 (2026 Guide)

Add the AnveVoice voice agent to a Shopware 6 storefront by extending base.html.twig in a small plugin and the base_body_script block, with deploy steps.

How to add AnveVoice to a Shopware 6 storefront

Shopware 6 has no admin field for third-party scripts. You add the tag by extending the storefront's base.html.twig in a small plugin and using the base_body_script block. Shopware's docs ask for defer or async on external scripts, which the AnveVoice tag already has. Steps checked against the official documentation on 2026-10-14.

At a glance

  • Where the code goes: The base_body_script block of storefront/base.html.twig, overridden in a plugin
  • Coding needed: Yes, a minimal plugin with one Twig file; no JavaScript to write
  • Plan limits: Needs a Shopware setup where you can install your own plugin (self-hosted, or a managed platform that allows custom plugins)
  • Time: About 20 minutes for a developer, including build and cache steps

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. You also need command-line access to your Shopware project, or a developer who has it, because the template override ships as part of a plugin. Shopware's developer guide for adding JavaScript as a script tag is explicit about when to use this route: for example loading a script from an external CDN, and only when there is a technical reason to place it away from the bundled storefront JavaScript. A third-party widget is exactly that case. If your hosting is a managed Shopware platform, confirm with the provider that custom plugins can be deployed.

  • 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. Shopware recommends avoiding external script tags without defer or async because they block rendering; the AnveVoice tag already carries async. Code: <script src="https://anvevoice.app/embed.js?embedId=YOUR_EMBED_ID" async></script>

Create or reuse a plugin

Put the change in a plugin of your own (or in an existing project plugin) rather than editing the core Storefront files, which a Shopware update would overwrite. The hub's learning material shows the creation command, bin/console plugin:create, which scaffolds the folder under custom/plugins/<PluginName>. After you add the template below, register and activate the plugin with the commands in the steps.

  • 1. Scaffold the plugin — From the project root run bin/console plugin:create AnveVoiceEmbed (any name works). It creates custom/plugins/AnveVoiceEmbed with the standard structure.
  • 2. Add the template override — Create src/Resources/views/storefront/base.html.twig inside the plugin and extend the storefront template. Always call parent(), as Shopware's guide says, so the Storefront's own JavaScript keeps rendering. Code: {% sw_extends '@Storefront/storefront/base.html.twig' %} {% block base_body_script %} {{ parent() }} <script src="https://anvevoice.app/embed.js?embedId=YOUR_EMBED_ID" async></script> {% endblock %}
  • 3. Register and activate — Run bin/console plugin:refresh, then bin/console plugin:install AnveVoiceEmbed --activate.
  • 4. Clear the cache — Run bin/console cache:clear (or clear it from Settings > System > Caches & indexes in the Administration). Twig changes are not visible until the cache is rebuilt.

Where the script sits in the page

The base_body_script block in src/Storefront/Resources/views/storefront/base.html.twig renders near the end of the body, where the Storefront JavaScript is output. Placing your tag after parent() puts it after Shopware's own scripts, which Shopware's guide recommends unless your script needs access to Storefront code. The AnveVoice widget is self-contained, so the order does not matter functionally. Twig blocks are the only supported seam. If a block name differs on your version (the guide pages exist for 6.5, 6.6 and 6.7, and older ones are marked outdated), open the base template that ships with your installed Storefront and check the block names before you rely on them.

Consent and cookie settings

A script placed in base_body_script loads for every visitor as soon as the page renders. If your privacy policy requires consent before a voice assistant loads, that needs to be handled in your cookie-consent setup; it is separate from this install and depends on your legal advice and the consent tooling you use.

Check that it works

  • 1. Open the storefront in a private window — Use a guest session to avoid Administration previews and cached pages.
  • 2. Look for the button — The round microphone button appears bottom-right by default. Click it, allow microphone access (HTTPS is required) and ask about a product.
  • 3. Check the source — Search the page source for anvevoice.app/embed.js. If it is missing, the plugin is not active or the cache was not cleared.

Common problems on Shopware

  • Block does not output: the plugin is installed but not activated, or the template path is wrong. It must be src/Resources/views/storefront/base.html.twig.
  • Other storefront scripts disappear: parent() was left out of the block, which replaces the default output.
  • Change not visible: run bin/console cache:clear and, if your project uses a CDN or reverse proxy, purge it.
  • Works in development but not production: the plugin must be installed and activated in production too, and the storefront rebuilt according to your deployment process.

Sources

  • Shopware developer docs: add JavaScript as a script tag (https://developer.shopware.com/docs/guides/plugins/plugins/storefront/add-javascript-as-script-tag.html) — checked 2026-10-14
  • Shopware Hub learning: custom JavaScript for the storefront (https://hub.shopware.com/learn/unit/custom-javascript.md) — checked 2026-10-14

Related

  • How to add AnveVoice to Magento and Adobe Commerce
  • How to add AnveVoice to a PrestaShop store
  • How to add AnveVoice to a WooCommerce store
  • How to add AnveVoice to a BigCommerce store

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.