Set up a GDPR cookie consent banner

  • gdpr
  • cookies
  • consent
  • privacy
  • analytics

Updated

A cookie consent banner asks visitors to accept before your site loads tracking such as Google Analytics. A banner on its own isn't enough: the tracking has to actually wait for the click. Dirigible has one built in, under Appearance → Customize → Scripts & Embeds → GDPR Banner, that holds back Google Analytics, Tag Manager, Meta Pixel, and the other tracking IDs until a visitor accepts.

Add your tracking IDs first (see Add tracking codes to your site), then turn on the banner.

Turn on the cookie banner

  1. Go to Appearance → Customize.
  2. Open Scripts & Embeds → GDPR Banner.
  3. Turn on Enable.
  4. Click Publish when the preview looks right.

Write the notice

Control What it does
Body (HTML Allowed) The message visitors read.
Accept Text The accept button label (default Got It!).
Decline Text Adds a decline button. Leave it empty for no decline button.
Show Privacy Policy Link Adds a link next to the buttons.
Privacy Policy Link Text The link's label (default Privacy Policy). It links to the privacy policy page set in WordPress under Settings → Privacy.

Style the banner

Control What it does
Layout Corner for a small banner, or Centered for a more prominent one.
Shadow Adds a drop shadow.
Background The banner color, from your palette.
Reverse Print Light text, for a dark background.

What does the banner hold back until visitors accept?

While the banner is on, everything in Scripts & Embeds → Analytics & Tracking (Google Analytics, Tag Manager, Facebook Pixel, and the other ID fields) stays off until the visitor accepts.

Code pasted into Custom Embeds does not wait. For anything that needs consent, use an ID field instead.

How do I test the cookie banner?

  1. Open the site in a private (incognito) window.
  2. Check that the banner appears and no tracking loads before you accept.
  3. Accept, then confirm your tags fire with your analytics tool's debugger.

The visitor's choice is saved in their browser, so use a fresh private window each time you retest.

This banner controls Dirigible's tracking codes. It isn't legal advice, so check what your region requires.