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
- 1Open Code InjectionIn Ghost Admin go to Settings → Code Injection. Use the site-wide fields, not a post's own code injection.
- 2Paste the embed in Site HeaderPaste the snippet at the very top of Site Header, above other analytics or ads snippets, and save.
- 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.
- 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- Shopify cookie bannertheme.liquid install + Customer Privacy API.
- Webflow cookie bannerPaste one line into Head code and publish.
- WordPress cookie bannerWPCode or functions.php, classic and block themes.
- Wix cookie bannerSettings → Custom Code → Head, all pages.
- Squarespace cookie bannerCode Injection → Header on Core plans and up.
- Framer cookie bannerProject Settings → Custom Code, start of head.
- Lovable cookie bannerOne prompt to the Lovable agent, or one tag.
- Bolt cookie bannerOne prompt to the Bolt agent, then publish.
- v0 cookie bannernext/script in the root layout, publish to Vercel.
- Next.js cookie bannernext/script beforeInteractive in the root layout.
- HubSpot cookie bannerSite header HTML + setHubSpotConsent sync.
Try it on your own site
Design your banner, preview it live, and paste one line. Free for one domain.