How to add a cookie consent banner to Unbounce landing pages
In Unbounce, add the snippet under Settings, then Script Manager, with the placement set to Head, on your custom domain: it then runs on every page published there. Script Manager scripts load after page-level scripts, so mark the scripts in your pages with type="text/plain" and a data-cq-category, and use either Unbounce's built-in cookie banner or Cookiequiet on a domain, not both.Steps
Where to paste the snippet in Unbounce
Unbounce's Script Manager applies a script to every page of one or more custom domains, including pages you publish later. Click Settings in the left menu, then Script Manager, then Add a Script, and:
- Name the script and click Add Script Details.
- Set Placement to Head.
- Set Included on to main pages and confirmation dialogs (both).
- Paste the snippet:
html<script src="https://cookiequiet.com/cq.js" data-site="YOUR_SITE_KEY" data-consent-mode="1" data-auto-block="1" defer></script>
- Tick the domains on the right and click Save Changes.
Script Manager requires your own custom domain: Unbounce does not support it on the unbouncepages.com test domain, so connect a domain before you go live with the banner.
Why page-level scripts must be marked
Unbounce documents that global scripts from Script Manager load after the scripts added in your page variants. A Google tag or Meta Pixel pasted into a page's JavaScripts panel therefore runs before Cookiequiet, and it would set its cookies before anyone answers the banner. Two ways to fix it:
- Mark them where they are. Change each opening tag to
<script type="text/plain" data-cq-category="analytics">(ormarketingfor ad pixels). A marked script does not run until Cookiequiet starts it after consent, whatever its position. - Move them to Script Manager, below the snippet, marked the same way, and remove them from the pages. Unbounce recommends removing page-level copies when you move a script, so it does not run twice.
For the Google tag, both script tags change:
html<script type="text/plain" data-cq-category="analytics" src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXX"></script><script type="text/plain" data-cq-category="analytics">window.dataLayer = window.dataLayer || [];function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', 'G-XXXXXXX');</script>
Conversion scripts on confirmation dialogs or thank-you pages need the same marking. If you run Google tags through Google Tag Manager, Cookiequiet's data-consent-mode="1" sets Google's defaults to denied and its cq_consent dataLayer event can trigger the tags; see the Google Tag Manager guide. More patterns are in the guide to blocking scripts until consent.
Unbounce's cookie banner or Cookiequiet?
Unbounce has a built-in banner under Settings, then Cookie Banner, switched on per domain. It offers Accept All, Reject All and Manage Preferences, with Strictly Necessary, Experience Consistency (the cookie that shows a returning visitor the same A/B or Smart Traffic variant), Analytics, Marketing and Preferences. When it is on, Unbounce serves its own cookies only after consent, and it sets Google Tag Manager's consent state to denied until the visitor chooses. Unbounce also lists its limits: the banner's style cannot be changed, it is in English with no translation setting, and it does not manage third-party cookies such as those of ad platforms.
Use one banner per domain. If you choose Cookiequiet, switch Unbounce's banner off for that domain and click Publish. Be aware of the trade-off: Unbounce's own cookies (A/B variant consistency and visitor counting) are controlled by its banner only, so without it they are set as before. In exchange you get a banner in 24 languages styled to your brand, a consent log, a cookie scan and policies written from it, and Consent Mode v2 for the tags you mark. The free cookie scanner lists what your pages set either way.
How to add the Cookie preferences link
In the Classic Builder, select a text link or button, open its action, choose Go to URL, enter #cq-preferences and set the target to the same tab, then save and republish. Unbounce documents the same pattern for relaunching its own banner, and Cookiequiet opens its preferences centre from any link with that address.
How to test
- Publish, then open a page on your custom domain in a private window.
- Click Reject all and check the cookies in the developer tools:
cq_consentand nothing from Google or Meta. - Submit a form and check the confirmation dialog: no conversion pixel fires before consent.
- Clear the cookies, click Accept all, reload: the marked tags run. Check the consent log in the dashboard.
Cookiequiet is free for one website with geo-targeting included, and Starter costs €3 per website per month with no pageview limit, however much paid traffic your pages get.