Add a cookie banner to every Framer page through a custom code script
Add the TermsFeed Privacy Consent cookie banner to a Framer site by adding its snippet as a custom code script placed in the head, then publishing the site. Framer offers positions at the start and the end of the head, and either one works for the snippet.
Setup takes 6 steps and about 15 minutes. You need edit access to the Framer project and your snippet, which the TermsFeed app shows under "Install link" on the Overview page of the consent banner. Make it first with Create a Consent Banner where the app holds none.
Step 1: Add the Privacy Consent snippet as a Framer custom code script
Add the snippet as a script for every page, never for selected pages only. A script limited to some pages runs on those pages only, as the Framer help page on custom code describes, and the other pages run with no consent banner.
- Open Project Settings and select the Custom Code tab. Older Framer help articles call it Site Settings.
- Click Add Script, or the + icon where the tab already lists a script.
- Name the script, such as "Privacy Consent".
- Choose the end of the
<head>tag as its placement, and keep the script on all pages. - Select Once. Privacy Consent runs one copy per page load, and a second copy only prints an error in the Console.
- Paste the snippet into the code field and save the script.
- Publish the site.
The field holds the snippet as the TermsFeed app gives it, with your own token in place of YOUR_TOKEN.
<!-- Privacy Consent by TermsFeed (https://www.termsfeed.com) -->
<script type="text/javascript" src="https://cdn.termsfeedtag.com/plugins/pc/v1/YOUR_TOKEN/plugin.js" async></script>
<!-- End Privacy Consent by TermsFeed (https://www.termsfeed.com) -->
A Content Security Policy meta tag in custom code stays at the start of the head, with the snippet after it, and it has to allow cdn.termsfeedtag.com. Copy every entry Privacy Consent needs from Content Security Policy.
Step 2: Remove the Framer "Cookie Banner" component
Delete the Framer "Cookie Banner" component from the site, so visitors answer one consent banner. Remove it from every layout or page that holds it, then publish.
That component runs its consent system through Google Tag Manager and Google Consent Mode, according to Framer. Privacy Consent sends Google Consent Mode v2 itself for Google Tag Manager or Google tags you add from their templates. Set that up with Set Up Google Consent Mode v2.
Step 3: Move Framer integrations into Privacy Consent vendors
Remove each tracking ID from the Framer settings and add the tool as a vendor, so it waits for consent. Framer prints the tag for an ID entered in its settings on every page, outside Privacy Consent. Google Tag Manager has no field there and sits in a custom code script, according to the Framer help page on Google Tag Manager.
- Open Project Settings and note the ID in the "Google Analytics Measurement ID" field.
- Clear that field, and delete every tracking script, such as Google Tag Manager, from the Custom Code tab.
- Add each tool as a vendor in the Vendors Manager, from its template where one exists.
- Publish the site again.
Framer Analytics, the traffic reporting built into Framer, runs through Framer with no snippet to move, and Privacy Consent does not hold it back. It uses no cookies and no persistent identifiers, according to the Framer help page on GDPR and cookies. Pick the template for each tool with Add From a Template, or build the vendor by hand with Add a Custom Vendor.
Step 4: Give "Embed" components in Framer replaceable tags
Write each third-party iframe as a replaceable tag inside an Embed component set to HTML, so it waits for consent and shows a placeholder until then. An Embed component set to a URL loads its iframe before consent.
The vendor id sits in the markup under "Important tags" on the vendor row in the Vendors Manager. The vendor needs "Has replaceable tags?" switched on, which the YouTube template does for you. Read where replaceable tags are available in Replaceable tags.
<termsfeed-privacy-consent-tag-iframe
data-termsfeed-pc1-vendor-id="termsfeed-1a2b3c4d-5e6f"
src="https://www.youtube-nocookie.com/embed/VIDEO_ID"
width="560" height="315" title="YouTube video" allowfullscreen>
</termsfeed-privacy-consent-tag-iframe>
Privacy Consent finds replaceable tags only in the page itself, once, when it starts. The tag works only where Framer writes the HTML into the page before that moment. A tag inside an iframe, or one that mounts later, stays empty. Check the placeholder on the published site, and read the rest in Replaceable Tags in TermsFeed Privacy Consent.
Step 5: Add a way back to the Preferences Center on Framer
Turn on the floating button of the consent banner, so every Framer page offers a way back to the Preferences Center. Open the Appearance page of the consent banner in the TermsFeed app, switch on "Use a sticky button to open the Privacy Preferences Center?", and save.
A footer link works too once the published page holds an element with the id open_privacy_preferences_element. Privacy Consent picks up that element even when it appears after the page loads. Set the id with a code override, or write the link with the id inside an Embed component set to HTML. Compare the methods with Reopen Preferences.
Step 6: Add both Framer hostnames to the consent banner
List each Framer hostname that carries the snippet under "Additional domains" on the Settings page in the TermsFeed app. Framer gives every published site a framer.app address, such as your-site.framer.app, according to the Framer help page on publishing. It loads the same custom code as your own domain. The consent banner loads only on the domains you add, the main website domain and the additional domains, so a framer.app address missing from the list shows none. Follow the steps in Multiple Domains.
How to verify Privacy Consent on Framer
Publish the site first and test the live page in a new private window, because Framer does not load Custom Code in the canvas preview. Run step 4 on a tool with an on-accept vendor tag or a replaceable tag, because a Google template loads its tag before the answer.
- Close every private window, open your published site in a new one, open Chrome DevTools, select the Network tab, type
termsfeedtagin the filter box, and reload.plugin.jsand 2settings.jsonrequests return status 200, and the consent banner shows. - Select the second
settings.jsonrequest and open its Preview tab. Theserviceablefield readstrue. - Select the Console tab. No line holds
[ee]or[ww]. - Type the host of a vendor you moved in the Network filter, such as
youtube-nocookie.com, and reload. No request appears before you answer. - Click I Agree. Requests to that host appear with no page reload.
- Type
events.pushin the Network filter. The last request, sent at your click, has status 201. - Click the floating button or your link. The Preferences Center opens.
Then check the refusal. Close every private window, open a new one with the Network tab filtered on the same host, load the site, and click I Decline. No request to that host appears on a second page. Read what each result means, and run the rest, with Verify Your Installation.
Common mistakes with Privacy Consent banner on Framer
Publish before you test, then look in the shared layout and Project Settings, where Framer keeps what still runs outside Privacy Consent.
- The site was not published. The Network tab on the live page does not list a
plugin.jsrequest. Publish the site. - The script runs on selected pages only. Other pages do not show a consent banner. Clear the page list of the script.
- The Framer "Cookie Banner" component stays in the layout. Visitors answer 2 consent banners. Delete the component and publish.
- A tracking ID stays in the settings. Framer prints the tag before consent, next to the vendor. Clear the ID and publish.
- An Embed component loads a URL. The iframe loads before consent. Set the component to HTML and write a replaceable tag.