# Install FlowConsent on PrestaShop

Install FlowConsent on PrestaShop: paste the snippet at the top of your theme's head.tpl, clear the Smarty cache and turn off tracking modules.

> Canonical: https://www.flowconsent.com/en/doc/install-prestashop
> Last updated: 2026-10-01
On PrestaShop, the FlowConsent snippet goes at the very top of your theme's **`templates/_partials/head.tpl`** file, wrapped in Smarty **`{literal}`** tags, and then you clear the cache under **Advanced Parameters → Performance**. Installation takes three steps. The main traps: the Smarty cache that keeps serving the old `<head>`, and tracking modules (Google Analytics, Meta pixel, Google Tag Manager) that inject their own tags without waiting for consent.

## Before you start

- An account on [app.flowconsent.com](https://app.flowconsent.com) (free Free plan, no credit card, up to 25,000 sessions per month).
- A banner created and deployed. On the Free plan, deployment goes through your own Cloudflare account ([Cloudflare guide](/en/doc/cloudflare-deployment)); on Pro and Enterprise, it is one click.
- Access to the shop files (FTP, SFTP or your host's file manager) and to the PrestaShop back office. The back office has no theme file editor.

## Step 1: Copy the snippet

Open **Builder → Deployment → Integration** and copy the snippet from the **HTML / No-code** tab. It has two parts, in this order: the Google Consent Mode v2 stub (`denied` defaults), then the banner loader.

## Step 2: Paste it in head.tpl

1. Find the active theme under **Design → Theme & Logo**: the first section of the page shows the theme currently in use. Its folder lives in `themes/<theme-name>/`.
2. Open `themes/<theme-name>/templates/_partials/head.tpl`. In the Classic theme and the themes built on it, this file is included directly inside the `<head>` tag of every layout.
3. Paste the snippet **right after the `head_charset` block**, so before the stylesheets, the theme scripts and the modules' `displayHeader` hook, wrapping it in `{literal}` and `{/literal}`:

```html title="themes/<theme-name>/templates/_partials/head.tpl"
{block name='head_charset'}
  <meta charset="utf-8">
{/block}

{literal}
<script>
// FlowConsent Loader - place BEFORE any other script in the <head>
window.dataLayer=window.dataLayer||[];
function gtag(){dataLayer.push(arguments);}
gtag('consent','default',{
  'ad_storage':'denied',
  'analytics_storage':'denied',
  'ad_user_data':'denied',
  'ad_personalization':'denied',
  'wait_for_update':500
});
gtag('set','url_passthrough',true);
gtag('set','ads_data_redaction',true);
</script>
<!-- FlowConsent CMP -->
<script src="https://YOUR-LICENSE-CODE.consent.flowconsent.com/cookie-manager.js?code=YOUR_LICENSE_CODE"></script>
{/literal}

{* … the rest of the file, unchanged *}
```

> [!WARNING]
> The `{literal}` tags are not optional. Smarty parses curly braces: without them, `function gtag(){dataLayer.push(arguments);}` is read as a Smarty tag and the page fails with a compilation error. Everything between `{literal}` and `{/literal}` is output as is.

**Marketplace theme, or a theme you update?** A theme update overwrites `head.tpl`. Work in a **child theme** instead (the `parent` key in its `theme.yml`): copy `templates/_partials/head.tpl` to the same path in the child theme, add the snippet, and the child's copy replaces the parent's.

**What about code injection modules?** Some marketplace modules add code to the `<head>`. Most of them go through the `displayHeader` hook, rendered **at the end of the `<head>`**, after the theme scripts: too late to guarantee prior blocking. Prefer `head.tpl`; if you do use a module, confirm with the setup wizard that the snippet lands before every tracker.

## Step 3: Clear the Smarty cache

PrestaShop compiles templates and caches them: until the cache is cleared, the shop keeps serving the old `<head>`. Go to **Advanced Parameters → Performance** and click **Clear cache**. If the Smarty section is set to **Never recompile template files**, clearing the cache is required after every file change. Any host-level or CDN cache (Varnish, Cloudflare) must be purged too.

## Tracking modules: turn them off, then declare them in Services

> [!NOTE]
> Tracking modules (Google Analytics, Meta pixel, Google Tag Manager, ad modules) inject their tags through theme hooks, without waiting for the visitor's choice. Disable them under **Modules → Module Manager**, or remove the tracking ID from their configuration, then declare the matching services in **Builder → Services**: the banner only loads them after consent.

If you keep Google Tag Manager, do not load FlowConsent from GTM (it would arrive too late): place the snippet **above** the GTM container in `head.tpl`. Google tags then respect Consent Mode v2 signals; other tags need **Additional Consent Checks**. Details in the [Google Consent Mode guide](/en/doc/google-consent-mode).

## Verify the installation

1. Open the shop in a private window: the banner appears.
2. In the developer tools **Network** tab, no request to any third party leaves before you click **Accept**.
3. Run the [setup wizard](/en/doc/setup-wizard) (Builder → Integration): it checks the live page (loader present with the right license code, Consent Mode stub present and placed before every Google tag).
4. Finish with a decline scan from the **Compliance** tab ([compliance verification](/en/doc/compliance-verification)).

## Do it from your AI agent (MCP)

FlowConsent has an official MCP server, `https://mcp.flowconsent.com`, usable from Claude, ChatGPT or any MCP client. You connect with OAuth 2.0 using your FlowConsent account, no API key needed. Your agent fetches the snippet and placement instructions (`get_banner_snippet`, `get_setup_instructions`), verifies the installation with a real scan (`verify_consent_compliance`) and can set up recurring monitoring (`monitor_compliance`). You, or your coding agent, edit `head.tpl`: the MCP server provides the snippet, the instructions and the verification.

Example request:

> Give me my banner snippet for my PrestaShop store and check that it is correctly installed on https://mystore.com

Learn more: [MCP server](/en/doc/mcp-server) and [FlowConsent for AI agents](/en/mcp).

## Frequently asked questions

### I pasted the snippet but nothing changed. Why?

The Smarty cache is still serving the old version. Clear it under **Advanced Parameters → Performance**, purge any host or CDN cache, then reload in a private window.

### My shop shows an error after I edited head.tpl.

It is almost always the missing `{literal}` tags: Smarty tries to parse the script's curly braces. Wrap the whole snippet in `{literal}` and `{/literal}`, then clear the cache.

### Do I need a FlowConsent module?

No. The snippet is standard HTML that you paste into the theme. That is the most reliable method, because it is the only one that places the banner before the scripts injected by modules.

### My installation is multistore. What should I do?

Each theme used by a shop has its own `head.tpl`: add the snippet to each one. If your shops run on different domains, each with its own banner, use the right banner's license code in each theme.
