{"id":22569,"date":"2025-05-19T14:20:11","date_gmt":"2025-05-19T12:20:11","guid":{"rendered":"https:\/\/kunskap.websupport.se\/?post_type=ht_kb&#038;p=22569"},"modified":"2025-05-26T14:27:00","modified_gmt":"2025-05-26T12:27:00","slug":"how-to-simplify-cookie-blocking-with-google-tag-manager","status":"publish","type":"ht_kb","link":"https:\/\/kunskap.websupport.se\/en\/kb\/how-to-simplify-cookie-blocking-with-google-tag-manager\/","title":{"rendered":"How to simplify cookie blocking with Google Tag Manager"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"why-do-i-need-to-block-cookies\">Why do I need to block cookies?<\/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 essential for the website\u2019s basic functioning. This is called Prior Blocking and ensures that users have control over their personal information by allowing them to decide whether or not they want non-essential cookies to be placed on their devices. It is an important step in protecting user privacy and complying with data protection regulations.<\/p>\n\n\n\n<p>In this article you will learn how to setup Prior Blocking using Google Tag Manager and how to add a new tag that is only activated when the visitor has clicked to accept cookies on your iubenda cookie banner.<\/p>\n\n\n\n<p><strong>Note:<\/strong> To follow through the guide, you will need to have already created a Google Account and have setup Google Tag Manager. If you haven\u2019t completed those steps, Google themselves have easy-to-follow guides that can help you:<br><br><a href=\"https:\/\/support.google.com\/accounts\/answer\/27441?hl=en\">Creating a Google Account<\/a><br><a href=\"https:\/\/support.google.com\/tagmanager\/answer\/6103696?hl=en\" target=\"_blank\" rel=\"noreferrer noopener\">Setting up Google Tag Manager<\/a><br><br>If you are trying to install iubenda on your WordPress website, follow <a href=\"https:\/\/kunskap.websupport.se\/en\/?post_type=ht_kb&amp;p=22488\" target=\"_blank\" rel=\"noreferrer noopener\">Using Easy cookie(iubenda) with a WordPress website<\/a> instead.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"what-is-google-tag-manager\"><strong>What is Google Tag Manager?<\/strong><\/h2>\n\n\n\n<p>Google Tag Manager is a tool that helps website owners manage and control various tracking codes and scripts on their website. It simplifies the process of adding and updating code snippets, such as tracking pixels, analytics tags, or advertising tags.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"what-is-a-tag\"><strong>What is a tag?<\/strong><\/h3>\n\n\n\n<p>A tag is a small piece of code that is placed on the pages of your website to collect valuable information about what actions your visitors are taking. The information gathered by the tag is then sent to tools like Google Analytics, to help you understand your visitors\u2019 behaviour and make informed decisions for your site.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"how-to-add-a-new-tag\"><strong>How to add a new Tag<\/strong><\/h2>\n\n\n\n<p>In this example, we will setup a tag for Google Analytics 4 tracking, but you can follow the same process for any tag that you might need to use on your website.<\/p>\n\n\n\n<p>Firstly, log in to your Google Tag Manager dashboard and click&nbsp;<strong>\u2018Add a new tag\u2019<\/strong><\/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\/Google-Tag-Manager-dashboard.webp\" alt=\"\" class=\"wp-image-3713\" \/><\/figure>\n\n\n\n<p>Click on the&nbsp;<strong>Tag configuration window<\/strong>&nbsp;as seen in the image 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\/Tag-configuration-1024x601.png\" alt=\"\" class=\"wp-image-3714\" \/><\/figure>\n\n\n\n<p>Select the tag you want to setup. For this example, we are adding&nbsp;<strong>Google Analytics: GA4 Configuration<\/strong>.<\/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\/Google-Analytics-4-1024x967.png\" alt=\"\" class=\"wp-image-3715\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"configure-the-tag\"><strong>Configure the tag<\/strong><\/h2>\n\n\n\n<p>You will now need to enter the necessary details into the Tag Configuration screen.<\/p>\n\n\n\n<p>In this example we need to add the&nbsp;<strong>Measurement ID<\/strong>&nbsp;(e.g, G-A2ABC2ABCD) for our GA4 property (available once you have&nbsp;<a href=\"https:\/\/support.google.com\/analytics\/answer\/9304153?hl=en\">setup your website in Google Analytics<\/a>), then we click the blue \u2018Save\u2019 button.<\/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\/Configure-the-tag-1024x568.png\" alt=\"\" class=\"wp-image-3716\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"adding-triggers\"><strong>Adding triggers<\/strong><\/h2>\n\n\n\n<p>Now that we have setup the tag, we must set these triggers that will allow the tag to activate and the visitor\u2019s activities on our site to be tracked:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>iubenda_consent_given \niubenda_preference_not_needed\n<\/code><\/pre>\n\n\n\n<p><strong>Advanced Setup:<\/strong> If you\u2019ve enabled the per-category consent feature on your Privacy Controls and Cookie Solution, instead of the <em>iubenda_consent_given<\/em> event, you\u2019ll have to create a custom event for each purpose you display on your cookie banner\/policy (with the exception of the \u201cNecessary\u201d purpose). More information on setting those triggers up can be found <a href=\"https:\/\/www.iubenda.com\/en\/help\/1235-google-tag-manager-blocking-cookies\">here<\/a>.<br><br>If you\u2019re implementing Google Consent Mode, skip this step and jump to the installation guide.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"add-the-iubenda-consent-given-trigger\"><strong>Add the&nbsp;<em>iubenda_consent_given<\/em>&nbsp;trigger<\/strong><\/h3>\n\n\n\n<p>Click on the&nbsp;<strong>\u201cTriggering\u201d<\/strong>&nbsp;section 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\/consent-given.png\" alt=\"\" class=\"wp-image-3718\" \/><\/figure>\n\n\n\n<p>Then click on the little&nbsp;<strong>plus sign<\/strong>&nbsp;on the top right to add a new Trigger. Now, in the trigger configuration window, select&nbsp;<strong>Custom Event<\/strong>&nbsp;(quick note here: please be sure NOT to select \u201cAll Pages\u201d as a trigger).<\/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\/trigger-type.webp\" alt=\"\" class=\"wp-image-3719\" \/><\/figure>\n\n\n\n<p>For event name please input the following value:&nbsp;<em>iubenda_consent_given<\/em>. This will activate the trigger on All Custom Events labelled Consent Given.<\/p>\n\n\n\n<p>Save the trigger by clicking on \u2018<strong>Save<\/strong>\u2018.<\/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\/save-trigger-1024x373.webp\" alt=\"\" class=\"wp-image-3721\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"add-the-iubenda-preference-not-needed-trigger\"><strong>Add the&nbsp;<em>iubenda_preference_not_needed<\/em>&nbsp;trigger<\/strong><\/h3>\n\n\n\n<p>Follow the same steps to create another trigger called&nbsp;<em>iubenda_preference_not_needed<\/em>, that fires whenever a preference is not needed (for example when GDPR does not apply or the user is based outside the EU).<\/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\/consent-not-needed-1024x378.png\" alt=\"\" class=\"wp-image-3722\" \/><\/figure>\n\n\n\n<p><strong>Note:<\/strong> If the CCPA applies to you, you will need to add an exception rule, to disable the relevant cookies when the user opts out. More information on setting up that trigger can be found <a href=\"https:\/\/www.iubenda.com\/en\/help\/1235-google-tag-manager-blocking-cookies\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a><\/p>\n\n\n\n<p>Now that the triggers have been added, your Google Analytics: GA4 Configuration tag will look like this:<\/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-1024x480.png\" alt=\"\" class=\"wp-image-3725\" \/><\/figure>\n\n\n\n<p>Click on&nbsp;<strong>\u2018Save\u2019<\/strong>&nbsp;to save the new tag.<\/p>\n\n\n\n<p>The previous example assumes that you\u2019re firing the tag on all pages of your site, if you\u2019d like to have a tag fire on just one page (eg. Shopping Cart page) see the <a href=\"https:\/\/www.iubenda.com\/en\/help\/1235-google-tag-manager-blocking-cookies#advanced\">advanced section here<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"summary\"><strong>Summary<\/strong><\/h2>\n\n\n\n<p>Now that you have completed all the steps in this guide, you have setup Prior Blocking and created a tag for Google Analytics 4, that will only activate when:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>The visitor has agreed to the use of cookies<\/li>\n\n\n\n<li>GDPR does not apply to the visitor or they are based outside of the EU.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"next-steps\"><strong>Next Steps<\/strong><\/h2>\n\n\n\n<p>If there are any additional tags that you need to create, follow this process again to add the new tag to your Google Tag Manager dashboard.<\/p>\n\n\n\n<p>Once you have setup all of your tags, your next step will be to install the iuebenda Privacy Controls and Cookie Solution on your website, so that visitors can accept or reject cookies. We have a guide to take you through that process that is available <a href=\"https:\/\/kunskap.websupport.se\/en\/kb\/how-to-implement-cookie-blocking-with-easy-cookieiubenda\/\">here<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Why do I need to block cookies? The General Data Protection Regulation (GDPR) requires websites to obtain informed consent from users before using cookies that are not essential for the website\u2019s basic functioning. This is called Prior Blocking and ensures that users have control over their personal information by allowing&#8230;<\/p>\n","protected":false},"author":53,"template":"","format":"standard","meta":{"footnotes":""},"ht-kb-category":[510,406],"ht-kb-tag":[],"class_list":["post-22569","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-easy-cookie-web-hosting","ht_kb_category-web-hosting"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to simplify cookie blocking with Google Tag Manager - Websupport kunskapsdatabas<\/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:\/\/kunskap.websupport.se\/en\/kb\/how-to-simplify-cookie-blocking-with-google-tag-manager\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to simplify cookie blocking with Google Tag Manager - Websupport kunskapsdatabas\" \/>\n<meta property=\"og:description\" content=\"Why do I need to block cookies? The General Data Protection Regulation (GDPR) requires websites to obtain informed consent from users before using cookies that are not essential for the website\u2019s basic functioning. This is called Prior Blocking and ensures that users have control over their personal information by allowing...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/kunskap.websupport.se\/en\/kb\/how-to-simplify-cookie-blocking-with-google-tag-manager\/\" \/>\n<meta property=\"og:site_name\" content=\"Websupport kunskapsdatabas\" \/>\n<meta property=\"article:modified_time\" content=\"2025-05-26T12:27:00+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=\"7 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\/how-to-simplify-cookie-blocking-with-google-tag-manager\/\",\"url\":\"https:\/\/kunskap.websupport.se\/en\/kb\/how-to-simplify-cookie-blocking-with-google-tag-manager\/\",\"name\":\"How to simplify cookie blocking with Google Tag Manager - Websupport kunskapsdatabas\",\"isPartOf\":{\"@id\":\"https:\/\/kunskap.websupport.se\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/kunskap.websupport.se\/en\/kb\/how-to-simplify-cookie-blocking-with-google-tag-manager\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/kunskap.websupport.se\/en\/kb\/how-to-simplify-cookie-blocking-with-google-tag-manager\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.names.co.uk\/support\/wp-content\/uploads\/2023\/05\/Google-Tag-Manager-dashboard.webp\",\"datePublished\":\"2025-05-19T12:20:11+00:00\",\"dateModified\":\"2025-05-26T12:27:00+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/kunskap.websupport.se\/en\/kb\/how-to-simplify-cookie-blocking-with-google-tag-manager\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/kunskap.websupport.se\/en\/kb\/how-to-simplify-cookie-blocking-with-google-tag-manager\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/kunskap.websupport.se\/en\/kb\/how-to-simplify-cookie-blocking-with-google-tag-manager\/#primaryimage\",\"url\":\"https:\/\/www.names.co.uk\/support\/wp-content\/uploads\/2023\/05\/Google-Tag-Manager-dashboard.webp\",\"contentUrl\":\"https:\/\/www.names.co.uk\/support\/wp-content\/uploads\/2023\/05\/Google-Tag-Manager-dashboard.webp\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/kunskap.websupport.se\/en\/kb\/how-to-simplify-cookie-blocking-with-google-tag-manager\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/kunskap.websupport.se\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to simplify cookie blocking with Google Tag Manager\"}]},{\"@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":"How to simplify cookie blocking with Google Tag Manager - Websupport kunskapsdatabas","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\/how-to-simplify-cookie-blocking-with-google-tag-manager\/","og_locale":"en_US","og_type":"article","og_title":"How to simplify cookie blocking with Google Tag Manager - Websupport kunskapsdatabas","og_description":"Why do I need to block cookies? The General Data Protection Regulation (GDPR) requires websites to obtain informed consent from users before using cookies that are not essential for the website\u2019s basic functioning. This is called Prior Blocking and ensures that users have control over their personal information by allowing...","og_url":"https:\/\/kunskap.websupport.se\/en\/kb\/how-to-simplify-cookie-blocking-with-google-tag-manager\/","og_site_name":"Websupport kunskapsdatabas","article_modified_time":"2025-05-26T12:27:00+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/kunskap.websupport.se\/en\/kb\/how-to-simplify-cookie-blocking-with-google-tag-manager\/","url":"https:\/\/kunskap.websupport.se\/en\/kb\/how-to-simplify-cookie-blocking-with-google-tag-manager\/","name":"How to simplify cookie blocking with Google Tag Manager - Websupport kunskapsdatabas","isPartOf":{"@id":"https:\/\/kunskap.websupport.se\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/kunskap.websupport.se\/en\/kb\/how-to-simplify-cookie-blocking-with-google-tag-manager\/#primaryimage"},"image":{"@id":"https:\/\/kunskap.websupport.se\/en\/kb\/how-to-simplify-cookie-blocking-with-google-tag-manager\/#primaryimage"},"thumbnailUrl":"https:\/\/www.names.co.uk\/support\/wp-content\/uploads\/2023\/05\/Google-Tag-Manager-dashboard.webp","datePublished":"2025-05-19T12:20:11+00:00","dateModified":"2025-05-26T12:27:00+00:00","breadcrumb":{"@id":"https:\/\/kunskap.websupport.se\/en\/kb\/how-to-simplify-cookie-blocking-with-google-tag-manager\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/kunskap.websupport.se\/en\/kb\/how-to-simplify-cookie-blocking-with-google-tag-manager\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/kunskap.websupport.se\/en\/kb\/how-to-simplify-cookie-blocking-with-google-tag-manager\/#primaryimage","url":"https:\/\/www.names.co.uk\/support\/wp-content\/uploads\/2023\/05\/Google-Tag-Manager-dashboard.webp","contentUrl":"https:\/\/www.names.co.uk\/support\/wp-content\/uploads\/2023\/05\/Google-Tag-Manager-dashboard.webp"},{"@type":"BreadcrumbList","@id":"https:\/\/kunskap.websupport.se\/en\/kb\/how-to-simplify-cookie-blocking-with-google-tag-manager\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/kunskap.websupport.se\/"},{"@type":"ListItem","position":2,"name":"How to simplify cookie blocking with Google Tag Manager"}]},{"@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\/22569","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\/22569\/revisions"}],"predecessor-version":[{"id":22809,"href":"https:\/\/kunskap.websupport.se\/en\/wp-json\/wp\/v2\/ht-kb\/22569\/revisions\/22809"}],"wp:attachment":[{"href":"https:\/\/kunskap.websupport.se\/en\/wp-json\/wp\/v2\/media?parent=22569"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/kunskap.websupport.se\/en\/wp-json\/wp\/v2\/ht-kb-category?post=22569"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/kunskap.websupport.se\/en\/wp-json\/wp\/v2\/ht-kb-tag?post=22569"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}