# How to add a cookie consent banner to a Duda website

> On Duda, paste the snippet in the side panel under More, then Settings, then Header HTML, in the Head HTML field, and republish. Custom code is available on Duda's Team plan and higher. Because Duda moves scripts lower in the page for speed, every tracking script must be marked with type="text/plain" and a data-cq-category, and Duda's own cookie notification should be switched off.

Source: https://cookiequiet.com/platforms/duda
Published: 2026-10-21
Publisher: Cookiequiet

## Steps

1. **Check your code access** Custom code is available on Duda's Team plan and higher. If an agency manages your site, it may need to give your account access to code.
2. **Copy your snippet** In the Cookiequiet dashboard, open your website and copy the install snippet: one script tag with your site key, data-consent-mode and data-auto-block set to 1, and defer.
3. **Paste it in Head HTML** In the editor's side panel, click More, then Settings, then Header HTML. Paste the snippet at the top of the Head HTML field and save.
4. **Mark every tracking script** Change each tracking script in Head HTML, Body End HTML and page-level Header HTML to type="text/plain" with a data-cq-category. Move any Google Analytics ID from Duda's settings to a marked tag.
5. **Turn off Duda's cookie notification** In Settings, then Privacy Settings, switch off the Activate cookie notification toggle so visitors see one banner.
6. **Add the Cookie preferences link** Drag an HTML widget into the site footer, which every page shares, and paste a link to #cq-preferences with the data-cq-show-preferences attribute.
7. **Republish and test** Republish the site, open it in a private window, click Reject all and check that no _ga or _fbp cookie is set. Accept all, reload, and check the consent log.

## Where to paste the snippet in Duda

Duda's custom code is available on Team plans and higher. In the editor's side panel, click **More**, then **Settings**, then **Header HTML**. The **Head HTML** field adds content to the head of every page; **Body End HTML** adds code before the closing body tag. Paste the snippet at the top of Head HTML, save, and republish:

```html
<script src="https://cookiequiet.com/cq.js" data-site="YOUR_SITE_KEY" data-consent-mode="1" data-auto-block="1" defer></script>
```

The head field takes `<script>`, `<link>` and `<meta>` tags; Duda drops other elements placed there. A single page can also have its own Header HTML (**Pages**, the page's settings icon, then **SEO**), which is for code that belongs to one page only.

If an agency or reseller manages your Duda site, your account may not have access to code. Ask them to add the snippet, or to give you developer access.

## Why every tracking script must be marked on Duda

Duda documents that it optimizes the order in which content loads and places scripts and consent banners lower in the page, and that consent apps therefore cannot stop code in the Head HTML from running before consent. In practice, on Duda you cannot rely on the snippet loading before other tags. You can rely on marking: a script with `type="text/plain"` never runs on its own, wherever Duda puts it, and Cookiequiet starts it after consent for its category.

So mark every tracking script in Head HTML, Body End HTML and page-level Header HTML. For the Google tag, both script tags change:

```html
<script type="text/plain" data-cq-category="analytics" src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXX"></script>
<script type="text/plain" data-cq-category="analytics">
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());
  gtag('config', 'G-XXXXXXX');
</script>
```

The Meta Pixel and TikTok pixel get `data-cq-category="marketing"`; a chat widget gets `functional`. The [guide to blocking scripts until consent](/guides/block-scripts-until-consent) shows the other patterns. Videos in an HTML widget can use `data-cq-src` instead of `src` on the iframe so they load after consent.

If you entered a Google Analytics ID in Duda's settings, Duda prints that tag itself and you cannot mark it. Remove it there and use the marked tag above, or route Google tags through [Google Tag Manager](/platforms/google-tag-manager) with Consent Mode.

## How does Duda's own cookie notification interact?

Duda's **Privacy Settings** (**More**, then **Settings**, then **Privacy Settings**) hold two related switches:

- **Activate cookie notification** shows every visitor a notification that information about their visit is collected in cookies; Duda does not describe per-category choices or a consent record for it. Turn it off once Cookiequiet is live, so visitors see one banner.
- **Enable cookie tracking on this site** is on by default. Turning it off stops Duda's own statistics and its Google Analytics integration, prevents personalization rules from adding cookies, and stops tracking code you have added. Third-party widgets such as social embeds still set cookies, as Duda notes. Most sites keep it on and let Cookiequiet hold the tags; turn it off only if you want no Duda statistics at all.

Duda's customizable privacy page (in the same settings) is separate from cookies; Cookiequiet's policies, written from the scan, can replace or complement it.

## How to add the Cookie preferences link

Duda shares the header and footer across all pages, and an HTML widget placed in either appears everywhere. Drag an **HTML** widget into the footer and paste:

```html
<a href="#cq-preferences" data-cq-show-preferences>Cookie preferences</a>
```

## How to test

1. Republish, then open the live site (not the editor preview) in a private window.
2. Click **Reject all** and check the cookies in the developer tools: `cq_consent` and nothing from Google or Meta.
3. Clear the cookies, click **Accept all**, reload: the marked tags run.
4. Check the consent log in the Cookiequiet dashboard.

Agencies running several Duda sites can use the Agency plan, €19 per month for 10 Pro websites and 5 team seats; a single site is free with geo-targeting included, and Starter is €3 per website per month.

## Questions

### Which Duda plan do I need to add the snippet?

Duda lists custom code as available on Team plans and higher. On sites managed by an agency, the agency decides whether your account can edit code.

### Why does Duda say consent apps cannot block code in the head?

Duda reorders scripts for performance and places them, and consent banners, lower in the page. Code that is not marked runs before consent. Marking each script with type text/plain solves this, because a marked script does not run until Cookiequiet starts it.

### Should I keep Duda's cookie notification?

No. Duda describes it as a notification that cookies are used, not as a per-category choice, and two banners confuse visitors. Switch it off in Privacy Settings once Cookiequiet is live.

### Should I turn off Enable cookie tracking on this site?

Only if you want no Duda statistics at all. It also stops Duda's Google Analytics integration and the tracking code you added. Most sites keep it on and let Cookiequiet hold their marked tags until consent.

## Sources

- [Duda Support: Custom Code](https://support.duda.co/hc/en-us/articles/26519250445079-Custom-Code)
- [Duda Support: Privacy Settings (cookie notifications and site cookies)](https://support.duda.co/hc/en-us/articles/26519925521431-Privacy-Settings)
- [Duda Support: What GDPR Compliance Tools Does Duda Offer?](https://support.duda.co/hc/en-us/articles/26519478203287-What-GDPR-Compliance-Tools-Does-Duda-Offer)
