Magento

The module shows the banner across the whole store, cached pages included, holds the trackers of your extensions until consent and is set per website and per store view.

Compatibility: Magento Open Source and Adobe Commerce 2.4.4 to 2.4.9

Free, included in every plan. Download optooki-magento.zip

Before you start

Create the site in the Optooki dashboard, set up the banner and publish it: the plugin shows the latest published version. The getting started guide covers it in five minutes.

Installation

  1. Install the module

    Unzip optooki-magento.zip into app/code/Optooki/CookieBanner, at the root of your Magento installation, then enable the module and update the store:

    mkdir -p app/code/Optooki/CookieBanner
    unzip optooki-magento.zip -d app/code/Optooki/CookieBanner
    bin/magento module:enable Optooki_CookieBanner
    bin/magento setup:upgrade
    bin/magento cache:flush
  2. Or with Composer

    The archive is also a Composer package: put it in a folder of the project (for example packages/), declare it, then install the module. In production mode, then run setup:di:compile and setup:static-content:deploy as for any extension.

    composer config repositories.optooki artifact packages
    composer require optooki/module-cookie-banner
    bin/magento setup:upgrade
    bin/magento cache:flush
  3. Connect the store to Optooki

    Stores → Configuration → Optooki → Cookie Banner, Connection group: paste the server URL and the site ID, found in the Installation tab of the Optooki dashboard, save, then click Test the connection. The test also tells you when the banner is suspended.

    With the scope switcher at the top of the page, each website and each store view can have its own Optooki ID.

  4. Check on the store

    Open your site in a private window: the banner appears. If it does not, see troubleshooting.

What the plugin does

  • The banner first in the <head> of every public page, before any other script, never in the administration.
  • Google Analytics, Meta, Hotjar, Microsoft Clarity, LinkedIn and TikTok held until consent, even when added by another extension or by the theme. Can be turned off.
  • YouTube and Vimeo videos in your content replaced by a placeholder until consent.
  • Pages served by the built-in page cache or by Varnish carry the banner. Saving the settings clears the page cache.
  • A “Manage cookies” link in the footer links of the Luma and Blank themes, which can be turned off.

Button and cookie list

In a CMS page or block (Content → Pages), write [optooki_cookie_list] for the table of cookies and [optooki_preferences] for a button that reopens the preferences (attributes label and class). A menu link to #optooki also reopens the preferences, on any theme.

Cookie Restriction Mode and Google Analytics

The Optooki banner replaces the Magento notice. When Cookie Restriction Mode is on (Stores → Configuration → General → Web → Default Cookie Settings), the module hides that notice and passes the visitor’s choice to it: accepting analytics allows Magento’s Google Analytics and Google Ads modules, from the next page; a refusal turns them off. Setting Pass the choice to the Cookie Restriction Mode, on by default.

Without that mode, the banner holds Google Analytics and Google Ads itself as long as the service is declared in your Optooki dashboard, and Google Consent Mode v2 passes the choice to Google tags.

Content security policy

Nothing to do: the module adds the address of your Optooki server, hosted or self-hosted, to Magento’s CSP (script-src, connect-src, img-src, style-src), and its two small inline scripts are allowed by their hash on payment pages, where Magento forbids inline scripts since 2.4.7.

Update, uninstall

To update, replace the app/code/Optooki/CookieBanner folder with the new archive (or composer update optooki/module-cookie-banner), then run bin/magento setup:upgrade: your settings are kept. To uninstall, bin/magento module:disable Optooki_CookieBanner, delete the folder (or composer remove) and run setup:upgrade again.

In the same section : Install

Your cookie banner, ready before your next coffee.

Create your account, customise the banner and add one line of code. Free for one site, no credit card required.