Cookie-Einwilligung für PrestaShop: Modul-Einrichtungsanleitung
Upload über den Module Manager, Konfiguration von Domain-Slug und GCM im Back-Office. Wie der displayHeader-Hook funktioniert, Skriptblockierung in Smarty-Templates, mehrsprachige Shops.
Veröffentlicht am
PrestaShop is the dominant ecommerce platform in France and has a strong following across Southern Europe, which means PrestaShop stores tend to take EU privacy compliance seriously — French regulators are the most aggressive in the EU. This guide covers installing the ConsentTrustee PrestaShop module on PrestaShop 1.7 and 8.x, configuring it for typical store setups, and handling multi-store and multi-language configurations.
Compatibility
The PrestaShop module supports PrestaShop 1.7.6+ and PrestaShop 8.x. PHP 7.4 is the minimum, PHP 8.1+ recommended. PrestaShop 1.6 is end-of-life and not supported.
Install via Module Manager
- Download the ConsentTrustee PrestaShop module ZIP from your CMP dashboard.
- In the PrestaShop back office, navigate to Modules → Module Manager → Upload a module.
- Drop the ZIP onto the upload area.
- After upload completes, the module appears in the manager. Click Configure.
- Fill in your domain slug from the ConsentTrustee dashboard, save.
- Visit the storefront in incognito to verify the banner appears.
Configuration
The module's configuration form has the standard ConsentTrustee fields plus a few PrestaShop-specific ones:
Domain slug. From the CMP dashboard. Required.
Google Consent Mode v2. Toggle. Recommended if you use Google Analytics or Google Ads.
Geo-targeting. Toggle. Enable for region-specific banner behaviour.
Hook on displayHeader. The module hooks into PrestaShop's displayHeader hook to inject the CMP script. This is automatic; you only need to change it if you have a custom template that doesn't respect displayHeader.
Per-shop configuration (Multi-store). If you run multiple shops on one PrestaShop install, you can configure the CMP per-shop or apply one configuration across all. See the Multi-store section below.
How displayHeader injection works
PrestaShop's displayHeader hook fires during the head rendering of every storefront page. Modules registered to this hook can inject scripts and styles into the page head.
The ConsentTrustee module registers a handler that outputs:
- The GCM v2 default-denied signal (if enabled)
- The ConsentTrustee runtime script tag with your domain slug
- Any auto-blocking rules for known PrestaShop tracking modules
All three load before any tracking scripts from other modules, which is what you need for proper consent gating.
Script blocking in Smarty templates
PrestaShop uses Smarty as its template engine. If you have custom tracking code in a Smarty template (your theme's header.tpl or a specific page's template), you can use the same script-blocking pattern as elsewhere:
<script
type="text/plain"
data-ct-category="statistics"
src="https://www.googletagmanager.com/gtag/js?id=G-XXXXX"
></script>The module's runtime swaps the type after consent and the browser loads the script.
For tracking code injected by other PrestaShop modules (Facebook Pixel modules, Google Analytics modules, etc.), either disable the module's built-in injection and add the snippet through ConsentTrustee's “Custom Scripts” section, or add the third-party module's URL patterns to the “Auto Script Blocking” list.
Multi-language stores
PrestaShop has native multi-language support — each store can be configured in multiple languages with translated content per language. The module auto-detects the storefront's current language via PrestaShop'sContext object and serves the matching banner translation.
Make sure your CMP dashboard has translations for every language your store supports. ConsentTrustee ships with 9 languages out of the box; if you serve languages outside that set, add custom translations in the dashboard.
Multi-store
PrestaShop's multi-store feature lets one install manage multiple separate shops with different domains, catalogues, and configurations. The module supports two deployment patterns:
Pattern A: One CMP configuration for all shops. Use one domain slug across every shop. Useful if your shops share a parent brand and the banner content can be identical across them.
Pattern B: Per-shop CMP configuration. Each shop in the multi-store has its own domain slug pointing to a different CMP configuration. Useful if your shops are functionally separate businesses with different privacy policies, vendor lists, or branding.
Configure the pattern in the module's settings, under the “Multi-store” tab. PrestaShop's standard multi-store context switching is respected — the module reads the active shop from Shop::getContextShopID().
Common PrestaShop gotchas
SSL on order confirmation pages. PrestaShop's checkout flow can switch protocols mid-flow on some configurations. The CMP runtime uses protocol-relative URLs to avoid mixed-content warnings, but if you've hardcoded http:// in custom scripts, you'll get console errors. Always use https:// or protocol-relative.
Combinations and product variants. PrestaShop's combination system uses AJAX to update product pages when the visitor selects a variant. The CMP runtime persists across these AJAX updates because it's loaded in the initial page head. No special configuration needed.
Caching modules. Page cache modules (PrestaShop's built-in cache, PageCache Ultimate) cache the rendered HTML including the CMP script tag. The consent state itself is client-side (localStorage), so caching doesn't cause stale consent. Cookie name (ct_consent) shouldn't be in the cache key.
Module updates. When updating the ConsentTrustee module via Module Manager, your configuration is preserved. PrestaShop's module update flow runs the module's upgrade scripts without resetting settings.
BO (back office) login cookies. PrestaShop's admin uses several first-party cookies for the BO session. These are Necessary and the module pre-categorises them correctly. If you have a custom BO module that sets additional cookies, you'll need to manually categorise them.
What I'd read next
For the legal foundation, GDPR Cookie Consent (particularly important for French and EU traffic). For the underlying script-blocking technique, How to Block Third-Party Scripts. For Google Consent Mode v2 wiring, Google Consent Mode v2.