Add a Voice AI Agent with Google Tag Manager
Load the AnveVoice voice agent through Google Tag Manager with a Custom HTML tag, an All Pages trigger, Preview mode and publishing, plus consent caveats.
How to add AnveVoice using Google Tag Manager
If Google Tag Manager is already on your site, add AnveVoice as a Custom HTML tag that fires on every page view, test it in Preview, then Submit and Publish. You never edit the site's code again. Steps checked against the official documentation on 2026-10-14.
At a glance
- Where the code goes: GTM workspace → Tags → New → Custom HTML, trigger on page views
- Prerequisite: The Google Tag Manager container snippet is already installed on every page
- Go live: Submit → Publish and Create Version; nothing fires until published
- Time: About 5 minutes if GTM is already installed
When this route makes sense
Use Google Tag Manager if your marketing team already manages scripts there, if you cannot edit the site's templates, or if you want to switch the voice agent on and off without a developer. If GTM is not installed yet and you can edit your site, installing the AnveVoice tag directly is simpler and one fewer thing to break. You need two things: the embed ID from your dashboard at app.anvevoice.app (the Free plan is $0, no card), and edit access to the right Google Tag Manager container.
Step 0: make sure the container is installed
Google's instructions for a web container say to paste the first snippet as high in the head tag as possible, and the second snippet immediately after the opening body tag, on each page of the website. Content management systems and site builders often offer a setting that does this once for you. If the tag is missing on a page, nothing you create in the workspace will run there. Google's install dialog also has a Test field where you enter your site address to confirm the container loads.
Create the AnveVoice tag
- 1. Open the workspace — Go to tagmanager.google.com, pick the container for your website and open the Workspace tab.
- 2. Start a new tag — Click Tags, then New, then Tag Configuration, and choose Custom HTML.
- 3. Paste the install tag — Paste the AnveVoice script exactly as given. Google asks that JavaScript sits inside script tags in this field, which the tag already does. Code: <script src="https://anvevoice.app/embed.js?embedId=YOUR_EMBED_ID" async></script>
- 4. Choose the trigger — Under Triggering, pick the Page View trigger that fires on All Pages. With no filters, a page view trigger fires on every page; add a Page URL filter only if the agent should appear on certain sections.
- 5. Name and save — Call the tag AnveVoice voice agent and click Save.
Test in Preview, then publish
Nothing you save in a workspace is live until you publish it, so start in Preview. Click Preview at the top right to open Tag Assistant, enter your site's address and click Connect. Your site opens in a new window; return to Tag Assistant and click Continue to see which tags fired. Look for the AnveVoice tag marked as fired on the page view, then confirm the microphone button appears on the connected site.
- 1. Submit the workspace — Click Submit at the top right and choose Publish and Create Version.
- 2. Name the version — Enter a clear version name such as Add AnveVoice and a short description, then click Publish.
- 3. Review history — Open Versions to confirm the Published column shows today's date. GTM keeps a publish history of who published which version.
Things that can stop it firing
- Consent settings: if your cookie banner blocks tags until consent, the AnveVoice tag will wait too. Decide whether a voice widget needs consent in your region and set the tag's consent settings to match.
- Ad blockers and privacy extensions often block the GTM container itself, which hides every tag inside it, including AnveVoice. Test in a clean browser profile.
- Single-page sites: the page view trigger fires on the first load. The AnveVoice script ignores a second copy on the same page, so it is safe if another trigger fires the tag again.
- Trigger filters: a filter that is too narrow, such as a URL that does not match the live path, means the tag never fires.
Check that it works
- 1. Use a clean browser window — Open the published site in a private window with extensions off.
- 2. Look for the button — A round microphone button appears bottom-right unless you set a position in the URL. Click it, allow the microphone and ask a question.
- 3. Re-open Preview if it is missing — Tag Assistant shows whether the tag fired and which trigger caused or skipped it.
Common problems
- Tag fires in Preview but not live: you saved but did not publish. Use Submit, then Publish and Create Version.
- Tag shows as not fired: the container may not be installed on that page, or the trigger filter excludes it.
- Two buttons: AnveVoice is also installed directly in the site code. Remove one copy to keep things tidy.
- Microphone blocked: pages must be served over HTTPS for microphone access.
Sources
- Google Tag Manager Help: Install a web container (https://support.google.com/tagmanager/answer/14847097) — checked 2026-10-14
- Google Tag Manager Help: Custom HTML tags (https://support.google.com/tagmanager/answer/6107167) — checked 2026-10-14
- Google Tag Manager Help: Publish a container version (https://support.google.com/tagmanager/answer/6107163) — checked 2026-10-14
- Google Tag Manager Help: Preview and debug containers (https://support.google.com/tagmanager/answer/6107056) — checked 2026-10-14
Related
- How to add AnveVoice to a plain HTML website
- How to add AnveVoice to a WordPress site
- How to add AnveVoice to a site hosted on Netlify
- How to add AnveVoice to a Shopify 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.