Cookie consent for PrestaShop: install Cookifi in under 10 minutes

PrestaShop's official GDPR module handles data requests and form checkboxes, not cookies — there is no banner and nothing blocks a tag. A ten-line module puts Cookifi first in the head.

What you need

None — PrestaShop is open source and the module route needs nothing extra. Module-upload limits on PrestaShop's own hosted edition are not documented; if your plan blocks module uploads, use the theme.yml route instead.

Install Cookifi on PrestaShop

  1. 1

    Create a tiny module

    There is no back-office field for head scripts. Add modules/cookifi/cookifi.php and register the hook actionFrontControllerSetMedia in install().

  2. 2

    Register the script at head position

    In hookActionFrontControllerSetMedia() call $this->context->controller->registerJavascript('cookifi', '<script URL>', ['server' => 'remote', 'position' => 'head', 'priority' => 0, 'attributes' => 'async']). registerJavascript defaults to position 'bottom', which is too late.

  3. 3

    Upload and install it

    Back office → Modules → Module Manager → Upload a module → pick the ZIP → Install.

  4. 4

    Clear the cache

    Advanced Parameters → Performance → Clear cache. While testing, also turn off 'Smart cache for JavaScript' so CCC does not keep serving the old head.

  5. 5

    Theme alternative

    The same entry can go under assets.js.all in the theme's config/theme.yml with server: remote and position: head, followed by a theme reset. Note the docs use both 'attribute' and 'attributes' — check which your version expects.

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 PrestaShop

Nothing platform-specific: the stock themes emit no consent defaults, and the Google modules inject gtag through their own hooks. That is why Cookifi has to register at head with priority 0 — it must run before any module-injected tag, so the defaults are in place when gtag arrives.

What the native PrestaShop banner cannot do

PrestaShop ships no cookie banner of its own, so until you add a CMP nothing asks for consent and nothing holds a tag back.

Gotchas worth knowing

  • Smarty's template cache and CCC (Combine, Compress, Cache) can keep serving the old head output. Disable 'Smart cache for JavaScript' while you test.
  • Editing templates/_partials/head.tpl is overwritten on the next theme update — keep the script in a module.
  • The asset-management docs mix the 'attribute' and 'attributes' keys in theme.yml; verify against your version before blaming the script.

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

Does the official psgdpr module not already do this?

No. It covers data access and erasure requests and consent checkboxes on forms. It is not a cookie banner and it blocks no scripts.

Why does the position matter so much?

A CMP has to set the Consent Mode defaults before any tag reads them. registerJavascript defaults to the bottom of the page, which puts Cookifi after the Google modules — so the first pageview of each visit leaks.

Do I need a developer for the module?

It is one PHP file with an install() and one hook method, so a developer will spend minutes on it. If you would rather not ship a module at all, the theme.yml entry achieves the same ordering.

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.