Cookie Consent Banner
GDPR/CCPA-compliant consent with category opt-ins. Replaces Cookieyes.
Live preview
See it in action.
Fully interactive, drag, click, scroll inside the frame, toggle to mobile.
About this section
A polished cookie consent banner with three categories (Necessary, Analytics, Marketing, plus optional Functional). Bar slides in from the bottom on first visit; Customize opens a modal with toggle switches per category. Saves consent in localStorage and dispatches a modblo-consent:updated event with the granular state so your analytics / marketing tags can self-gate. Re-prompts after a configurable number of days. Public window.cbConsent API for footer 'Cookie preferences' links.
Install in 90 seconds
- 01
Create /sections/modblo-cookie-consent.liquid.
- 02
Paste the section code and save.
- 03
Add `{% section 'modblo-cookie-consent' %}` to theme.liquid (just before </body>) so it runs on every page.
- 04
Wrap your analytics / marketing tags so they only fire when consent is granted. Example: document.addEventListener('modblo-consent:updated', e => { if (e.detail.analytics) loadGoogleAnalytics(); }).
- 05
(Optional) Add a 'Cookie preferences' link in your footer with data-modblo-cc-trigger so visitors can re-open the modal anytime.
The Liquid
Unlock the section code
Cookie Consent Banner is a premium section. Get the full Liquid + scoped CSS paste-ready.
One-time purchase · Lifetime updates · You own the code
Theme editor settings
| Setting | Type | Default |
|---|---|---|
Bar heading bar_heading | text | We use cookies |
Bar message bar_message | textarea | , |
Privacy policy link policy_url | url | , |
Accept label accept_label | text | Accept all |
Reject label reject_label | text | Reject all |
Customize label customize_label | text | Customize |
Modal heading modal_heading | text | Cookie preferences |
Modal subtext modal_sub | textarea | , |
Show 'Functional' category show_functional | checkbox | false |
Re-prompt after N days revisit_days | range | 180 |
Background bg | color | #ffffff |
Foreground fg | color | #0b0b0c |
Accent accent | color | #6366f1 |
SEO & accessibility notes
- Real <button> and <input type="checkbox"> with proper labels, keyboard accessible.
- Aria-modal labeled, focus-trappable in dialog.
- Stores consent in localStorage only, no first-party cookie required by the consent banner itself.
- Re-prompt frequency configurable to match GDPR refresh recommendations (typically 6-12 months).
- Public window.cbConsent.get() API lets you read consent state from any script.
Related
