Add the TermsFeed Free Cookie Consent code to every page through Custom Code, tag the scripts you add there, and decide on the Wix cookie banner. Cookie Consent holds only the tagged scripts you add in Custom Code. Wix adds its own analytics, its session cookies, and the trackers you connect in Marketing Integrations, and Cookie Consent controls none of them.

Wix runs Google Analytics, Google Tag Manager, the Meta Pixel, and the TikTok Pixel only through Marketing Integrations. Its Custom Code help page says these tracking scripts "do not work through custom code".

Setup takes 3 steps and about 20 minutes. Custom Code needs a published site with a connected domain, and a connected domain needs a Premium plan (a Studio plan for a site built in Wix Studio). Generate your code at termsfeed.com/cookie-consent with the generator defaults, which use express consent.

Add the code as a Custom Code entry on all pages, placed at the end of the body and loaded once per visit. Wix gives every new entry the code type Essential, which it loads before any consent, and Cookie Consent needs that type to show its consent banner at once.

  1. Open Settings in your site dashboard.
  2. Open Custom Code in the Development & integrations section.
  3. Click + Add Custom Code at the top right.
  4. Paste the Cookie Consent code into the text box and name the entry "Cookie Consent".
  5. Select All pages under Add Code to Pages, and choose to load the code once per visit.
  6. Select Body - end under Place Code in.
  7. Keep Essential on the Code Type tab and click Apply.

Keep the options you chose in the generator, as in this example. The example script address starts with https:, while the generator writes it without, and both forms load the same file.

<!-- Cookie Consent by TermsFeed https://www.TermsFeed.com -->
<script type="text/javascript" src="https://www.termsfeed.com/public/cookie-consent/4.2.0/cookie-consent.js" charset="UTF-8"></script>
<script type="text/javascript" charset="UTF-8">
document.addEventListener('DOMContentLoaded', function () {
cookieconsent.run({"notice_banner_type":"headline","consent_type":"express","palette":"dark","language":"en","page_load_consent_levels":["strictly-necessary"],"notice_banner_reject_button_hide":false,"preferences_center_close_button_hide":false,"page_refresh_confirmation_buttons":false,"website_name":"Example Store"});
});
</script>

<noscript>Free cookie consent management tool by <a href="https://www.termsfeed.com/">TermsFeed Generator</a></noscript>
<!-- End Cookie Consent by TermsFeed https://www.TermsFeed.com -->

<a href="#" id="open_preferences_center">Update cookies preferences</a>

Wix returns an Essential entry in the page HTML at once, according to the Wix Custom Embeds API. An entry set to load once loads only when the site first renders. An entry that loads on each new page adds the script again on every page change, and that second copy does nothing. Read about each part of the code in Install a Cookie Banner on Any Website.

Step 2: Tag the scripts you add in "Custom Code"

Tag each optional script that stores data in the browser or sends data to another company with its category. Add each one as its own Custom Code entry. Cookie Consent reads the tagged scripts once, when run() starts, and, in express mode, runs each optional one after the visitor accepts its category.

Use Custom Code only for tools whose own install guide supports it, such as HubSpot, whose tracking code guide has a Wix section. Replace HUB_ID with your HubSpot account ID in this HubSpot tracking code, tagged with tracking.

<script type="text/plain" data-cookie-consent="tracking" id="hs-script-loader" async defer src="https://js.hs-scripts.com/HUB_ID.js"></script>

Keep each tagged entry on All pages, Body - end, loaded once, and Essential, so the tagged script is in the page when run() starts. HubSpot asks for an entry that loads on each new page, which this setup does not use. With the entry loaded once, HubSpot records only the first page of each visit, because it counts a page view only when its code loads. Turn off the HubSpot consent banner and copy the other HubSpot steps from Block HubSpot Tracking Until Consent.

Choose between 2 consent banners on every page, or a single Cookie Consent banner with Wix tools following the default consent policy of the site. The Wix consent banner asks each visitor for consent to Wix Analytics, the trackers you connect in Marketing Integrations, and some apps. Wix does not give a guarantee that its consent banner blocks cookies from App Market apps or from elements outside its control.

Wix offers its consent banner through Usercentrics, from Privacy & Cookies in the dashboard. Its settings have a "Show banner" toggle, according to the Wix help page on cookie consent.

Keep the Wix consent banner on when you use Wix Analytics or Marketing Integrations. Visitors then answer 2 consent banners, one for Wix tools and one for your Custom Code. To show visitors a single consent banner instead, turn the Wix consent banner off with the "Show banner" toggle. Wix tools then run under the default consent policy of the site, which allows every cookie type unless a consent app changes it.

Keep the Code Type of the Cookie Consent entry on Essential in both cases, so Cookie Consent never depends on the Wix consent policy. While the Wix consent banner is on, Wix loads an entry of another type only once the visitor accepts that type in the Wix consent banner. Find how to tell the 2 consent banners apart in 2 Cookie Banners Appear on Your Site.

Keep the "Update cookies preferences" link at the end of the Cookie Consent entry, so visitors reopen the Preferences Center from every page. Wix places a Body - end entry at the end of the <body> element, after your site content. Change the text of the link, but keep the id open_preferences_center. Choose another way to open the Preferences Center from Add a Cookie Settings Link.

The checks assume express consent with page_load_consent_levels left out or at the generator value ["strictly-necessary"], and the "I decline" button shown. Check the published site on its connected domain.

  1. Close every private window, open your site on its connected domain in a new one, open Chrome DevTools, select the Network tab, type cookie-consent in the filter box, and reload. The loader cookie-consent.js, the script cookie-consent-code.js, and the ping appear, and the consent banner shows.
  2. Type the host of your tagged tool in the filter box, such as hs-scripts, and reload. No request appears before you answer.
  3. Click the "I agree" button. A request to that host, such as js.hs-scripts.com, appears without a page reload.
  4. Select the Application tab, open Cookies for your domain, and check that cookie_consent_level and cookie_consent_user_accepted exist.
  5. Click the "Update cookies preferences" link at the bottom of the page. The Preferences Center opens.

Close every private window and open a new one. Open DevTools with the Network tab filtered on the host of your tagged tool, load your site, and click the "I decline" button. Open a second page and confirm that the Network tab does not list any request to the host of your tagged tool. Run every other check from Check That Your Cookie Banner Works.

  1. An entry loads on each new page. A tagged script that Wix adds on a page change never runs. Read the load setting of each entry in Settings > Custom Code, and set every entry to load once.
  2. An entry has a code type other than Essential. While the Wix consent banner is on, the Cookie Consent banner waits until the visitor accepts that code type there, and a tagged script that arrives after run() never runs. Set the entry back to Essential.
  3. Google Analytics, Google Tag Manager, the Meta Pixel, or the TikTok Pixel sits in Custom Code. The Custom Code list shows an entry for one of these tools. Connect them in Marketing Integrations, where the Wix consent banner controls them while it is on.
  4. You test in the Editor preview. The Network tab of the preview does not show a cookie-consent.js request. Test the published site on your connected domain.
  5. The tagged script sits in an iframe. An Embed HTML element runs its code in an iframe, which Cookie Consent never reads, and the Elements tab shows the script inside an <iframe>. Put every tagged script in Custom Code.