OpenCart 2.3–4.1 extension

Supreme Cookie Consent

A cookie banner that gives visitors an equal choice: Accept all, Reject all, or Customise by category. Nothing you pasted in as tracking code runs until the visitor agrees, Google Consent Mode v2 starts at "denied", every decision is logged, and a privacy centre lets visitors ask for a copy of their data or for its erasure. Not legal advice: check the wording and your set-up with your own adviser.

$20
Supreme Cookie Consent — overview

For OpenCart 2.3, 3.0, 4.0 and 4.1

What the visitor sees

  • A banner (a bar across the bottom, or a box at the bottom left or right) with Reject all, Customise and Accept all as equal-sized buttons, your privacy policy link and your own text if you want one.
  • Customise opens a dialog with Strictly necessary (always on), Preferences, Analytics and Marketing. It works with the keyboard (Escape closes it, Tab stays inside it) and returns focus to the button that opened it.
  • After the choice a small "Cookie settings" button lets the visitor change or withdraw it at any time. Any link in your theme with the attribute data-ccn-open opens the same dialog.
  • The choice is remembered (30 to 395 days, you set it) and everything is asked again when you raise the policy version number.
  • Works on phones: buttons are at least 44 pixels tall and the page never scrolls sideways.

Scripts that wait

  • Paste your analytics, preferences and marketing code (script tags, pixel images) in the module settings. It is added to the page only after the visitor allows that category, and not at all after Reject all.
  • Scripts already in your theme wait too: mark them type="text/plain" data-ccn="analytics" (or preferences, marketing); an iframe waits with data-ccn and data-ccn-src.
  • If a visitor withdraws a category they had allowed, the page reloads so the code does not run again.
  • Google Consent Mode v2: analytics storage, ad storage, ad user data, ad personalisation and personalisation storage are set to denied before any other tag, then updated with the choice. A dataLayer event (ccn_consent_update) tells Google Tag Manager on every page.

Consent log and numbers

  • Every decision is stored: a random visitor id, the choice, the policy version, the date and a one-way hash of the visitor's network address (kept only to stop abuse). No name, e-mail or full address.
  • The admin page shows the last 30 days (accepted all, rejected all, customised, allowed analytics or marketing, withdrawn), a paged log and a CSV export. Old rows can be deleted after a number of days you choose.

Privacy centre

  • Visitors send a request for a copy of their data or for erasure from the cookie settings. You see the requests in the module page, mark them done or delete them, and answer them yourself. Check who is asking before you send or erase anything: the form does not prove who the person is.
  • A visitor cannot flood the log or the requests, a hidden trap field catches simple bots, and the same open request is stored once. Answered requests are removed after the retention time you set.

Safe by design

  • Admin only settings: viewing needs Access, saving needs Modify. Text you type is cleaned; the policy link must be an https/http address or a path of your shop.
  • Pasted code is shown escaped on the settings page and is placed into the page as data, so it cannot break out of the banner script.
  • All storefront wording is in one language file: copy it into another language folder and translate the right-hand side.
  • The log and the requests tables are kept if you uninstall.

Notes

  • Anyone who may modify this module can put code on every page of your shop, including checkout. Give that permission with care.
  • No region targeting: the banner is shown to every visitor.
  • Cookies that were already set by a script the visitor then withdraws are not deleted by the module; the script simply does not run again.
  • The abuse limits (30 decisions and 5 requests an hour per address) use the address the web server sees. Behind a proxy or CDN that hides visitor addresses, all visitors share the limit.
  • Code that other modules or your theme add to the page without the data-ccn mark is not stopped.

Screenshots

Supreme Cookie Consent — Storefront banner
Storefront banner
Supreme Cookie Consent — Storefront preferences
Storefront preferences
Supreme Cookie Consent — Admin settings part 1
Admin settings part 1

More modules

You May Also Need.

Supreme Account Dashboard

Turn the plain "My Account" page into a real customer area: a menu beside every account page, the customer's own figures, recent orders they can buy again with one click, and clear icon tiles.

See all OpenCart modules