# 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.

Source: https://cookiequiet.com/platforms/prestashop
Published: 2026-10-21
Publisher: Cookiequiet

## Steps

1. **Copy your snippet** In 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.
2. **Create a child theme** In /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.
3. **Override head.tpl** In 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.
4. **Activate the child theme and clear the cache** Activate the child theme under Design, then Theme & Logo. Then go to Advanced Parameters, then Performance, and click Clear cache.
5. **Replace module-printed tags** If 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".
6. **Disable other cookie banners** Disable 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.
7. **Add the link and test** Add 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
```

2. 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}
```

3. 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](/tools/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](/platforms/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](/guides/block-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.

## How to add the Cookie preferences link

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](/pricing).

## Questions

### Is there a PrestaShop module for Cookiequiet?

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.

### Does the official GDPR module show a cookie banner?

No. It adds consent checkboxes to forms and gives customers access to their personal data. Keep it for that, and let Cookiequiet handle cookies.

### Does the PrestaShop cookie need consent?

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.

### Why does Google Analytics still load after Reject all?

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.

## Sources

- [PrestaShop Developer Documentation: Creating a child theme](https://devdocs.prestashop-project.org/9/themes/create-a-theme/child-theme/)
- [PrestaShop Developer Documentation: head.tpl template](https://devdocs.prestashop-project.org/9/themes/concepts/templates/head/)
- [PrestaShop Classic theme: templates/_partials/head.tpl](https://github.com/PrestaShop/classic-theme/blob/develop/templates/_partials/head.tpl)
- [PrestaShop source: Cookie class (PrestaShop- cookie name)](https://github.com/PrestaShop/PrestaShop/blob/develop/classes/Cookie.php)
- [PrestaShop user documentation: Administration (front office cookie lifetime)](https://docs.prestashop-project.org/functional-documentation/functional-documentation/ux-ui/back-office/configure/advanced-parameters/administration)
- [PrestaShop GDPR module (psgdpr)](https://github.com/PrestaShop/psgdpr)
