Cookie Consent
ChargePanda includes a built-in cookie consent banner that you can enable per store. When active, visitors see a banner on their first visit allowing them to accept, reject, or customise which categories of cookies they permit — in line with GDPR and similar privacy regulations.
Enabling the banner
- Go to Admin → Settings → Cookie Consent.
- Tick Enable Banner and click Save Settings.
The banner will now appear on your storefront for visitors who have not yet made a choice. Visitors who have previously saved their preferences will not see the banner again until their consent cookie expires (one year) or they click the cookie icon to reopen their preferences.
Banner position
Choose how the banner is displayed:
| Option | Description |
|---|---|
| Bottom bar | A full-width bar anchored to the bottom of the screen (default) |
| Bottom-left corner | A compact card in the bottom-left corner |
| Centred modal | A centred overlay with a semi-transparent backdrop |
Cookie Policy page
A Cookie Policy page is created automatically when you run the upgrade. It contains a standard template you should edit before enabling the banner:
- Go to Admin → Pages and open the Cookie Policy page.
- Replace the placeholder text (marked with square brackets) with your store name, contact details, and the date.
- Publish the page.
The banner links to this page by default. You can override the URL — or leave it blank to hide the link — in the Cookie Policy URL field in Settings → Cookie Consent.
Consent categories
Visitors can choose which categories of optional cookies to accept. The Strictly Necessary category is always enabled and cannot be turned off — it covers session, cart, and security cookies that are required for the store to function.
You can control which optional categories appear in the consent modal:
| Category | What it covers |
|---|---|
| Functional | Preference and language features (e.g. live chat widgets) |
| Analytics | Anonymous usage statistics (e.g. Google Analytics) |
| Marketing | Advertising and retargeting (e.g. Facebook Pixel) |
Untick a category in Settings → Cookie Consent to hide it from the visitor's modal. Scripts assigned to a hidden category will never run.
Gating tracking scripts
The most important step is moving your tracking scripts out of Header Code / Footer Code and into the per-category fields in Settings → Cookie Consent. Scripts in Header/Footer Code run for every visitor regardless of consent — that is fine for essential scripts (e.g. Cloudflare, error monitoring) but not for analytics or advertising tools.
How to migrate
- Open Settings → Code & Analytics and copy the tracking scripts from Header Code or Footer Code.
- Open Settings → Cookie Consent.
- Paste each script into the matching category field:
- Google Analytics → Analytics Code
- Facebook Pixel, Google Ads → Marketing Code
- Live chat, preference widgets → Functional Code
- Delete the scripts from Header Code / Footer Code.
- Save both settings pages.
Scripts in the category fields are stored in the page but remain inert until the visitor consents. After consent, ChargePanda loads them dynamically — scripts execute exactly as if they had been placed in the <head>.
Letting visitors reopen their preferences
A small cookie icon appears in the bottom-left corner after a visitor dismisses the banner. Clicking it reopens the preference modal.
You can also link to the modal from anywhere in your theme using the cookie_consent_link() Blade helper:
{!! cookie_consent_link('Cookie preferences') !!}This renders a plain <a> tag that opens the consent modal when clicked. The helper returns an empty string when the banner is disabled, so it is safe to include in footer partials regardless of settings.
Translating the banner
All text in the banner and consent modal can be translated into any language that is active on your store.
- Go to Admin → Languages and select a language.
- Search for phrases in the
cookie_consentnamespace. - Edit the translations and save.
If a translation is missing for a phrase, the banner falls back to the English default automatically.