Add a cookie banner to every Webflow page through the "Head code" field
Add the TermsFeed Privacy Consent cookie banner to a Webflow site by pasting its snippet into the Head code field of the site settings, then publishing the site. Site-wide custom code needs an active Site plan or a paid Workspace plan (Core, Growth, Agency, or Freelancer), according to Webflow, and a role of Site manager or Designer.
Setup takes 6 steps and about 15 minutes. Copy your snippet from "Install link" on the Overview page of the consent banner in the TermsFeed app, or begin with Create a Consent Banner.
Step 1: Paste the Privacy Consent snippet into the Webflow "Head code" field
Paste the snippet into the site-wide Head code field, never the custom code of one page. Page custom code loads Privacy Consent on that page only, and the other pages do not show a consent banner.
- Open Site settings for your site.
- Select the Custom code tab.
- Paste the snippet into the Head code field, with no
<head>tags around it. - Click Save changes.
- Publish the site to every domain it uses.
The field holds the snippet as the TermsFeed app gives it, with your own token in the address. Visitors receive it only after the publish.
<!-- 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) -->
Step 2: Remove other consent tools from Webflow
Remove every other consent tool from the site, so visitors answer one consent banner. Webflow ships no consent banner of its own and leaves that job to a consent app, an integration, or your own custom code, according to its tracking consent article. Uninstall the consent app, delete any consent banner component from the page, and remove the old code from the Head code and Footer code fields.
Webflow Analyze and Optimize follow a tracking setting of their own, under Insights > Settings > Tracking. With "Don't track by default" selected, they wait for a call to the Webflow Browser API, as the Webflow tracking settings article shows. Privacy Consent does not make that call, so they stay off for every visitor until your own code calls wf.allowUserTracking(). Run that code from the answer callbacks in Callbacks and Consent Semantics.
Step 3: Move Webflow integrations into Privacy Consent vendors
Remove each tracking ID from the Webflow integration settings and add the tool as a vendor. Webflow prints the tag for an ID it holds on every page, outside Privacy Consent, so it runs before the visitor answers.
- Open Site settings > Apps & Integrations > Google Analytics, note the measurement ID, and delete it.
- Clear any other tracking ID on the same tab, such as the ID under Meta Pixel, and remove the Google site tools app where you connected it.
- Click Save and publish the site.
- Add each tool as a vendor in the Vendors Manager, from its template where one exists.
A template form asks only for the IDs of its tool. Pick one in Add From a Template, and build a vendor for any other tool with Add a Custom Vendor.
Step 4: Give "Code Embed" elements in Webflow replaceable tags
Write each third-party iframe as a replaceable tag inside a Code Embed element, so it waits for consent and shows a placeholder until then. The Webflow Video, YouTube, and Map elements print their own iframe, which loads before consent, so replace each one with a Code Embed.
This YouTube embed uses a replaceable tag. Copy the vendor id from 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.
<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 turns the tag into a real iframe once the visitor accepts the vendor, with no page reload. The element around the Code Embed sets the size of the placeholder, so give it a height. Set up the rest with Replaceable Tags in TermsFeed Privacy Consent.
Step 5: Add a Privacy Preferences link on Webflow
Give a link in your footer the id open_privacy_preferences_element, so visitors reopen the Preferences Center from every page. A footer in a Webflow component shows on every page that uses the component.
- Open your site footer in the Designer.
- Add a Text Link with the text "Privacy Preferences".
- Type
#as the URL of the link. - Open the Element settings panel and type
open_privacy_preferences_elementin the ID field. - Publish the site.
The floating button of the consent banner does the same with no design change. Compare the methods with Reopen Preferences.
Step 6: Add both Webflow hostnames to the consent banner
List the your-site.webflow.io address and your own domain on the consent banner. Webflow publishes to both, and each one loads the same Head code. Add the second one with "+ Add domain" under "Additional domains" on the Settings page in the TermsFeed app.
A missing hostname does not hide the consent banner, and the Analytics page does not count its banner loads. An answer on the webflow.io address does not carry over to your domain, because Privacy Consent keeps each answer in the storage of one origin. Plan for it with Multiple Domains.
How to verify Privacy Consent on Webflow
Publish the site first, then test on your own domain in a new private window, because site custom code goes live only when you publish. A freshly created consent banner has the Strict consent logic, so it asks every visitor. The Standard consent logic usually does not show a consent banner to a visit from the US. Set up that test with Test Visitor Location.
Choose a tool with an on-accept vendor tag or a replaceable tag for the wait check. A Google tag from its template loads before the answer, by design, in Consent Mode, and its _ga cookie in the Application tab appears only after I Agree.
- 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 your "Privacy Preferences" link. The Preferences Center opens.
A false value in the serviceable field goes with [ww][05cfcfb6] in the Console, and the script stops there. Review the status of the consent banner in Enable, Disable, Delete.
Repeat the load on the webflow.io address, then check the refusal. Close every private window, open a new one with the Network tab filtered on the same host, load your site, and click I Decline. Open a second page, and no request to that host appears. Run the other checks in Verify Your Installation.
Common mistakes with Privacy Consent on Webflow
Publish first, because your domain serves only the last published version, then look for what Webflow still prints by itself.
- The site is not published. The Network tab on your domain does not list a
plugin.jsrequest. Publish the site to the domain you test. - The snippet sits in page custom code. Only that page shows the consent banner. Move the snippet to the site-wide Head code field.
- The Google Analytics integration still holds the measurement ID. Analytics requests appear before you answer, and every page view counts twice after you accept. Delete the ID under Apps & Integrations.
- A native Video or Map element stays on the page. Its iframe loads before consent. Replace it with a Code Embed that holds a replaceable tag.
- The old consent tool still loads. Visitors answer 2 consent banners. Remove the app and its code from the custom code fields.