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.
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).
- “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
- Fires when
- on page load until a decision
- Only on
- Frequency
- once per 12 months
- Devices
- desktop, mobile
- Visitor
- new & returning
- Consent
- GDPR-aware
Does the banner block Google Analytics?
How do I add a “Cookie settings” link in the footer?
How long is the decision remembered?
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.