Ghost cookie banner

Add a GDPR cookie banner to your Ghost site

Ghost sets no non-essential cookies by default, so you only need a banner once you add third-party tools — Google Analytics, ads, embeds or pixels. PrivacyPill covers those with one line in Code Injection.

Updated 28 October 2026

Set it up in 4 steps

  1. 1Open Code InjectionIn Ghost Admin go to Settings → Code Injection. Use the site-wide fields, not a post's own code injection.
  2. 2Paste the embed in Site HeaderPaste the snippet at the very top of Site Header, above other analytics or ads snippets, and save.
  3. 3Check your themeGhost outputs injected header code after the theme's own scripts. If your theme hard-codes trackers in default.hbs, move them below {{ghost_head}} or gate them with data-pp-category.
  4. 4Test the public siteOpen home, a post and a page in a private window, and check that third-party scripts wait for consent.
HTML · Ghost site header
<!-- PrivacyPill: keep this first in <head>, before Google Tag Manager or analytics -->
<script>window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments)}gtag('consent','default',{ad_storage:'denied',ad_user_data:'denied',ad_personalization:'denied',analytics_storage:'denied',functionality_storage:'denied',personalization_storage:'denied',security_storage:'granted',wait_for_update:500});</script>
<script src="https://privacy-pill-consent-studio.lovable.app/api/public/v1/pp.js?site=pp_your_site_key"></script>

Replace pp_your_site_key with your site key — you'll get it when you save your banner.

Ghost's native analytics

Recent Ghost versions include native, cookie-free web analytics and member metrics. PrivacyPill doesn't control those; if your policy requires consent for them too, configure or disable them in Ghost.

Frequently asked questions

Set up PrivacyPill on other platforms

See all

Try it on your own site

Design your banner, preview it live, and paste one line. Free for one domain.