{"id":22557,"date":"2025-05-19T14:35:06","date_gmt":"2025-05-19T12:35:06","guid":{"rendered":"https:\/\/kunskap.websupport.se\/?post_type=ht_kb&#038;p=22557"},"modified":"2026-04-16T11:09:27","modified_gmt":"2026-04-16T09:09:27","slug":"how-to-implement-cookie-blocking-with-easy-cookieiubenda","status":"publish","type":"ht_kb","link":"https:\/\/kunskap.websupport.se\/en\/kb\/implement-cookie-blocking-with-cookie-gdpr-manager\/","title":{"rendered":"Cookie &amp; GDPR Manager \u2013 Implement cookie blocking"},"content":{"rendered":"\n<p>This guide shows how to implement cookie blocking using <a href=\"https:\/\/websupport.se\/en\/cookie-gdpr-manager\/\">Cookie &amp; GDPR Manager <\/a>together with Google Tag Manager (GTM), with <strong>prior blocking<\/strong> enabled.<\/p>\n\n\n\n<p>This means that non-essential cookies are blocked until the visitor has given their consent \u2013 a requirement under GDPR.<\/p>\n\n\n\n<p><strong>Note:<\/strong> Before you begin, make sure you have configured the Cookie &amp; GDPR Manager (iubenda) tags in Google Tag Manager. We have a simple guide for this available <a href=\"https:\/\/kunskap.websupport.se\/en\/kb\/how-to-simplify-cookie-blocking-with-google-tag-manager\/\">here<\/a>.<\/p>\n\n\n\n<p>If your website is built with WordPress, there is an official plugin you can use to add Cookie &amp; GDPR Manager to your site. You can find our guide for that <a href=\"https:\/\/kunskap.websupport.se\/en\/kb\/using-cookie-gdpr-manager-with-a-wordpress-website\/\">here<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"what-is-prior-blocking\"><strong>What is Prior Blocking?<\/strong><\/h2>\n\n\n\n<p>The General Data Protection Regulation (GDPR) requires websites to obtain informed consent from users before using cookies that are not strictly necessary for the website\u2019s basic functionality.<\/p>\n\n\n\n<p>Prior blocking ensures that users have control over their personal data by allowing them to decide whether non-essential cookies should be placed on their device.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"find-your-iubenda-embed-code\">Find your code in Cookie &amp; GDPR Manager (iubenda)<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Log in to the Websupport control panel<\/li>\n\n\n\n<li>Go to <strong>Services \u2192 Cookie &amp; GDPR Manager<\/strong> <\/li>\n\n\n\n<li>Click <strong>Go to app<\/strong> In the Cookie &amp; GDPR Manager (iubenda) dashboard, locate <strong>Privacy Controls and Cookie Solution<\/strong> and click <strong>Configure<\/strong> <\/li>\n\n\n\n<li>Make sure all your policies are in place and click <strong>Save and go to embedding<\/strong><\/li>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.names.co.uk\/support\/wp-content\/uploads\/2023\/05\/image-4-1024x594.png\" alt=\"\" class=\"wp-image-3736\" \/><\/figure>\n\n\n\n<li>Locate <strong>Privacy Controls and Cookie Solution<\/strong> again and click <strong>Embed<\/strong> to find the code for your website <\/li>\n\n\n\n<li>Copy the code by clicking the gray button saying <strong>COPY<\/strong><\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.names.co.uk\/support\/wp-content\/uploads\/2023\/05\/image-5-1024x590.png\" alt=\"\" class=\"wp-image-3737\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"amending-the-code-to-work-with-google-tag-manager\"><strong>Customize the code for Google Tag Manager<\/strong><\/h2>\n\n\n\n<p>You need to add a few lines to the code you copied to ensure that your tags only fire when the visitor gives consent.<\/p>\n\n\n\n<p>Paste the copied code into a text editor of your choice (e.g. Notepad, Word, or Google Docs). The code should look something like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;script type=\"text\/javascript\"&gt;\n\tvar _iub = _iub || &#091;];\n\t_iub.csConfiguration = {\n\t\"askConsentAtCookiePolicyUpdate\":true,\n\t\"enableLgpd\":true,\n\t\"enableUspr\":true,\n\t\"floatingPreferencesButtonDisplay\":\"bottom-right\",\"lang\":\"en-GB\",\"perPurposeConsent\":true,\n\t\"siteId\":3138964,\n\t\"usprApplies\":true,\n\t\"whitelabel\":false,\n\t\"cookiePolicyId\":73037660, \n\t\"banner\":{ \n\t\t\"acceptButtonDisplay\":true,\n\t\t\"backgroundOverlay\":true,\n\t\t\"closeButtonDisplay\":false,\n\t\t\"customizeButtonDisplay\":true,\n\t\t\"explicitWithdrawal\":true,\n\t\t\"listPurposes\":true,\n\t\t\"rejectButtonDisplay\":true,\n\t\t\"showPurposesToggles\":true \n\t\t\t}\n\t};\n&lt;\/script&gt;\n&lt;script type=\"text\/javascript\" src=\"\/\/cdn.iubenda.com\/cs\/gpp\/stub.js\"&gt;&lt;\/script&gt;\n&lt;script type=\"text\/javascript\" src=\"\/\/cdn.iubenda.com\/cs\/iubenda_cs.js\" charset=\"UTF-8\" async&gt;&lt;\/script&gt;\n<\/code><\/pre>\n\n\n\n<p>Now, copy the code below, including the initial \u201d , \u201c<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>,\n        \"callback\": {\n            onPreferenceExpressedOrNotNeeded: function(preference) {\n                dataLayer.push({\n                    iubenda_ccpa_opted_out: _iub.cs.api.isCcpaOptedOut()\n                });\n                if (!preference) {\n                    dataLayer.push({\n                        event: \"iubenda_preference_not_needed\"\n                    });\n                } else {\n                    if (preference.consent === true) {\n                        dataLayer.push({\n                            event: \"iubenda_consent_given\"\n                        });\n                    } else if (preference.consent === false) {\n                        dataLayer.push({\n                            event: \"iubenda_consent_rejected\"\n                        });\n                    } else if (preference.purposes) {\n                        for (var purposeId in preference.purposes) {\n                            if (preference.purposes&#091;purposeId]) {\n                                dataLayer.push({\n                                    event: \"iubenda_consent_given_purpose_\" + purposeId\n                                });\n                            }\n                        }\n                    }\n                }\n            }\n        }\n<\/code><\/pre>\n\n\n\n<p>Paste the copied code into your original code, at the point we have shown in the screenshot below:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.names.co.uk\/support\/wp-content\/uploads\/2023\/05\/image-1.png\" alt=\"\" class=\"wp-image-3731\" \/><\/figure>\n\n\n\n<p>You should now have a full set of code that looks like the following:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;script type=\"text\/javascript\"&gt;\n\tvar _iub = _iub || &#091;];\n\t_iub.csConfiguration = {\n\t\t\"askConsentAtCookiePolicyUpdate\":true,\n\t\"enableLgpd\":true,\n\t\"enableUspr\":true,\n\t\"floatingPreferencesButtonDisplay\":\"bottom-right\",\"lang\":\"en-GB\",\"perPurposeConsent\":true,\n\t\"siteId\":3138964,\n\t\"usprApplies\":true,\n\t\"whitelabel\":false,\n\t\"cookiePolicyId\":73037660, \n\t\"banner\":{ \n\t\t\"acceptButtonDisplay\":true,\n\t\t\"backgroundOverlay\":true,\n\t\t\"closeButtonDisplay\":false,\n\t\t\"customizeButtonDisplay\":true,\n\t\t\"explicitWithdrawal\":true,\n\t\t\"listPurposes\":true,\n\t\t\"rejectButtonDisplay\":true,\n\t\t\"showPurposesToggles\":true \n\t\t\t},\n        \"callback\": {\n            onPreferenceExpressedOrNotNeeded: function(preference) {\n                dataLayer.push({\n                    iubenda_ccpa_opted_out: _iub.cs.api.isCcpaOptedOut()\n                });\n                if (!preference) {\n                    dataLayer.push({\n                        event: \"iubenda_preference_not_needed\"\n                    });\n                } else {\n                    if (preference.consent === true) {\n                        dataLayer.push({\n                            event: \"iubenda_consent_given\"\n                        });\n                    } else if (preference.consent === false) {\n                        dataLayer.push({\n                            event: \"iubenda_consent_rejected\"\n                        });\n                    } else if (preference.purposes) {\n                        for (var purposeId in preference.purposes) {\n                            if (preference.purposes&#091;purposeId]) {\n                                dataLayer.push({\n                                    event: \"iubenda_consent_given_purpose_\" + purposeId\n                                });\n                            }\n                        }\n                    }\n                }\n            }\n        }\n\t};\n&lt;\/script&gt;\n&lt;script type=\"text\/javascript\" src=\"\/\/cdn.iubenda.com\/cs\/gpp\/stub.js\"&gt;&lt;\/script&gt;\n&lt;script type=\"text\/javascript\" src=\"\/\/cdn.iubenda.com\/cs\/iubenda_cs.js\" charset=\"UTF-8\" async&gt;&lt;\/script&gt;\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Add the code to your website<\/h2>\n\n\n\n<p>Once your code is ready, paste it into your website just before the closing <code>&lt;\/body&gt;<\/code> tag.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"publicera-i-google-tag-manager\">Publish in Google Tag Manager<\/h2>\n\n\n\n<p>When everything is set up, publish your tags and triggers in Google Tag Manager to make them active on your website.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.names.co.uk\/support\/wp-content\/uploads\/2023\/05\/PUBLISH-GTM-CONTAINER-1024x578.webp\" alt=\"\" class=\"wp-image-3732\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"summary\">Test that everything works<\/h2>\n\n\n\n<p>Make sure that:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The cookie banner is displayed correctly <\/li>\n\n\n\n<li>No non-essential cookies are set before consent <\/li>\n\n\n\n<li>GTM tags only fire after consent is given<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"summary\"><strong>Summary<\/strong><\/h2>\n\n\n\n<p>You have now connected Cookie &amp; GDPR Manager with Google Tag Manager using prior blocking.<\/p>\n\n\n\n<p>This means:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Cookies are properly blocked before consent<\/li>\n\n\n\n<li>Your tags respect the user\u2019s choices<\/li>\n\n\n\n<li>Your website complies with data protection requirements<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"next-steps\"><strong>Next Steps<\/strong><\/h2>\n\n\n\n<p>Add more tags in Google Tag Manager as needed and connect them to the correct triggers. Don\u2019t forget to publish your changes each time you update your configuration.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This guide shows how to implement cookie blocking using Cookie &amp; GDPR Manager together with Google Tag Manager (GTM), with prior blocking enabled. This means that non-essential cookies are blocked until the visitor has given their consent \u2013 a requirement under GDPR. Note: Before you begin, make sure you have&#8230;<\/p>\n","protected":false},"author":53,"template":"","format":"standard","meta":{"footnotes":""},"ht-kb-category":[540,406],"ht-kb-tag":[543,564,546],"class_list":["post-22557","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-cookie-gdpr-manager-web-hosting","ht_kb_category-web-hosting","ht_kb_tag-cookie-gdpr-manager-2","ht_kb_tag-cookie-blocking","ht_kb_tag-iubenda-2"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Implement cookie blocking with Cookie &amp; GDPR Manager<\/title>\n<meta name=\"description\" content=\"This guide shows how to implement cookie blocking using Cookie &amp; GDPR Manager together with GTM, with prior blocking enabled.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/kunskap.websupport.se\/en\/kb\/implement-cookie-blocking-with-cookie-gdpr-manager\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Implement cookie blocking with Cookie &amp; GDPR Manager\" \/>\n<meta property=\"og:description\" content=\"This guide shows how to implement cookie blocking using Cookie &amp; GDPR Manager together with GTM, with prior blocking enabled.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/kunskap.websupport.se\/en\/kb\/implement-cookie-blocking-with-cookie-gdpr-manager\/\" \/>\n<meta property=\"og:site_name\" content=\"Websupport kunskapsdatabas\" \/>\n<meta property=\"article:modified_time\" content=\"2026-04-16T09:09:27+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/kunskap.websupport.se\/en\/kb\/implement-cookie-blocking-with-cookie-gdpr-manager\/\",\"url\":\"https:\/\/kunskap.websupport.se\/en\/kb\/implement-cookie-blocking-with-cookie-gdpr-manager\/\",\"name\":\"Implement cookie blocking with Cookie & GDPR Manager\",\"isPartOf\":{\"@id\":\"https:\/\/kunskap.websupport.se\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/kunskap.websupport.se\/en\/kb\/implement-cookie-blocking-with-cookie-gdpr-manager\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/kunskap.websupport.se\/en\/kb\/implement-cookie-blocking-with-cookie-gdpr-manager\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.names.co.uk\/support\/wp-content\/uploads\/2023\/05\/image-4-1024x594.png\",\"datePublished\":\"2025-05-19T12:35:06+00:00\",\"dateModified\":\"2026-04-16T09:09:27+00:00\",\"description\":\"This guide shows how to implement cookie blocking using Cookie & GDPR Manager together with GTM, with prior blocking enabled.\",\"breadcrumb\":{\"@id\":\"https:\/\/kunskap.websupport.se\/en\/kb\/implement-cookie-blocking-with-cookie-gdpr-manager\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/kunskap.websupport.se\/en\/kb\/implement-cookie-blocking-with-cookie-gdpr-manager\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/kunskap.websupport.se\/en\/kb\/implement-cookie-blocking-with-cookie-gdpr-manager\/#primaryimage\",\"url\":\"https:\/\/www.names.co.uk\/support\/wp-content\/uploads\/2023\/05\/image-4-1024x594.png\",\"contentUrl\":\"https:\/\/www.names.co.uk\/support\/wp-content\/uploads\/2023\/05\/image-4-1024x594.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/kunskap.websupport.se\/en\/kb\/implement-cookie-blocking-with-cookie-gdpr-manager\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/kunskap.websupport.se\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Cookie &amp; GDPR Manager \u2013 Implement cookie blocking\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/kunskap.websupport.se\/en\/#website\",\"url\":\"https:\/\/kunskap.websupport.se\/en\/\",\"name\":\"Websupport kunskapsdatabas\",\"description\":\"Websupport kunskapsdatabas\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/kunskap.websupport.se\/en\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Implement cookie blocking with Cookie & GDPR Manager","description":"This guide shows how to implement cookie blocking using Cookie & GDPR Manager together with GTM, with prior blocking enabled.","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:\/\/kunskap.websupport.se\/en\/kb\/implement-cookie-blocking-with-cookie-gdpr-manager\/","og_locale":"en_US","og_type":"article","og_title":"Implement cookie blocking with Cookie & GDPR Manager","og_description":"This guide shows how to implement cookie blocking using Cookie & GDPR Manager together with GTM, with prior blocking enabled.","og_url":"https:\/\/kunskap.websupport.se\/en\/kb\/implement-cookie-blocking-with-cookie-gdpr-manager\/","og_site_name":"Websupport kunskapsdatabas","article_modified_time":"2026-04-16T09:09:27+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/kunskap.websupport.se\/en\/kb\/implement-cookie-blocking-with-cookie-gdpr-manager\/","url":"https:\/\/kunskap.websupport.se\/en\/kb\/implement-cookie-blocking-with-cookie-gdpr-manager\/","name":"Implement cookie blocking with Cookie & GDPR Manager","isPartOf":{"@id":"https:\/\/kunskap.websupport.se\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/kunskap.websupport.se\/en\/kb\/implement-cookie-blocking-with-cookie-gdpr-manager\/#primaryimage"},"image":{"@id":"https:\/\/kunskap.websupport.se\/en\/kb\/implement-cookie-blocking-with-cookie-gdpr-manager\/#primaryimage"},"thumbnailUrl":"https:\/\/www.names.co.uk\/support\/wp-content\/uploads\/2023\/05\/image-4-1024x594.png","datePublished":"2025-05-19T12:35:06+00:00","dateModified":"2026-04-16T09:09:27+00:00","description":"This guide shows how to implement cookie blocking using Cookie & GDPR Manager together with GTM, with prior blocking enabled.","breadcrumb":{"@id":"https:\/\/kunskap.websupport.se\/en\/kb\/implement-cookie-blocking-with-cookie-gdpr-manager\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/kunskap.websupport.se\/en\/kb\/implement-cookie-blocking-with-cookie-gdpr-manager\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/kunskap.websupport.se\/en\/kb\/implement-cookie-blocking-with-cookie-gdpr-manager\/#primaryimage","url":"https:\/\/www.names.co.uk\/support\/wp-content\/uploads\/2023\/05\/image-4-1024x594.png","contentUrl":"https:\/\/www.names.co.uk\/support\/wp-content\/uploads\/2023\/05\/image-4-1024x594.png"},{"@type":"BreadcrumbList","@id":"https:\/\/kunskap.websupport.se\/en\/kb\/implement-cookie-blocking-with-cookie-gdpr-manager\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/kunskap.websupport.se\/"},{"@type":"ListItem","position":2,"name":"Cookie &amp; GDPR Manager \u2013 Implement cookie blocking"}]},{"@type":"WebSite","@id":"https:\/\/kunskap.websupport.se\/en\/#website","url":"https:\/\/kunskap.websupport.se\/en\/","name":"Websupport kunskapsdatabas","description":"Websupport kunskapsdatabas","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/kunskap.websupport.se\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/kunskap.websupport.se\/en\/wp-json\/wp\/v2\/ht-kb\/22557","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kunskap.websupport.se\/en\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/kunskap.websupport.se\/en\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/kunskap.websupport.se\/en\/wp-json\/wp\/v2\/users\/53"}],"version-history":[{"count":4,"href":"https:\/\/kunskap.websupport.se\/en\/wp-json\/wp\/v2\/ht-kb\/22557\/revisions"}],"predecessor-version":[{"id":24126,"href":"https:\/\/kunskap.websupport.se\/en\/wp-json\/wp\/v2\/ht-kb\/22557\/revisions\/24126"}],"wp:attachment":[{"href":"https:\/\/kunskap.websupport.se\/en\/wp-json\/wp\/v2\/media?parent=22557"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/kunskap.websupport.se\/en\/wp-json\/wp\/v2\/ht-kb-category?post=22557"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/kunskap.websupport.se\/en\/wp-json\/wp\/v2\/ht-kb-tag?post=22557"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}