{"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":"2026-04-16T11:22:47","modified_gmt":"2026-04-16T09:22:47","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 necessary for the website\u2019s basic functionality. This is known as <strong>Prior Blocking<\/strong>, and it ensures that users have control over their personal data by allowing them to choose whether to allow non-essential cookies on their devices.<\/p>\n\n\n\n<p>It is an important step in protecting user privacy and complying with data protection laws.<\/p>\n\n\n\n<p>In this article, you\u2019ll learn how to set up Prior Blocking with Google Tag Manager and how to add a new tag that only fires when a visitor has accepted cookies via your Cookie &amp; GDPR Manager (iubenda) cookie banner.<\/p>\n\n\n\n<p><strong>Note:<\/strong> To follow this guide, you need to have already created a Google account and set up Google Tag Manager. If you haven\u2019t done this yet, Google provides helpful guides:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/support.google.com\/accounts\/answer\/27441?hl=en\">Creating a Google Account<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/support.google.com\/tagmanager\/answer\/6103696?hl=en\" target=\"_blank\" rel=\"noreferrer noopener\">Setting up Google Tag Manager<\/a><\/li>\n<\/ul>\n\n\n\n<p>If you are trying to install Cookie &amp; GDPR Manager (iubenda) on your WordPress website, please follow <a href=\"https:\/\/kunskap.websupport.se\/en\/kb\/using-cookie-gdpr-manager-with-a-wordpress-website\/\" target=\"_blank\" rel=\"noreferrer noopener\">this guide<\/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 placed on your website pages to collect valuable information about visitor actions. This data is then sent to tools like Google Analytics to help you understand user behavior and make informed decisions.<\/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 necessary for the website\u2019s basic functionality. This is known as Prior Blocking, and it ensures that users have control over their personal data&#8230;<\/p>\n","protected":false},"author":53,"template":"","format":"standard","meta":{"footnotes":""},"ht-kb-category":[540,406],"ht-kb-tag":[543,564,567,570,546],"class_list":["post-22569","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-google-tag-manager-2","ht_kb_tag-gtm","ht_kb_tag-iubenda-2"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Simplify cookie blocking with Google Tag Manager<\/title>\n<meta name=\"description\" content=\"In this article, you\u2019ll learn how to set up Prior Blocking with Google Tag Manager. Easy peasy!\" \/>\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=\"Simplify cookie blocking with Google Tag Manager\" \/>\n<meta property=\"og:description\" content=\"In this article, you\u2019ll learn how to set up Prior Blocking with Google Tag Manager. Easy peasy!\" \/>\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=\"2026-04-16T09:22:47+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\":\"Simplify cookie blocking with Google Tag Manager\",\"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\":\"2026-04-16T09:22:47+00:00\",\"description\":\"In this article, you\u2019ll learn how to set up Prior Blocking with Google Tag Manager. Easy peasy!\",\"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":"Simplify cookie blocking with Google Tag Manager","description":"In this article, you\u2019ll learn how to set up Prior Blocking with Google Tag Manager. Easy peasy!","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":"Simplify cookie blocking with Google Tag Manager","og_description":"In this article, you\u2019ll learn how to set up Prior Blocking with Google Tag Manager. Easy peasy!","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":"2026-04-16T09:22:47+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":"Simplify cookie blocking with Google Tag Manager","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":"2026-04-16T09:22:47+00:00","description":"In this article, you\u2019ll learn how to set up Prior Blocking with Google Tag Manager. Easy peasy!","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":24138,"href":"https:\/\/kunskap.websupport.se\/en\/wp-json\/wp\/v2\/ht-kb\/22569\/revisions\/24138"}],"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}]}}