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
-
Install the module
Unzip
optooki-magento.zipintoapp/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 -
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 runsetup:di:compileandsetup:static-content:deployas for any extension.composer config repositories.optooki artifact packages composer require optooki/module-cookie-banner bin/magento setup:upgrade bin/magento cache:flush -
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.
-
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
- Any website One line to paste at the top of every page, for a site without a CMS.
- WordPress Plugin for WordPress 6.0 and later, compatible with WP Consent API.
- PrestaShop Module for PrestaShop 1.7, 8 and 9.
- Joomla System plugin for Joomla 4.4, 5 and 6.
- Drupal Module for Drupal 10.3 and later, and Drupal 11.
- Contao A single package for Contao 4.4 to 6.
- Shopify App connected to Shopify’s Customer Privacy API.
- Wix App connected to Wix’s consent policy.
- Squarespace One line to paste into the site’s code injection.
- Webflow One line to paste into the site’s custom code.
- Google Tag Manager Consent Mode v2, the optooki_consent trigger and the Optooki tag template.