How to add a cookie consent banner to a Framer site
In Framer, open Site Settings (called Project Settings in older docs), go to the custom code section, add a script with its placement set to Start of head tag, paste the snippet, save and publish. Framer's built-in analytics sets no cookies, so the tags to mark are the ones you add yourself: Google, Meta, chat widgets and embeds.Steps
Where to paste the snippet in Framer
Framer adds site-wide code from the site settings, with a placement choice for each entry.
- Open Site Settings (older Framer articles call it Project Settings) and go to the custom code section: it appears as the Code tab in Framer's current guides and as the Custom Code tab in older ones.
- Click Add Script (or the + icon), paste the snippet, and set Placement to Start of head tag, Pages to All and Run to Once.
- Save, then Publish: custom code runs on the published site only.
html<script src="https://cookiequiet.com/cq.js" data-site="YOUR_SITE_KEY" data-consent-mode="1" data-auto-block="1" defer></script>
Start of head is the earliest placement Framer offers, which is what a consent script needs: it must run before any tag that sets cookies.
How to handle Framer's analytics and the tags you add
Framer Analytics. Framer's built-in analytics does not use cookies or persistent identifiers: it hashes the IP address and user agent with a secret that changes every day, and Framer states that no cookie consent is needed to use it. There is nothing to mark on that side.
Tags you add. Everything else goes through the same custom code panel, so you decide how it loads:
- Marked (nothing loads before consent): add the Google tag or the Meta Pixel as a second entry with
type="text/plain"anddata-cq-category="analytics"or"marketing"on each script tag. Cookiequiet runs them once the category is granted. - Consent Mode (the Google tag loads with denied defaults and sends cookieless pings until consent): put Google's default consent block in the same entry as the Google tag, above it, so the default is always in place, as shown in the Google Analytics 4 guide.
When several entries use the Start of head placement, open the published page source and check that the Cookiequiet snippet is printed first. If it is not, give the tag entry the Start of body placement instead; a marked tag works from anywhere, and the default consent block must simply precede the Google tag.
Embeds. In an Embed component with HTML, write the iframe with data-cq-src instead of src: Cookiequiet sets the address after consent. Framer's native video and map components build their own iframes with JavaScript; the auto-blocker holds the known ones (YouTube under marketing, Vimeo under functional) until the category is granted, which the test below will confirm for your site.
Chat widgets. Mark their loader with data-cq-category="functional" (or marketing when the vendor also uses it for advertising).
How to add the Cookie preferences link
Add a text link labelled "Cookie preferences" in the footer and set its URL to #cq-preferences. Framer treats hash links as page anchors; if the published link no longer carries that exact href, use an Embed component containing <a href="#cq-preferences" data-cq-show-preferences>Cookie preferences</a> in the footer, or turn on the floating preferences button in the banner settings.
How to test
- Publish, then open the published site in a private window and click Reject all.
- Check the cookies in the developer tools:
cq_consentand nothing from Google or Meta. - Clear the cookies, click Accept all, reload: the marked tags run and their cookies appear.
- Open the consent log in the Cookiequiet dashboard.
The banner does not show in Framer's preview; it needs the published site.
What is specific to Framer
- Published only. Custom code and the banner only exist on the published site, including a staging publication if you use one.
- No built-in banner. Framer has no consent banner; marketplace components that add one should be removed before you publish with Cookiequiet.
- Localization. The code applies to every locale; the banner's language follows the visitor's browser, with every string editable per language.
- Content Security Policy. If you set one through Framer's custom headers, allow
https://cookiequiet.cominscript-srcandconnect-src.
If you are unsure what your site loads, the free cookie scanner lists it from the published pages.