{"id":298,"date":"2025-09-26T08:08:51","date_gmt":"2025-09-26T08:08:51","guid":{"rendered":"https:\/\/wehaveservers.com\/blog\/?p=298"},"modified":"2025-09-29T16:37:58","modified_gmt":"2025-09-29T16:37:58","slug":"how-to-build-a-cookie-consent-that-actually-meets-eu-rules-tech-guide","status":"publish","type":"post","link":"https:\/\/wehaveservers.com\/blog\/compliance-privacy\/how-to-build-a-cookie-consent-that-actually-meets-eu-rules-tech-guide\/","title":{"rendered":"How to Build a Cookie Consent That Actually Meets EU Rules (Tech Guide)"},"content":{"rendered":"\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"768\" height=\"403\" src=\"https:\/\/wehaveservers.com\/blog\/wp-content\/uploads\/2025\/09\/cookiesconsent.png\" alt=\"cookieconsent\" class=\"wp-image-299\" srcset=\"https:\/\/wehaveservers.com\/blog\/wp-content\/uploads\/2025\/09\/cookiesconsent.png 768w, https:\/\/wehaveservers.com\/blog\/wp-content\/uploads\/2025\/09\/cookiesconsent-300x157.png 300w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h1 class=\"wp-block-heading\">How to Build a Cookie Consent That Actually Meets EU Rules (Tech Guide)<\/h1>\n\n\n\n<p>Cookie banners are everywhere\u2014but most of them fail to comply with <strong>GDPR<\/strong> and the <strong>EU ePrivacy Directive<\/strong>. In 2025, regulators in France, Germany, and other EU states continue to fine businesses for <em>dark patterns<\/em>, auto-checked boxes, and banners that don\u2019t truly give users control. For self-hosted apps and SaaS platforms, building a <strong>compliant cookie consent mechanism<\/strong> is not just about design\u2014it requires technical enforcement, proper data storage, and integration with analytics and ad scripts.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udd39 Core Legal Requirements<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Prior Consent:<\/strong> No non-essential cookies (analytics, ads) before consent.<\/li>\n\n\n\n<li><strong>Granular Choice:<\/strong> Users must accept or reject categories (e.g., statistics, marketing).<\/li>\n\n\n\n<li><strong>Easy Withdrawal:<\/strong> Users must be able to change preferences anytime.<\/li>\n\n\n\n<li><strong>No Nudging:<\/strong> Equal weight to \u201cAccept\u201d and \u201cReject\u201d buttons.<\/li>\n\n\n\n<li><strong>Proof of Consent:<\/strong> Businesses must log and store consent decisions.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udd39 Designing the Consent Banner<\/h2>\n\n\n\n<p>Technical implementation starts with UX. Avoid deceptive practices and design for clarity.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Reject button:<\/strong> Visible and same prominence as Accept.<\/li>\n\n\n\n<li><strong>Category toggles:<\/strong> Functional, not pre-enabled.<\/li>\n\n\n\n<li><strong>Link to policy:<\/strong> Direct access to Privacy\/Cookie Policy page.<\/li>\n\n\n\n<li><strong>Resurfacing:<\/strong> Small widget or footer link to re-open consent modal.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">HTML\/React Example:<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>&amp;lt;div class=\"cookie-banner\"&amp;gt;\n  &amp;lt;p&amp;gt;We use cookies to personalize content, provide social features, \n  and analyze traffic. You can choose what to allow.&amp;lt;\/p&amp;gt;\n  &amp;lt;button id=\"acceptAll\"&amp;gt;Accept All&amp;lt;\/button&amp;gt;\n  &amp;lt;button id=\"rejectAll\"&amp;gt;Reject All&amp;lt;\/button&amp;gt;\n  &amp;lt;button id=\"preferences\"&amp;gt;Manage Preferences&amp;lt;\/button&amp;gt;\n&amp;lt;\/div&amp;gt;\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udd39 Categorizing Cookies<\/h2>\n\n\n\n<p>Cookies must be split into categories:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Essential:<\/strong> Session cookies, load balancer cookies, auth tokens.<\/li>\n\n\n\n<li><strong>Statistics:<\/strong> Analytics (Google Analytics, Matomo, Plausible).<\/li>\n\n\n\n<li><strong>Marketing:<\/strong> Ad trackers, retargeting pixels, social embeds.<\/li>\n<\/ul>\n\n\n\n<p>Essential cookies don\u2019t require consent, but all others do.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udd39 Consent Storage<\/h2>\n\n\n\n<p>You must record consent decisions and prove compliance if audited. Two storage strategies:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Local storage only:<\/strong> Quick implementation, but less audit-friendly.<\/li>\n\n\n\n<li><strong>Server-side logs:<\/strong> Store hashed user IDs + timestamp + consent state in database.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Example JSON payload:<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n  \"userId\": \"hashed-uuid\",\n  \"consent\": {\n    \"essential\": true,\n    \"statistics\": false,\n    \"marketing\": true\n  },\n  \"timestamp\": \"2025-09-26T10:22:00Z\"\n}\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udd39 Blocking Scripts Until Consent<\/h2>\n\n\n\n<p>Technical enforcement is critical. Analytics and ad scripts must not load until consent is granted.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Example (Vanilla JS):<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>&amp;lt;script type=\"text\/plain\" data-category=\"statistics\"&amp;gt;\n  \/\/ Google Analytics snippet here\n&amp;lt;\/script&amp;gt;\n\n&amp;lt;script&amp;gt;\ndocument.getElementById(\"acceptAll\").onclick = () =&amp;gt; {\n  document.querySelectorAll(\"script&#91;type='text\/plain']\").forEach(script =&amp;gt; {\n    if (script.dataset.category === \"statistics\") {\n      const s = document.createElement(\"script\");\n      s.innerHTML = script.innerHTML;\n      document.body.appendChild(s);\n    }\n  });\n};\n&amp;lt;\/script&amp;gt;\n<\/code><\/pre>\n\n\n\n<p>This prevents execution until user consent is confirmed.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udd39 Using a CMP (Consent Management Platform)<\/h2>\n\n\n\n<p>If managing consent in-house is too complex, CMPs can help:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>IAB TCF v2.2:<\/strong> Required by many EU ad networks.<\/li>\n\n\n\n<li><strong>Open Source:<\/strong> Klaro, CookieConsent.js, or tarteaucitron.js.<\/li>\n\n\n\n<li><strong>Enterprise:<\/strong> OneTrust, TrustArc, Usercentrics.<\/li>\n<\/ul>\n\n\n\n<p>Even when using CMPs, ensure your infrastructure enforces choices by actually disabling scripts.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udd39 Security &amp; Data Integrity<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Integrity:<\/strong> Sign server-stored consent records with HMAC.<\/li>\n\n\n\n<li><strong>Expiration:<\/strong> Consent should expire every 6\u201312 months.<\/li>\n\n\n\n<li><strong>Cross-Device:<\/strong> Sync consent if user logs in across devices.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udd39 Example Architecture for Self-Hosted Apps<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Consent banner served on first visit.<\/li>\n\n\n\n<li>User choice stored locally and in database (hashed ID).<\/li>\n\n\n\n<li>Middleware checks consent state before injecting analytics\/ad scripts.<\/li>\n\n\n\n<li>Admins view consent logs in dashboard (audit trail).<\/li>\n\n\n\n<li>Users can re-open modal via footer link to modify preferences.<\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u2705 Conclusion<\/h2>\n\n\n\n<p>Building cookie consent that actually meets EU standards is not just about avoiding fines\u2014it\u2019s about <strong>trust and transparency<\/strong>. A well-designed system respects user privacy, ensures analytics and ads only run with permission, and gives admins an audit trail for compliance. For developers of self-hosted apps in 2025, the technical implementation of cookie consent is as important as the legal policy behind it.<\/p>\n\n\n\n<p>At <strong>WeHaveServers.com<\/strong>, our hosting solutions support <strong>privacy-first applications<\/strong> with secure infrastructure, GDPR compliance features, and developer-friendly environments for building apps that meet EU requirements.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u2753 FAQ<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Can I pre-check cookie consent boxes?<\/h3>\n\n\n\n<p>No. GDPR requires explicit opt-in. All non-essential categories must start unchecked.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Do I need consent for essential cookies?<\/h3>\n\n\n\n<p>No. Session cookies required for login or cart functionality are exempt.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">How long should consent last?<\/h3>\n\n\n\n<p>Industry best practice is 6\u201312 months, after which users should be asked again.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">What if a user rejects all cookies?<\/h3>\n\n\n\n<p>You must still allow access to your site without blocking features, except those strictly requiring cookies.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Is using Google Analytics legal in the EU?<\/h3>\n\n\n\n<p>Yes, but only if anonymized IPs are enabled, data retention is limited, and user consent is properly obtained.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n","protected":false},"excerpt":{"rendered":"<p>How to Build a Cookie Consent That Actually Meets EU Rules (Tech Guide) Cookie banners are everywhere\u2014but most of them fail to comply with GDPR and the EU ePrivacy Directive. In 2025, regulators in France, Germany, and other EU states continue to fine businesses for dark patterns, auto-checked boxes, and banners that don\u2019t truly give [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":299,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[287,286,288,284,285],"class_list":["post-298","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-compliance-privacy","tag-blocking-scripts-until-consent","tag-build-cookie-banner-eu-compliance","tag-cmp-vs-custom-cookie-consent","tag-cookie-consent-gdpr-2025","tag-self-hosted-cookie-consent-tech"],"blocksy_meta":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Build a Cookie Consent That Actually Meets EU Rules (Tech Guide) - Blog | WeHaveServers.com<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/wehaveservers.com\/blog\/compliance-privacy\/how-to-build-a-cookie-consent-that-actually-meets-eu-rules-tech-guide\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Build a Cookie Consent That Actually Meets EU Rules (Tech Guide) - Blog | WeHaveServers.com\" \/>\n<meta property=\"og:description\" content=\"How to Build a Cookie Consent That Actually Meets EU Rules (Tech Guide) Cookie banners are everywhere\u2014but most of them fail to comply with GDPR and the EU ePrivacy Directive. In 2025, regulators in France, Germany, and other EU states continue to fine businesses for dark patterns, auto-checked boxes, and banners that don\u2019t truly give [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/wehaveservers.com\/blog\/compliance-privacy\/how-to-build-a-cookie-consent-that-actually-meets-eu-rules-tech-guide\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog | WeHaveServers.com\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/WeHaveServers\/\" \/>\n<meta property=\"article:published_time\" content=\"2025-09-26T08:08:51+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-09-29T16:37:58+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/wehaveservers.com\/blog\/wp-content\/uploads\/2025\/09\/cookiesconsent.png\" \/>\n\t<meta property=\"og:image:width\" content=\"768\" \/>\n\t<meta property=\"og:image:height\" content=\"403\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"WHS\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@WeHaveServers\" \/>\n<meta name=\"twitter:site\" content=\"@WeHaveServers\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"WHS\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/wehaveservers.com\\\/blog\\\/compliance-privacy\\\/how-to-build-a-cookie-consent-that-actually-meets-eu-rules-tech-guide\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/wehaveservers.com\\\/blog\\\/compliance-privacy\\\/how-to-build-a-cookie-consent-that-actually-meets-eu-rules-tech-guide\\\/\"},\"author\":{\"name\":\"WHS\",\"@id\":\"https:\\\/\\\/wehaveservers.com\\\/blog\\\/#\\\/schema\\\/person\\\/f90cd2ad6ce12bb915c1d00a4770dad0\"},\"headline\":\"How to Build a Cookie Consent That Actually Meets EU Rules (Tech Guide)\",\"datePublished\":\"2025-09-26T08:08:51+00:00\",\"dateModified\":\"2025-09-29T16:37:58+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/wehaveservers.com\\\/blog\\\/compliance-privacy\\\/how-to-build-a-cookie-consent-that-actually-meets-eu-rules-tech-guide\\\/\"},\"wordCount\":627,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/wehaveservers.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/wehaveservers.com\\\/blog\\\/compliance-privacy\\\/how-to-build-a-cookie-consent-that-actually-meets-eu-rules-tech-guide\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/wehaveservers.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/09\\\/cookiesconsent.png\",\"keywords\":[\"blocking scripts until consent\",\"build cookie banner eu compliance\",\"cmp vs custom cookie consent\",\"cookie consent gdpr 2025\",\"self-hosted cookie consent tech\"],\"articleSection\":[\"Compliance &amp; Privacy\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/wehaveservers.com\\\/blog\\\/compliance-privacy\\\/how-to-build-a-cookie-consent-that-actually-meets-eu-rules-tech-guide\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/wehaveservers.com\\\/blog\\\/compliance-privacy\\\/how-to-build-a-cookie-consent-that-actually-meets-eu-rules-tech-guide\\\/\",\"url\":\"https:\\\/\\\/wehaveservers.com\\\/blog\\\/compliance-privacy\\\/how-to-build-a-cookie-consent-that-actually-meets-eu-rules-tech-guide\\\/\",\"name\":\"How to Build a Cookie Consent That Actually Meets EU Rules (Tech Guide) - Blog | WeHaveServers.com\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/wehaveservers.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/wehaveservers.com\\\/blog\\\/compliance-privacy\\\/how-to-build-a-cookie-consent-that-actually-meets-eu-rules-tech-guide\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/wehaveservers.com\\\/blog\\\/compliance-privacy\\\/how-to-build-a-cookie-consent-that-actually-meets-eu-rules-tech-guide\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/wehaveservers.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/09\\\/cookiesconsent.png\",\"datePublished\":\"2025-09-26T08:08:51+00:00\",\"dateModified\":\"2025-09-29T16:37:58+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/wehaveservers.com\\\/blog\\\/compliance-privacy\\\/how-to-build-a-cookie-consent-that-actually-meets-eu-rules-tech-guide\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/wehaveservers.com\\\/blog\\\/compliance-privacy\\\/how-to-build-a-cookie-consent-that-actually-meets-eu-rules-tech-guide\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/wehaveservers.com\\\/blog\\\/compliance-privacy\\\/how-to-build-a-cookie-consent-that-actually-meets-eu-rules-tech-guide\\\/#primaryimage\",\"url\":\"https:\\\/\\\/wehaveservers.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/09\\\/cookiesconsent.png\",\"contentUrl\":\"https:\\\/\\\/wehaveservers.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/09\\\/cookiesconsent.png\",\"width\":768,\"height\":403,\"caption\":\"cookieconsent\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/wehaveservers.com\\\/blog\\\/compliance-privacy\\\/how-to-build-a-cookie-consent-that-actually-meets-eu-rules-tech-guide\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/wehaveservers.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Build a Cookie Consent That Actually Meets EU Rules (Tech Guide)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/wehaveservers.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/wehaveservers.com\\\/blog\\\/\",\"name\":\"Blog | WeHaveServers.com\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/wehaveservers.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/wehaveservers.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/wehaveservers.com\\\/blog\\\/#organization\",\"name\":\"THC Projects SRL\",\"url\":\"https:\\\/\\\/wehaveservers.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/wehaveservers.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/wehaveservers.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/07\\\/whs-logo-blog.png\",\"contentUrl\":\"https:\\\/\\\/wehaveservers.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/07\\\/whs-logo-blog.png\",\"width\":1080,\"height\":147,\"caption\":\"THC Projects SRL\"},\"image\":{\"@id\":\"https:\\\/\\\/wehaveservers.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/WeHaveServers\\\/\",\"https:\\\/\\\/x.com\\\/WeHaveServers\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/wehaveservers.com\\\/blog\\\/#\\\/schema\\\/person\\\/f90cd2ad6ce12bb915c1d00a4770dad0\",\"name\":\"WHS\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/e91dfeb1f75c7c898bf30d2646330952683ff1e2646cf0ac34c4a6963c2175ce?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/e91dfeb1f75c7c898bf30d2646330952683ff1e2646cf0ac34c4a6963c2175ce?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/e91dfeb1f75c7c898bf30d2646330952683ff1e2646cf0ac34c4a6963c2175ce?s=96&d=mm&r=g\",\"caption\":\"WHS\"},\"sameAs\":[\"https:\\\/\\\/wehaveservers.com\\\/blog\"],\"url\":\"https:\\\/\\\/wehaveservers.com\\\/blog\\\/author\\\/wehaveservers\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Build a Cookie Consent That Actually Meets EU Rules (Tech Guide) - Blog | WeHaveServers.com","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/wehaveservers.com\/blog\/compliance-privacy\/how-to-build-a-cookie-consent-that-actually-meets-eu-rules-tech-guide\/","og_locale":"en_US","og_type":"article","og_title":"How to Build a Cookie Consent That Actually Meets EU Rules (Tech Guide) - Blog | WeHaveServers.com","og_description":"How to Build a Cookie Consent That Actually Meets EU Rules (Tech Guide) Cookie banners are everywhere\u2014but most of them fail to comply with GDPR and the EU ePrivacy Directive. In 2025, regulators in France, Germany, and other EU states continue to fine businesses for dark patterns, auto-checked boxes, and banners that don\u2019t truly give [&hellip;]","og_url":"https:\/\/wehaveservers.com\/blog\/compliance-privacy\/how-to-build-a-cookie-consent-that-actually-meets-eu-rules-tech-guide\/","og_site_name":"Blog | WeHaveServers.com","article_publisher":"https:\/\/www.facebook.com\/WeHaveServers\/","article_published_time":"2025-09-26T08:08:51+00:00","article_modified_time":"2025-09-29T16:37:58+00:00","og_image":[{"width":768,"height":403,"url":"https:\/\/wehaveservers.com\/blog\/wp-content\/uploads\/2025\/09\/cookiesconsent.png","type":"image\/png"}],"author":"WHS","twitter_card":"summary_large_image","twitter_creator":"@WeHaveServers","twitter_site":"@WeHaveServers","twitter_misc":{"Written by":"WHS","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/wehaveservers.com\/blog\/compliance-privacy\/how-to-build-a-cookie-consent-that-actually-meets-eu-rules-tech-guide\/#article","isPartOf":{"@id":"https:\/\/wehaveservers.com\/blog\/compliance-privacy\/how-to-build-a-cookie-consent-that-actually-meets-eu-rules-tech-guide\/"},"author":{"name":"WHS","@id":"https:\/\/wehaveservers.com\/blog\/#\/schema\/person\/f90cd2ad6ce12bb915c1d00a4770dad0"},"headline":"How to Build a Cookie Consent That Actually Meets EU Rules (Tech Guide)","datePublished":"2025-09-26T08:08:51+00:00","dateModified":"2025-09-29T16:37:58+00:00","mainEntityOfPage":{"@id":"https:\/\/wehaveservers.com\/blog\/compliance-privacy\/how-to-build-a-cookie-consent-that-actually-meets-eu-rules-tech-guide\/"},"wordCount":627,"commentCount":0,"publisher":{"@id":"https:\/\/wehaveservers.com\/blog\/#organization"},"image":{"@id":"https:\/\/wehaveservers.com\/blog\/compliance-privacy\/how-to-build-a-cookie-consent-that-actually-meets-eu-rules-tech-guide\/#primaryimage"},"thumbnailUrl":"https:\/\/wehaveservers.com\/blog\/wp-content\/uploads\/2025\/09\/cookiesconsent.png","keywords":["blocking scripts until consent","build cookie banner eu compliance","cmp vs custom cookie consent","cookie consent gdpr 2025","self-hosted cookie consent tech"],"articleSection":["Compliance &amp; Privacy"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/wehaveservers.com\/blog\/compliance-privacy\/how-to-build-a-cookie-consent-that-actually-meets-eu-rules-tech-guide\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/wehaveservers.com\/blog\/compliance-privacy\/how-to-build-a-cookie-consent-that-actually-meets-eu-rules-tech-guide\/","url":"https:\/\/wehaveservers.com\/blog\/compliance-privacy\/how-to-build-a-cookie-consent-that-actually-meets-eu-rules-tech-guide\/","name":"How to Build a Cookie Consent That Actually Meets EU Rules (Tech Guide) - Blog | WeHaveServers.com","isPartOf":{"@id":"https:\/\/wehaveservers.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/wehaveservers.com\/blog\/compliance-privacy\/how-to-build-a-cookie-consent-that-actually-meets-eu-rules-tech-guide\/#primaryimage"},"image":{"@id":"https:\/\/wehaveservers.com\/blog\/compliance-privacy\/how-to-build-a-cookie-consent-that-actually-meets-eu-rules-tech-guide\/#primaryimage"},"thumbnailUrl":"https:\/\/wehaveservers.com\/blog\/wp-content\/uploads\/2025\/09\/cookiesconsent.png","datePublished":"2025-09-26T08:08:51+00:00","dateModified":"2025-09-29T16:37:58+00:00","breadcrumb":{"@id":"https:\/\/wehaveservers.com\/blog\/compliance-privacy\/how-to-build-a-cookie-consent-that-actually-meets-eu-rules-tech-guide\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/wehaveservers.com\/blog\/compliance-privacy\/how-to-build-a-cookie-consent-that-actually-meets-eu-rules-tech-guide\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wehaveservers.com\/blog\/compliance-privacy\/how-to-build-a-cookie-consent-that-actually-meets-eu-rules-tech-guide\/#primaryimage","url":"https:\/\/wehaveservers.com\/blog\/wp-content\/uploads\/2025\/09\/cookiesconsent.png","contentUrl":"https:\/\/wehaveservers.com\/blog\/wp-content\/uploads\/2025\/09\/cookiesconsent.png","width":768,"height":403,"caption":"cookieconsent"},{"@type":"BreadcrumbList","@id":"https:\/\/wehaveservers.com\/blog\/compliance-privacy\/how-to-build-a-cookie-consent-that-actually-meets-eu-rules-tech-guide\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/wehaveservers.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Build a Cookie Consent That Actually Meets EU Rules (Tech Guide)"}]},{"@type":"WebSite","@id":"https:\/\/wehaveservers.com\/blog\/#website","url":"https:\/\/wehaveservers.com\/blog\/","name":"Blog | WeHaveServers.com","description":"","publisher":{"@id":"https:\/\/wehaveservers.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/wehaveservers.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/wehaveservers.com\/blog\/#organization","name":"THC Projects SRL","url":"https:\/\/wehaveservers.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wehaveservers.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/wehaveservers.com\/blog\/wp-content\/uploads\/2024\/07\/whs-logo-blog.png","contentUrl":"https:\/\/wehaveservers.com\/blog\/wp-content\/uploads\/2024\/07\/whs-logo-blog.png","width":1080,"height":147,"caption":"THC Projects SRL"},"image":{"@id":"https:\/\/wehaveservers.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/WeHaveServers\/","https:\/\/x.com\/WeHaveServers"]},{"@type":"Person","@id":"https:\/\/wehaveservers.com\/blog\/#\/schema\/person\/f90cd2ad6ce12bb915c1d00a4770dad0","name":"WHS","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/e91dfeb1f75c7c898bf30d2646330952683ff1e2646cf0ac34c4a6963c2175ce?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/e91dfeb1f75c7c898bf30d2646330952683ff1e2646cf0ac34c4a6963c2175ce?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e91dfeb1f75c7c898bf30d2646330952683ff1e2646cf0ac34c4a6963c2175ce?s=96&d=mm&r=g","caption":"WHS"},"sameAs":["https:\/\/wehaveservers.com\/blog"],"url":"https:\/\/wehaveservers.com\/blog\/author\/wehaveservers\/"}]}},"_links":{"self":[{"href":"https:\/\/wehaveservers.com\/blog\/wp-json\/wp\/v2\/posts\/298","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wehaveservers.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wehaveservers.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wehaveservers.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wehaveservers.com\/blog\/wp-json\/wp\/v2\/comments?post=298"}],"version-history":[{"count":2,"href":"https:\/\/wehaveservers.com\/blog\/wp-json\/wp\/v2\/posts\/298\/revisions"}],"predecessor-version":[{"id":302,"href":"https:\/\/wehaveservers.com\/blog\/wp-json\/wp\/v2\/posts\/298\/revisions\/302"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wehaveservers.com\/blog\/wp-json\/wp\/v2\/media\/299"}],"wp:attachment":[{"href":"https:\/\/wehaveservers.com\/blog\/wp-json\/wp\/v2\/media?parent=298"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wehaveservers.com\/blog\/wp-json\/wp\/v2\/categories?post=298"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wehaveservers.com\/blog\/wp-json\/wp\/v2\/tags?post=298"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}