Cookie consent for Magento 2: install Cookifi in under 10 minutes

Cookie Restriction Mode is a single Allow notice with no decline, no categories and no consent log. Cookifi goes into the HTML Head field, loads before the RequireJS bundle, and governs every tag.

What you need

None. Magento Open Source is free and Adobe Commerce exposes the same Design Configuration field.

Install Cookifi on Magento 2

  1. 1

    Open Design Configuration

    Admin → Content → Design → Configuration, then edit the row for the scope you want — Store View, Website or Global.

  2. 2

    Paste into Scripts and Style Sheets

    Other Settings → HTML Head → 'Scripts and Style Sheets': paste the Cookifi integration script and Save Configuration. It then loads before the RequireJS bundle and the GTM block, which is the right order.

  3. 3

    Flush the caches

    System → Tools → Cache Management → flush Page Cache, and flush Varnish or Fastly as well. Until then the old head keeps being served.

  4. 4

    Disable Cookie Restriction Mode

    Stores → Configuration → General → Web → Default Cookie Settings: turn Cookie Restriction Mode off so Magento's own notice does not appear alongside the Cookifi banner.

  5. 5

    Whitelist the host for checkout

    Since 2.4.7 checkout runs CSP in restrict mode. Add the Cookifi host to csp_whitelist.xml for script-src and connect-src, or the banner will not run on checkout.

Get your Cookifi script

  1. 1.

    In the Cookifi admin click Add, enter a name and your domain — a sitemap URL is optional — and click Create.

  2. 2.

    Open the property and copy the script under General → Integration script.

  3. 3.

    Click the Google icon in the script toolbar to include the Consent Mode default command. The defaults themselves are set under Regions, together with URL Passthrough and Ads Data Redaction.

  4. 4.

    Paste it as high in the <head> as the platform allows, on every page. Save, reload, and confirm the banner appears.

  5. 5.

    If the platform strips data- attributes and the banner does not load, switch to Query string mode in the Installation script section and copy the script again.

  6. 6.

    Cannot touch the head at all? Use the GTM Installation script in a Custom HTML tag with the Consent Initialization – All Pages trigger. Direct installation is still the recommendation, because ad blockers can suppress GTM.

Consent Mode v2 and GTM on Magento 2

The core Google Analytics and GTM module emits no Consent Mode defaults. Cookifi in the HTML Head field loads before the RequireJS bundle and before the GTM block, so the defaults are in place when any tag arrives. The one thing to get right is CSP on checkout, where a missing whitelist entry silently drops the banner.

What the native Magento 2 banner cannot do

Cookie Restriction Mode

  • A single 'Allow' notice: no categories, and no way to decline.
  • It gates Magento's own cookies only; third-party scripts are untouched and no Consent Mode signal is sent.
  • No consent log, so there is no proof of consent to produce later.

Gotchas worth knowing

  • CSP in restrict mode on checkout since 2.4.7: without csp_whitelist.xml entries for script-src and connect-src the banner does not run there.
  • Full-page cache and Varnish keep serving the old head until flushed — the change can look like it did not save.
  • Scope confusion: a value set on a Store View overrides the Website and Global ones, so check which row you edited.

What you get with Cookifi

Live in under 10 minutes

One script in the head, a scan that suggests the categories for you, and a 14-day trial that needs no card.

A flat base, not a tier ladder

One monthly base from €10 plus usage on read events — the first 10,000 each month are free. Subdomains and team members are unlimited, so a second site is not a second plan.

Support that answers

Live chat and email on every plan, with a human response within one business day on Enterprise. We are a small team, which is why the things customers ask for tend to ship quickly.

Built for the modern stack

Google and Microsoft Consent Mode v2 are first-class, GA4 and GTM are the default path, and Cookifi is a Google-certified CMP partner.

Frequently asked questions

Do I have to disable Cookie Restriction Mode?

Yes, otherwise the shop shows Magento's Allow notice and the Cookifi banner at once. The native mode also offers no decline, which is the bigger problem of the two.

The banner works everywhere except checkout.

That is CSP. Since 2.4.7 checkout runs in restrict mode, so the Cookifi host needs script-src and connect-src entries in your module's csp_whitelist.xml.

Which scope should I use?

Global if the same consent setup applies to every store view, which is the usual case. Remember that a Store View value overrides it, so an old per-view entry can quietly win.

Try it on your own site

14 days, no credit card. If the install takes you longer than ten minutes, tell us — on our side that counts as a bug.