Platforms

How to add a cookie consent banner to a PrestaShop store

PrestaShop has no back-office field for head code, so the snippet goes in your theme's templates/_partials/head.tpl, ideally from a child theme that extends the parent's head_charset block. Clear the cache, mark the tags you paste with type="text/plain" and a data-cq-category, and disable any cookie banner module; the official GDPR module handles data requests, not cookies.
Published 21 October 2026 · By the Cookiequiet team · Markdown

Steps

Copy your snippetIn the Cookiequiet dashboard, open your website and copy the install snippet: one script tag with your site key, data-consent-mode and data-auto-block set to 1, and defer.
Create a child themeIn /themes/, create a folder for the child theme with config/theme.yml naming your current theme as parent, and a preview.png. Upload it by FTP or SFTP.
Override head.tplIn the child theme, create templates/_partials/head.tpl that extends parent:_partials/head.tpl and adds the snippet in the head_charset block, right after the parent's content.
Activate the child theme and clear the cacheActivate the child theme under Design, then Theme & Logo. Then go to Advanced Parameters, then Performance, and click Clear cache.
Replace module-printed tagsIf the Google Analytics module prints your tag, disable it and paste the Google tag in the child's head.tpl below the snippet, marked with type="text/plain" and data-cq-category="analytics".
Disable other cookie bannersDisable or uninstall any cookie consent module from PrestaShop Addons so the store shows one banner. The official GDPR module can stay: it covers data requests and form consent.
Add the link and testAdd a link to #cq-preferences in a footer link block. Open the store in a private window, click Reject all and check that no _ga or _fbp cookie is set, then try the checkout.

Where to paste the snippet in PrestaShop

Every page of a PrestaShop theme builds its head from templates/_partials/head.tpl. In the Classic theme and in Hummingbird, the file opens with a head_charset block, then the SEO tags, the stylesheets, the javascript_head block and the hook_header block, which is where modules print their tags. The snippet belongs right after the charset, above all of them.

Editing the theme's own file works, but a theme update would remove the line. PrestaShop's developer documentation recommends a child theme, which inherits everything from its parent and overrides only what you change:

  1. In /themes/, create a folder such as classic-child with config/theme.yml and a preview.png:
yaml
parent: classic
name: classic-child
display_name: Classic child
version: 1.0.0
assets:
use_parent_assets: true
  1. Create templates/_partials/head.tpl in the child. The parent: prefix extends the parent's file, so you only redefine one block:
html
{extends file='parent:_partials/head.tpl'}
​
{block name='head_charset'}
{$smarty.block.parent}
<script src="https://cookiequiet.com/cq.js" data-site="YOUR_SITE_KEY" data-consent-mode="1" data-auto-block="1" defer></script>
{/block}
  1. Activate the child under Design, then Theme & Logo, then clear the cache under Advanced Parameters, then Performance.

If your theme is a commercial one, use its name as parent and check that its head.tpl keeps the head_charset block; most themes built on Classic do.

Which cookies does PrestaShop set itself?

PrestaShop keeps the visitor's cart, language, currency and login in one encrypted cookie named PrestaShop- followed by a hash. It is valid for 480 hours (20 days) by default, a value set under Advanced Parameters, then Administration. It is strictly necessary, so it needs no consent. Modules and the tags you add set the rest: run the free cookie scanner on the home page, a product page and the cart to list them.

PrestaShop's official GDPR module (psgdpr) is not a cookie banner. It adds consent checkboxes to forms and lets customers download or delete their personal data, which you still want. Cookie banner modules from PrestaShop Addons should be disabled after the switch, so visitors see one banner.

How to handle the tags modules add

  • The official Google Analytics module prints the Google tag in the page HTML from the header hook. A tag printed that way loads before Cookiequiet can hold it. Disable the module (or leave its ID empty) and paste the Google tag in your child's head.tpl, below the snippet, marked:
html
<script type="text/plain" data-cq-category="analytics" src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXX"></script>
<script type="text/plain" data-cq-category="analytics">
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-XXXXXXX');
</script>

E-commerce events (add to cart, purchase) are easier to keep through Google Tag Manager with Consent Mode, which Cookiequiet's data-consent-mode="1" feeds.

  • Pixels you paste (Meta, TikTok, Pinterest) get type="text/plain" and data-cq-category="marketing". The guide to blocking scripts until consent shows each pattern.
  • Modules that inject scripts with JavaScript (chat, reviews widgets) are covered by the auto-blocker, which holds the scripts and iframes of about 80 known trackers until consent.

Go to Design, then Link Widget, edit the block shown in your footer and add a custom link named "Cookie preferences" with the URL #cq-preferences. Cookiequiet opens the preferences centre from any link with that address. A theme without that module can take the link in the child's footer template instead.

How to test

  1. Open the store in a private window and click Reject all.
  2. Check the cookies in the developer tools: cq_consent, the PrestaShop- cookie, and nothing from Google or Meta.
  3. Add a product to the cart and go through the checkout: the cart is kept because PrestaShop's cookie is necessary.
  4. Clear the cookies, click Accept all, reload: the marked tags run. Check the consent log in the dashboard.

What is specific to PrestaShop

  • Smarty cache. With template caching on, changes to .tpl files appear only after you clear the cache.
  • Multistore. Each shop with its own domain needs its own site key so consent logs and policies stay separate.
  • Price. Cookiequiet is free for one store with geo-targeting included, and Starter is €3 per website per month with no pageview limit, see pricing.

Questions

No, none is needed. The snippet is one script tag in the theme's head.tpl. A child theme keeps it in place when the parent theme is updated.
No. It adds consent checkboxes to forms and gives customers access to their personal data. Keep it for that, and let Cookiequiet handle cookies.
No. The PrestaShop- cookie holds the cart, the language and the login, which the store needs to work. It is strictly necessary and listed under Necessary in the cookie table.
Usually because the Google Analytics module prints its tag in the HTML before Cookiequiet can hold it. Disable the module and paste the Google tag marked with type text/plain below the snippet, or load it through Google Tag Manager with Consent Mode.

Put a quiet banner on your website today

Free for one website with every core feature, no card and no trial clock. Upgrade a website to Starter for $3 a month to match your brand with AI and drop the branding, or to Pro for $9 to design it with the AI agent.