Knowledge base

The Page Builder Sandwich cookie consent banner

Design a GDPR-style cookie banner with blocks that blocks tracking until the visitor agrees, with Google Consent Mode and an optional rule for visitors outside the EU.

Page Builder Sandwich Pro includes a cookie consent banner that you design with blocks, and that really blocks tracking until the visitor agrees.

Create the banner

  1. Open Page Builder Sandwich → Marketing → Cookie banner and choose **Create a ready-made
  2. banner: a bar at the bottom of the screen with a short text, Analytics and Marketing tick boxes, and Accept all, Save my choice and Necessary only** buttons. Edit it like any popup.

  3. Switch on Show a cookie banner and choose Save.

To design your own: link buttons to #consent-accept (everything), #consent-reject (necessary only) and #consent-save (the ticked boxes, which must be named analytics and marketing). A link to #consent-open anywhere on your site (in the footer, for example) shows the banner again, so a visitor can change their mind.

What it blocks

Until the visitor agrees:

  • the Google Analytics, Tag Manager and Meta Pixel tags set up under Conversion tracking do
  • not load, and no event is sent;

  • Google Consent Mode starts with every signal denied;
  • any other script you list (by its WordPress handle, as analytics or marketing) stays switched
  • off, and so does any script written as <script type="text/plain" data-<prefix>-consent="analytics">, where <prefix> is the class prefix shown on the plugin's settings screen.

The choice is kept for 180 days (you can change this) in one cookie on your own site. If a visitor takes consent back, the page reloads so nothing that already ran keeps tracking.

Visitors outside the EU

By default every visitor must agree first. You can switch on Outside the EU, EEA and UK: load tracking until the visitor says no: it applies only when your host or CDN reports the visitor's country (for example Cloudflare's CF-IPCountry header) and that country is outside the EU, EEA, UK and Switzerland. The banner is still shown, and a visitor whose country is unknown is treated as inside the EU.

The banner works with page caching: every visitor gets the same page, and their own choice is applied in their browser.

Latest from the blog

What we have been writing about hosting, SEO and running sites at scale.

SEO and Link Building from the Hosting Layer: A 2026 Operator's View

How hosting shapes indexing and link equity in 2026: keeping pages indexed, vetting aged domains before you build on them, link building without a footprint, and an honest line on what infrastructure can and cannot do for SEO.

Read the post →

Making WordPress Fast and Secure: A Performance and Plugin Checklist

A practical checklist for fast, secure WordPress: server-level caching, a per-site object cache, the handful of plugins worth running, keeping the stack current, and the WooCommerce pages you must never cache.

Read the post →

How to Choose Managed Web Hosting in 2026: A Buyer's Guide

What actually separates good managed hosting from a cheap box with a control panel — migrations, backups, isolation, real caching and honest scaling — and how to judge it before you commit.

Read the post →

Read the blog →

Still stuck?

Support is included on every plan, the desk is open 24 hours a day, and you can write to us in any of our 58 languages — we answer you in yours.

Contact support → All articles →