Skip to content

Cookie banner (GDPR, Consent Mode v2)

A cookie consent banner with an equally visible “Reject”, categories (analytics, marketing) and a button to change the decision. Passes consent to Google Consent Mode v2 and the dataLayer.

✦ Customize with AI
Plan required
Free
Setup time
~3 min
Complexity
simple
Used by
0
What this template does

The banner asks for consent the way European data protection authorities expect: “Accept” and “Reject” are equally visible, and “Settings” lets visitors enable only some categories. The decision is remembered for 12 months, and a small corner button or a footer link with the data-cmm-cookie-settings attribute lets them change it any time. Consent goes to Google Consent Mode v2, to the dataLayer and out as a cmm:consent event, so GA4, GTM and the Pixel can react to it. Important: the banner itself does not block scripts pasted into your pages — configure them to wait for consent (e.g. consent mode in GTM).

Key features
  • “Accept” and “Reject” equally visible
  • Categories: necessary, analytics, marketing
  • Google Consent Mode v2 (gtag consent update) and dataLayer
  • Change the decision: corner button, footer link or __CMM.cookieSettings()
  • Decision remembered for 12 months
  • Trackers injected by ClickMeMaybe wait for consent
Triggers
Fires when
on page load until a decision
Only on
Frequency
once per 12 months
Targeting
Devices
desktop, mobile
Visitor
new & returning
Consent
GDPR-aware
FAQ
Does the banner block Google Analytics?
It passes the decision to Google Consent Mode v2 and the dataLayer. If GA4 or GTM is pasted into your pages, enable consent mode there and they will wait. Trackers injected by ClickMeMaybe wait automatically.
How do I add a “Cookie settings” link in the footer?
Any element with the data-cmm-cookie-settings attribute opens the settings, e.g. <a href="#" data-cmm-cookie-settings>Cookie settings</a>.
How long is the decision remembered?
12 months. Then the banner asks again.
Installation

One snippet. ~3 minutes.

Use this template now or copy it into your dashboard. Drop the ClickMeMaybe snippet into your site's <head>, click "Publish", done.

Read installation docs →

Ready to publish?

Copy this template to your workspace, customize, and ship.

✦ Customize with AI

Stop guessing. Start converting.

Install in 5 minutes. Publish your first widget today.

Start Free Now