Let visitors change their consent choice from any page of your site
Give visitors a way back to the TermsFeed Privacy Consent Preferences Center with a floating button, a link on your pages, or a JavaScript call. The consent banner does not return once a visitor answers, so without one of these a visitor who clicked I Agree has no way to change the choice. The General Data Protection Regulation (GDPR) requires that withdrawing consent is as easy as giving it, in Article 7(3).
A way back matters for visitors who never saw the consent banner too. Under the "Standard" consent logic, visitors outside the opt-in regions load every vendor without being asked, and the Preferences Center is their route to refuse.
3 ways to open the Preferences Center
Privacy Consent opens its Preferences Center from a floating button it adds, from an element of your page, or from a JavaScript method. All 3 open the same place, where the visitor switches vendor categories and vendors and clicks Save Preferences. The visitor reads the label "Privacy Preferences", since the name "Preferences Center" appears only in these docs and the app.
| Method | What you do | When to use it |
|---|---|---|
| Floating button | Turn on a switch on the Appearance page | You do not edit templates, or some pages have no footer |
Element with the ID open_privacy_preferences_element |
Add a link or a button to your footer | Most sites: a plain link beside your Privacy Policy |
window.termsfeed_privacy_consent.v1.openPrivacyPreferences() |
Call the method from your own code | Menus and components built in JavaScript |
Method 1: Turn on the floating Privacy Preferences button
Turn on "Use a sticky button to open the Privacy Preferences Center?" on the Appearance page, then click "Save Appearance". Privacy Consent then shows a "Privacy Preferences" button on every page, for every visitor, whether or not that visitor answered.
The button is off on a new consent banner. On "Card", "Bar", and "Panel" it sits 16px from the bottom, on the side you picked for "Banner position". On "Simple" and "Headline" it sits 12px from the bottom right corner. Move it away from a chat widget with Custom CSS.
Method 2: Add a link with the open preferences ID
Add an element with the ID open_privacy_preferences_element to your pages, and a click on it opens the Preferences Center. Put it in the footer template, so it appears on every page. This link keeps the visitor on the page.
<a href="#" id="open_privacy_preferences_element">Privacy Preferences</a>
Follow these rules for the element.
- Use a link or a button. An
<a href="#">or a<button type="button">takes the keyboard focus, and a<div>or<span>with the ID does not. - Keep the address empty or
#. Privacy Consent stops anhref="#"link from jumping to the top of the page, and any other address takes the visitor away. - Use the ID once per page. Give a second link on the same page the class
termsfeed-pc1-open-privacy-preferencesinstead. - Add it at any time. A footer that your theme or framework renders after the page loads works as well as one in the HTML.
Menu editors in WordPress and Shopify give a menu item no ID field. Add the link through a Custom HTML block, a footer widget, or the footer template of your theme instead.
Method 3: Call the JavaScript method
Call window.termsfeed_privacy_consent.v1.openPrivacyPreferences() from your own click handler to open the Preferences Center from a menu or component that your code builds. The method takes no arguments and returns nothing.
This button checks that the script has loaded before it calls the method, so a click during page load does not throw an error.
<button type="button" onclick="window.termsfeed_privacy_consent && window.termsfeed_privacy_consent.v1 && window.termsfeed_privacy_consent.v1.openPrivacyPreferences()">Privacy Preferences</button>
The method does nothing until Privacy Consent is ready. A call before that prints [ee][478058ef] in the Console tab and is not queued, so call it from a click and not during page load. Hand a component to your developer with the JavaScript API Reference.
Where to put the preferences link
Put the link in the footer of every page, beside the links to your Privacy Policy and Cookies Policy. Visitors look for privacy controls there, and a site-wide footer reaches every page with a single edit.
Name the link plainly, such as "Privacy Preferences", which matches the wording in the Preferences Center, or "Cookie Settings". A link that appears only on your Privacy Policy page adds a step and hides the control. Pages with no footer, such as checkout steps and landing pages, need the floating button instead.
What 2 steps from any page means
A visitor withdraws consent in 2 steps from any page: open the Preferences Center, then change the vendor categories and click Save Preferences. The first step is a click on your link or the floating button. The second step takes at least 2 clicks, one on a toggle and one on Save Preferences, so a withdrawal takes 3 clicks in total.
Count the steps from the deepest page of your site, such as an old blog post or an order confirmation. A link missing there adds steps for every visitor who lands on it. The saved answer applies at once to consent signals and in full on the next page load, because a script that already ran on the page stays running until then. Run the full test with Easy Consent Withdrawal.
How to add and test a preferences link
Adding and testing a way back takes 5 steps and about 10 minutes. You need the snippet on your website, and edit access to your footer or to the Appearance page.
- Turn on the floating button on the Appearance page and click "Save Appearance", or add the link or button to your footer template.
- Publish the change and clear the page cache of your site.
- Open your website in a new private window, click I Agree on the consent banner, and go to a page deep in your site.
- Open Chrome DevTools and click your link or the floating button. Confirm in the Elements tab that
#termsfeed_pc1_preferences_centerappears at the end of<body>. - Switch off the Analytics vendor category and click Save Preferences. Select the Network tab, filter for
events.push, and confirm a new request with status 201. Then select the Application tab, open Local storage, select your origin, and read the keytermsfeed_privacy_consent_state, where theanalyticsentry shows"enabled":false.
The visitor now has a working route on that page. A new floating button reaches a visitor who loaded the settings in the last hour within 1 hour. Fix a link that opens nothing with Preferences Not Opening.