{"id":1137,"date":"2020-08-06T14:02:00","date_gmt":"2020-08-06T12:02:00","guid":{"rendered":"https:\/\/www.cookiebot.com\/en\/?p=1137"},"modified":"2026-03-12T09:15:14","modified_gmt":"2026-03-12T08:15:14","slug":"google-tag-manager","status":"publish","type":"post","link":"https:\/\/www.cookiebot.com\/en\/google-tag-manager\/","title":{"rendered":"What is Google Tag Manager, and how does it work with the General Data Protection Regulation (GDPR) and cookie consent?"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"h-what-is-google-tag-manager\">What is Google Tag Manager?<\/h2>\n\n\n\n<p>Google Tag Manager is a tool that enables website owners to manage and deploy marketing tags on their website without needing to modify the code.<\/p>\n\n\n\n<p>These tags include Google Analytics, Google Ads, and other tracking codes that provide insights into a website\u2019s performance. These insights help website owners update and optimize their website and its content based on real-life user interactions and performance statistics.<\/p>\n\n\n\n<p>Common uses of Google Tag Manager include:<\/p>\n\n\n\n<ul style=\"background-color:#f2f7fe\" class=\"wp-block-list cb-rounded has-background\">\n<li>tracking website page view<\/li>\n\n\n\n<li>tracking button clicks<\/li>\n\n\n\n<li>tracking external links\/outbound clicks<\/li>\n\n\n\n<li>tracking conversions, such as in Google Ads<\/li>\n\n\n\n<li>tracking how a user scrolls and behaves on a page<\/li>\n\n\n\n<li>collecting user data, such as geolocation, device type and even screen width.<\/li>\n<\/ul>\n\n\n\n<p>If this gets too technical, then think of it this way:<\/p>\n\n\n\n<p>If your website is a symphony hall and the tags are all the different musicians you\u2019ve chosen to house, then Google Tag Manager is the conductor. The conductor chooses what instruments are to play and when they are to play, in what order and for what duration.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"900\" height=\"450\" src=\"https:\/\/www.cookiebot.com\/en\/wp-content\/uploads\/sites\/7\/2020\/08\/what_is_google_tag_mgr_900x450_body_1.svg\" alt=\"\" class=\"wp-image-16666\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-how-does-google-tag-manager-work\">How does Google Tag Manager work?<\/h3>\n\n\n\n<p>Google Tag Manager works through <strong><em>tags<\/em><\/strong> and <strong><em>triggers<\/em><\/strong>.<\/p>\n\n\n\n<p><strong><em>Tags<\/em><\/strong> are pieces of code, such as HTML or JavaScript, which are deployed on your website for analytics or marketing purposes, or it could be a social media plugin as well. They are also known by names such as tracking pixel, web beacons, ultrasound beacons and many others depending on their functions.<\/p>\n\n\n\n<p>Collections of tags, such as \u201cmarketing\u201d, are called <strong><em>tag containers<\/em><\/strong>.<\/p>\n\n\n\n<p><strong><em>Triggers<\/em><\/strong> are the conditions under which tags are allowed to fire. Google Tag Manager can control when a certain tag is fired.<\/p>\n\n\n\n<p>Imagine a user is browsing a clothing website and clicks on a product. You can set a trigger in Google Tag Manager to fire a tag when this specific click event occurs. This tag might then send information to an analytics tool like <a href=\"https:\/\/www.cookiebot.com\/en\/google-analytics-gdpr\/\">Google Analytics<\/a>, recording that the user showed interest in that particular product. This action-trigger relationship helps the website owner understand user behavior and preferences based on specific interactions on the website.<\/p>\n\n\n\n<p>These <strong><em>rules<\/em><\/strong> can be URL-based or event-based, such as when a user scrolls or clicks on some area of your website.<\/p>\n\n\n\n<p>In other words:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>tags are what happens<\/li>\n\n\n\n<li>triggers are when they happen<\/li>\n<\/ul>\n\n\n\n<p>Most third-party tags (tags from other websites, not the one the user is browsing) will set <a href=\"https:\/\/www.cookiebot.com\/en\/google-third-party-cookies\/\">third-party cookies<\/a> that, according to the <a href=\"https:\/\/www.cookiebot.com\/en\/gdpr\/\">General Data Protection Regulation (GDPR)<\/a>, require the explicit prior consent of your users.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"900\" height=\"450\" src=\"https:\/\/www.cookiebot.com\/en\/wp-content\/uploads\/sites\/7\/2020\/08\/what_is_google_tag_mgr_900x450_body_2.svg\" alt=\"\" class=\"wp-image-16665\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-why-is-cookie-consent-important\">Why is cookie consent important?<\/h3>\n\n\n\n<p>The concept of <a href=\"https:\/\/www.cookiebot.com\/en\/cookie-consent\/\">cookie consent<\/a> gives website visitors the power to choose whether they agree to let companies collect their data. It is a legal requirement under privacy laws like the GDPR. The significance of cookie consent is highlighted by the fact that many people prefer not to do business with companies that share their sensitive data without permission. With cookies being a common method for data collection, obtaining cookie consent has become a crucial aspect of managing an online business.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-does-google-tag-manager-use-cookies\">Does Google Tag Manager use cookies?<\/h2>\n\n\n\n<p>Google Tag Manager does not set cookies on its own, with one exception \u2014 when someone uses <a href=\"https:\/\/support.google.com\/tagmanager\/answer\/6107056?hl=en\" target=\"_blank\" rel=\"noreferrer noopener\">its preview and debug mode<\/a>. During this specific scenario, Google Tag Manager sets first-party cookies, enabling users to observe which tags are being activated on each page.<\/p>\n\n\n\n<p>These cookies affect only the user who has activated the preview and debug mode and do not impact regular website visitors. Importantly, once the user exits the preview mode, these cookies are deleted.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-does-google-tag-manager-require-cookie-consent\">Does Google Tag Manager require cookie consent?<\/h3>\n\n\n\n<p>Google Tag Manager doesn't directly require cookie consent because it doesn\u2019t set cookies \u2014 it's a tool used for adding and managing tracking tags on a website.<\/p>\n\n\n\n<p>However, some of the tags added through Google Tag Manager may use cookies to track how users interact with a website, which makes obtaining cookie consent necessary to meet GDPR guidelines. Combining Google Tag Manager with a Consent Management Platform (CMP) enables website owners to correctly manage user consent for cookies.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"900\" height=\"450\" src=\"https:\/\/www.cookiebot.com\/en\/wp-content\/uploads\/sites\/7\/2020\/08\/what_is_google_tag_mgr_900x450_body_3.svg\" alt=\"\" class=\"wp-image-16664\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-is-google-tag-manager-gdpr-compliant\">Is Google Tag Manager GDPR compliant?<\/h2>\n\n\n\n<p>The GDPR, which came into force in May 2018, has strict rules about what you can do on your website with cookies.<\/p>\n\n\n\n<p>The European Union (EU) law is binding in all 27 member states, and if you have visitors from the EU, you are obligated to abide by the rules, even if you and your website are located outside the EU.<\/p>\n\n\n\n<p>So, if you have <em>any<\/em> type of cookie or tracking technology on your website, the GDPR states that you must:<\/p>\n\n\n\n<ul style=\"background-color:#f2f7fe\" class=\"wp-block-list cb-rounded has-background\">\n<li>Obtain clear and unambiguous consent from its users,<\/li>\n\n\n\n<li>Prior to any processing of personal data,<\/li>\n\n\n\n<li>After specifying all types of cookies and other tracking technology present and operating on its pages,<\/li>\n\n\n\n<li>In easy-to-understand ways that enable users to consent and to revoke consent on each specific category of cookies,<\/li>\n\n\n\n<li>To then be able to safely and confidently document each user consent,<\/li>\n\n\n\n<li>Consent must be renewed annually. However, some national data protection guidelines recommend more frequent renewal, e.g. 6 months. Check your local data protection guidelines for compliance.<\/li>\n<\/ul>\n\n\n\n<p>Google Tag Manager is a tool designed to manage and deploy tags on a website and doesn\u2019t inherently violate the GDPR. However, its compliance with the GDPR depends on how it is used.<\/p>\n\n\n\n<p>The compliance aspect comes into play when considering the type of data these tags collect and how. Website owners are responsible for ensuring that the tags deployed through Google Tag Manager comply with the GDPR, which includes obtaining legally valid consent from users for data collection and processing activities.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-respecting-consent-status-with-google-consent-mode-in-google-tag-manager\">Respecting consent status with Google Consent Mode in Google Tag Manager<\/h3>\n\n\n\n<p>Google Tag Manager can be used with <a href=\"https:\/\/www.cookiebot.com\/en\/google-consent-mode\/\">Google Consent Mode<\/a> to ensure that tags don\u2019t fire unless a user has explicitly consented to having their data collected. Google Consent Mode, an open API developed by Google, enables websites to control if and when tags should fire, which depends on users' consent choices.<\/p>\n\n\n\n<p>Google Consent Mode can be used for various Google services, including Google Analytics, Google Tag Manager, and Google Ads. It can also be used to signal consent state for third-party tags (for non-Google products and services) with additional configurations.<\/p>\n\n\n\n<p>The Consent Initialization trigger plays a significant role in Google Consent Mode. It ensures that all consent settings are implemented before any other triggers prompt tags to fire.<\/p>\n\n\n\n<p>Using Google Consent Mode and Google Tag Manager together can help website owners respect users\u2019 consent preferences and privacy and stay compliant with data protection regulations like the GDPR that mandate prior consent to obtain data.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"900\" height=\"450\" src=\"https:\/\/www.cookiebot.com\/en\/wp-content\/uploads\/sites\/7\/2020\/08\/what_is_google_tag_mgr_900x450_body_4.svg\" alt=\"\" class=\"wp-image-16663\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-how-cookiebot-can-help-you-comply-with-cookie-laws-when-using-google-tag-manager\">How Cookiebot\u2122\ufe0f can help you comply with cookie laws when using Google Tag Manager<\/h2>\n\n\n\n<p><a href=\"https:\/\/www.cookiebot.com\/en\/\">Cookiebot CMP<\/a> is a <a href=\"https:\/\/www.cookiebot.com\/en\/cookie-consent-solution\/\">cookie consent solution<\/a> and consent management platform for your website that enables you to make sure that your domains\u2019 use of cookies and tracking is GDPR compliant.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-1-scans-your-website-for-cookies\">1. Scans your website for cookies<\/h3>\n\n\n\n<p>The Cookiebot CMP technology first scans your website and all of its subpages, finding all cookies and similar tracking technologies present \u2013 without exception (everything from HTTP\/JavaScript cookies, HTML5 Local Storage, Flash Local Shared Object, Silverlight Isolated Storage, IndexedDB, ultrasound beacons, pixel tags\u2026 and the list goes on).<\/p>\n\n\n\n<p><a href=\"https:\/\/www.cookiebot.com\/en\/cookie-scanner\/\">Scan your website for free to learn what cookies it uses.<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-2-creates-a-cookies-policy\">2. Creates a cookies policy<\/h3>\n\n\n\n<p>Cookiebot CMP then generates a cookie declaration with descriptions of every cookie found on your website that can be used as part of your consent dialog\u2019s details and as a separate cookie report, integrated in your privacy policy.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-3-enables-customizable-consent-banners\">3. Enables customizable consent banners<\/h3>\n\n\n\n<p>After Cookiebot CMP completes its scan, our customizable consent banner will display all the cookies and trackers on your website within four categories, three of which (preferences, statistics and marketing) the user can give and revoke their consent to.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-4-obtains-and-records-legally-valid-user-consent\">4. Obtains and records legally valid user consent<\/h3>\n\n\n\n<p>The user then gives their consent and based on the specifics of this consent (e.g. whether they opted in for marketing cookies, or out of analytics), the cookies and trackers are then activated on your website.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"900\" height=\"450\" src=\"https:\/\/www.cookiebot.com\/en\/wp-content\/uploads\/sites\/7\/2020\/08\/what_is_google_tag_mgr_900x450_body_5.svg\" alt=\"\" class=\"wp-image-16662\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-5-allows-tags-to-fire-based-on-user-consent\">5. Allows tags to fire based on user consent<\/h3>\n\n\n\n<p>Cookiebot CMP automatically controls all cookies so that no user data is collected until your users give consent, as mandated by the GDPR. <strong>Cookiebot CMP then tells Google Tag Manager what tags to run<\/strong>.<\/p>\n\n\n\n<p>Only strictly necessary cookies are allowed to be set when a user arrives on a website, and consent banners that manage user consent <strong>are not allowed to have pre-ticked checkboxes<\/strong> on any other categories of cookies.<\/p>\n\n\n\n<p>If the user decides to not have marketing or analytics cookies set on their devices, Cookiebot CMP changes the conditions for which Google Tag Manager runs tags, and so will not run tags that set marketing or analytics cookies.<\/p>\n\n\n\n<p>Cookiebot CMP acts like the privacy protecting bridge intermediary that controls what Google Tag Manager is allowed to do based on the specifics of your users\u2019 consent.<\/p>\n\n\n\n<p>By using Cookiebot CMP, you can ensure that the cookies and trackers that you deploy as tags through Google Tag Manager meets <a href=\"https:\/\/www.cookiebot.com\/en\/gdpr-cookies\/\">GDPR cookie consent<\/a> requirements, i.e. doesn\u2019t collect personal information on users before they\u2019ve given their consent to it.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-6-how-do-cookiebot-cmp-and-google-consent-mode-work-together\">6. How do Cookiebot CMP and Google Consent Mode work together?<\/h3>\n\n\n\n<p>Cookiebot CMP integrates Google Tag Manager with Google Consent Mode using a Tag Manager template designed to work with the Consent API and easy to set up without heavy coding knowledge.<\/p>\n\n\n\n<p>Cookiebot CMP manages the consents of your users and communicates their consent state to the Google Consent Mode API that governs the behavior of all Google-services based on user consents.<\/p>\n\n\n\n<p>If a user doesn't give consent to statistics or marketing cookies, Google Consent Mode makes sure that you still get valuable insight into your website's performance while respecting end-user privacy.<\/p>\n\n\n\n<p>Google Consent Mode ensures aggregate and non-identifying data if users don't consent to cookies, including:<\/p>\n\n\n\n<ul style=\"background-color:#f2f7fe\" class=\"wp-block-list cb-rounded has-background\">\n<li>timestamps<\/li>\n\n\n\n<li>user agents<\/li>\n\n\n\n<li>referrers<\/li>\n\n\n\n<li>other basic measurements for modeling<\/li>\n<\/ul>\n\n\n\n<p>Google Consent Mode also enables you to display contextual ads based on anonymous data instead of targeted ads based on personal data, if users don't give their consent to marketing cookies.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-how-to-implement-google-tag-manager-with-cookiebot-cmp\">How to implement Google Tag Manager with Cookiebot CMP<\/h2>\n\n\n\n<p>In order to \u201cget the best of both worlds\u201d \u2013 meaning website optimization through analytics and marketing, as well as being GDPR compliant and respecting your users\u2019 privacy \u2013 you need to make sure that:<\/p>\n\n\n\n<ol style=\"background-color:#f2f7fe\" class=\"wp-block-list cb-rounded has-background\">\n<li>The Google Tag Manager script is the first script to load on your website.<\/li>\n\n\n\n<li>Your Google Tag Manager script is marked with: data-cookieconsent=\u201dignore\u201d to ensure that Google Tag Manager will always be allowed to load.<\/li>\n\n\n\n<li>You insert the Cookiebot script with automatic cookie blocking immediately after the Google Tag Manager script.<\/li>\n\n\n\n<li>Create 3 triggers in Google Tag Manager, which are fired upon custom event <em>cookie_consent_[category] category = {preferences, statistics, marketing}<\/em><\/li>\n<\/ol>\n\n\n\n<p>Here is an example of how that looks \u2013<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"\/media\/3700\/mceclip1.png?width=600&amp;\" alt=\"Google Tag Manager &amp; Cookiebot cookie blocking code - Cookiebot\" width=\"770\" height=\"423\"\/><figcaption class=\"wp-element-caption\">How to implement Google Tag Manager with Cookiebot CMP<\/figcaption><\/figure>\n\n\n\n<p>To know more about the technical aspects of the implementation, <a href=\"https:\/\/support.cookiebot.com\/hc\/en-us\/articles\/360009192739-Google-Tag-Manager-and-Automatic-cookie-blocking\/\" target=\"_blank\" rel=\"noreferrer noopener\">check out our support page dedicated to Google Tag Manager and Cookiebot CMP.<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-implications-of-the-digital-markets-act-dma-on-google-tag-manager\">Implications of the Digital Markets Act (DMA) on Google Tag Manager<\/h2>\n\n\n\n<p>The <a href=\"https:\/\/www.cookiebot.com\/en\/european-digital-markets-act-explained\/\">Digital Markets Act<\/a> (DMA) places strict emphasis on obtaining clear and affirmative user consent for data collection in line with the GDPR. All tags deployed through Google Tag Manager must comply with these consent standards, and businesses that use Google Tag Manager will need to adapt to the <a href=\"https:\/\/www.cookiebot.com\/en\/digital-markets-act-dma-checklist-what-you-need-to-know\/\">DMA\u2019s requirements<\/a> in how they manage tags that collect user data.<\/p>\n\n\n\n<p>This adaptation may involve modifications in tag setup and trigger mechanisms based on user consent. The approach to tag management will need to become more dynamic, with user consent directly influencing which tags are active at any given time, ensuring that they follow the DMA\u2019s requirements.<\/p>\n\n\n\n<p>The DMA law applies to gatekeepers (including Alphabet, which owns Google and its products), who are liable for <a href=\"https:\/\/www.cookiebot.com\/en\/digital-markets-act-dma-checklist-what-you-need-to-know\/\">DMA compliance<\/a>. However, businesses that don\u2019t collect consent as per the DMA\u2019s requirements \u2014 which align with the consent requirements under the GDPR \u2014 risk losing access to gatekeepers\u2019 products and services and face hefty penalties under the GDPR.<\/p>\n\n\n<div class=\"cta-block cta-block--size-s cb-ctx--blue\">\n        <div class=\"cta-block__glass\">\n        <div class=\"cta-block__inner\">\n            <div class=\"cta-block__left-column\">\n                                                                    <div class=\"cta-block__description like-text-md\">\n                        <h3>Get started on compliant Google Tag Manager cookie consent today with Cookiebot CMP<strong><br \/>\n<\/strong><\/h3>\n<p><span style=\"font-weight: 400;\">Start your 14-day free trial of all premium features<\/span><\/p>\n                    <\/div>\n                                                                                                                <div class=\"cta-block__buttons\">\n                                                    <div class=\"cta-block__buttons__button-wp\">\n                                <a id=\"c39c3b08-8676-402b-8f36-b4cb5f31a94a\" class=\"cb-button cb-button-size-l cb-button-contained  no-default-link-decoration cb-button-icon-right cta-block__buttons__button\" href=\"https:\/\/admin.cookiebot.com\/signup\" target=\"_blank\">\n<span>Free trial<\/span><\/a>\n                                                            <\/div>\n                                                                        <\/div>\n                                                                                <\/div>\n                    <\/div>\n    <\/div>\n<\/div>\n\n\n\n\n\n\n","protected":false},"excerpt":{"rendered":"<p>What is Google Tag Manager? Google Tag Manager is a tool that enables website owners to manage and deploy marketing tags on their website without needing to modify the code. These tags include Google Analytics, Google Ads, and other tracking codes that provide insights into a website\u2019s performance. These insights help website owners update and [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":16661,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":true,"inline_featured_image":false,"editor_notices":[],"footnotes":""},"categories":[1],"tags":[25],"class_list":["post-1137","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-google-consent-mode"],"acf":[],"thumbnail_status":false,"thumbnail_url":"https:\/\/www.cookiebot.com\/en\/wp-content\/uploads\/sites\/7\/2025\/06\/Social-image-fallback_1200x630_ffffff.png","_links":{"self":[{"href":"https:\/\/www.cookiebot.com\/en\/wp-json\/wp\/v2\/posts\/1137","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cookiebot.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cookiebot.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cookiebot.com\/en\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cookiebot.com\/en\/wp-json\/wp\/v2\/comments?post=1137"}],"version-history":[{"count":0,"href":"https:\/\/www.cookiebot.com\/en\/wp-json\/wp\/v2\/posts\/1137\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.cookiebot.com\/en\/wp-json\/wp\/v2\/media\/16661"}],"wp:attachment":[{"href":"https:\/\/www.cookiebot.com\/en\/wp-json\/wp\/v2\/media?parent=1137"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cookiebot.com\/en\/wp-json\/wp\/v2\/categories?post=1137"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cookiebot.com\/en\/wp-json\/wp\/v2\/tags?post=1137"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}