No cookie banner = GDPR fine up to €20 million. AdSense can ban you for EU traffic without consent.

In this tutorial, you'll add a cookie consent banner to Blogger. Follow along and you'll comply with GDPR, CCPA, and AdSense rules in 2025.

Step 1: Why Blogger Needs Cookie Consent Banner 2025

If you use AdSense, Analytics, or comments, you set cookies. EU law requires consent.

  1. GDPR law: EU visitors must click "Accept" before cookies load
  2. AdSense policy: Google requires consent banner for personalized ads
  3. CCPA law: California users need "Do Not Sell My Data" option
  4. Fine risk: No banner = €20M fine or AdSense account disabled

Image: Google AdSense warning about missing cookie consent

Step 2: Add Free Cookie Consent Code to Blogger

Use Osano or CookieYes free plan. 100% compliant.

  1. Go to cookieyes.com → Sign up free → Add your domain
  2. Customize banner: Color, text, button = "Accept All"
  3. Compliance → Turn on GDPR + CCPA → Copy installation code
  4. Blogger → Theme → Edit HTML → Ctrl+F → Search </head>
  5. Paste code ABOVE </head> → Save theme

Image: CookieYes dashboard with embed code

Step 3: Manual Cookie Banner HTML for Blogger

No third-party tool? Use this simple code. Paste above </body> in theme.

<style>
#cookie-banner {
position: fixed; bottom: 0; left: 0; right: 0;
background: #222; color: #fff; padding: 15px;
text-align: center; z-index: 9999; font-size: 14px;
}
#cookie-banner a {color: #4da6ff; text-decoration: underline;}
#cookie-banner button {
background: #1a73e8; color: white; border: none;
padding: 8px 16px; margin-left: 10px; border-radius: 4px;
cursor: pointer;
}
</style>

<div id="cookie-banner" style="display:none;">
We use cookies to improve your experience and show personalized ads. 
<a href="/p/privacy-policy.html">Privacy Policy</a>
<button onclick="acceptCookies()">Accept</button>
</div>

<script>
function acceptCookies() {
localStorage.setItem('cookieConsent', 'true');
document.getElementById('cookie-banner').style.display = 'none';
}
if (!localStorage.getItem('cookieConsent')) {
document.getElementById('cookie-banner').style.display = 'block';
}
</script>

Step 4: Link Cookie Banner to Privacy Policy

Banner must link to Privacy Policy page or it's invalid.

RequirementWhat to DoWhy
Privacy Policy linkBanner text must link to /p/privacy-policy.htmlGDPR Article 13
Accept buttonMust say "Accept" or "Agree", not "OK"Legal clarity
Reject optionEU needs "Reject" or "Manage" buttonGDPR compliance
Block cookiesAdSense/Analytics load only after AcceptAdvanced: Use CookieYes auto-block

Step 5: Test Cookie Banner + AdSense Compliance

  1. Test 1: Open blog in Incognito → Banner shows at bottom → Click Accept → Banner hides
  2. Test 2: Clear cache → Reopen → Banner should NOT show again
  3. Test 3: Use VPN set to Germany → Banner must show for EU users
  4. AdSense check: AdSense → Privacy & messaging → GDPR → Must show "Compliant"
  5. After setup: Add cookie policy section to Privacy Policy page

Bad practice to avoid: Using "We use cookies" popup with no Accept button. Not legal. Must have user action.

Important: Free CookieYes = 25k pageviews/month. Upgrade if traffic grows. For AdSense, banner must load BEFORE ads. Check AdSense → Brand safety → EU user consent. If red, fix banner. Update banner text yearly.