Nuxt is the most popular Vue framework. CookieChimp installs via theDocumentation Index
Fetch the complete documentation index at: https://docs.cookiechimp.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
app.head config so the script lands in <head> on every server-rendered page, then reinitializes on client-side navigation.
Before you start: have your CookieChimp Account ID ready (replace
YOUR_ACCOUNT_ID in the snippets below). If you're testing on localhost, add localhost to Additional Domains in your Account Settings — otherwise the banner won't show locally.How do I load the CookieChimp script?
Add the script tonuxt.config.ts under app.head.script. Set it to render at the top of <head> so nothing else runs first.
tagPriority: "critical" hint asks Nuxt’s useHead to render this script as early as possible in <head>, before other third-party tags.
How do I handle client-side navigation?
Nuxt uses client-side routing for in-app navigation. Create a Nuxt plugin that re-injects the CookieChimp script on every route change so it rescans the newly mounted route’s DOM. The static script fromnuxt.config.ts handles the initial page load, so we skip the first afterEach call.
The
.client.ts suffix tells Nuxt to only run this plugin in the browser — document doesn’t exist during server rendering.How do I add a Privacy Trigger container?
Add a<div id="cookiechimp-container"> to your root layout (layouts/default.vue or app.vue) so it stays mounted across all pages:
How do I check consent status in code?
Use a composable that listens forcc:onConsented and cc:onUpdate:
Replace
"Google Analytics" and "analytics" with the exact service and category names you configured in CookieChimp.Troubleshooting
- Banner shows on first load but not after navigation — make sure your
cookiechimp.client.tsplugin is in theplugins/directory and uses the.client.tssuffix. - Script loads too late — keep
tagPriority: "critical"and make sure no other third-party scripts use a higher priority.
- Banner doesn't appear at all — confirm
localhost(or your domain) is in Additional Domains in Account Settings. - Enable Debug mode in the CookieChimp dashboard and check the browser console for logs.