{"id":27482,"date":"2024-05-21T12:13:42","date_gmt":"2024-05-21T16:13:42","guid":{"rendered":"https:\/\/plumrocket.com\/docs\/?p=27482"},"modified":"2025-05-29T11:31:52","modified_gmt":"2025-05-29T15:31:52","slug":"how-to-set-up-gtm-consent-mode-in-magento-2-2","status":"publish","type":"post","link":"https:\/\/plumrocket.com\/docs\/magento-cookie-consent\/v2\/userguides\/gtm-consent-mode","title":{"rendered":"How to Set Up GTM Consent Mode in Magento 2"},"content":{"rendered":"\n<p>In this article, we will walk through each step of setting up Google Consent Mode in Tag Manager while configuring the <a href=\"\/magento-cookie-consent\">Magento 2 Cookie Consent extension<\/a>.<\/p>\n\n\n\n<p><a href=\"https:\/\/support.google.com\/analytics\/answer\/9976101\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">GTM Consent mode <\/a>is a new feature presented by Google that helps manage how tags behave based on the consent status of your users in a more flexible way. This feature is replacing the deprecated &#8220;Associated Cookie Category&#8221; mode, allowing you to control each individual tag firing in GTM, instead of enabling\/disabling the entire GTM when a visitor allows\/denies the corresponding (associated) cookie category.<\/p>\n\n\n\n<p>Please take the following steps to properly configure the GTM Consent Mode.<\/p>\n\n\n\n<h2 id=\"h-1-set-up-your-gtm-account\">1. Set Up Your GTM Account<\/h2>\n\n\n\n<h3 id=\"h-create-a-gtm-account-and-container\">Create a GTM Account and Container<\/h3>\n\n\n\n<div class=\"wp-block-group pr-notice pr-notice-warning\"><div class=\"wp-block-group__inner-container\">\n<p class=\"pr-notice-title\">Important Information:<\/p>\n\n\n\n<p>If your GTM account and the container are already created, skip this step and start <a href=\"#2-add-gtm-tags\">adding new tags<\/a> to the container.<\/p>\n<\/div><\/div>\n\n\n\n<div class=\"wp-block-group pr-notice pr-notice-info\"><div class=\"wp-block-group__inner-container\">\n<p class=\"pr-notice-title\">Step-by-step guide:<\/p>\n\n\n\n<ol><li>Go to <a href=\"https:\/\/tagmanager.google.com\/#\/home\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">tagmanager.google.com<\/a> and sign in to Google Analytics using your existing Google account associated with your business. Please note that you may be automatically authenticated if you are logged in to the Google account in your browser. In this case, click the Account icon and check whether you are using the correct account.<\/li><li>Click <strong>Create Account<\/strong> to start creating a GTM account.<\/li><\/ol>\n<\/div><\/div>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" width=\"1206\" height=\"510\" src=\"https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-1.png\" alt=\"How to create a GTM account\" class=\"wp-image-25676\" srcset=\"https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-1.png 1206w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-1-300x127.png 300w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-1-1024x433.png 1024w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-1-768x325.png 768w\" sizes=\"(max-width: 1206px) 100vw, 1206px\" \/><\/figure>\n\n\n\n<div class=\"wp-block-group pr-notice pr-notice-info\"><div class=\"wp-block-group__inner-container\">\n<p class=\"pr-notice-title\">Step-by-step guide:<\/p>\n\n\n\n<p>Account Setup<\/p>\n\n\n\n<ol><li>&#8220;<strong>Account name<\/strong>&#8220;: please enter the name for your GTM account.<\/li><li>&#8220;<strong>Country<\/strong>&#8220;: select the country of your business.<\/li><\/ol>\n\n\n\n<p id=\"#creating-gtm-container\">Container Setup<\/p>\n\n\n\n<ol start=\"3\"><li>&#8220;<strong>Container name<\/strong>&#8220;: please enter the descriptive name for your GTM container.<\/li><li>&#8220;<strong>Target platform<\/strong>&#8220;: select the Web type of content. <\/li><li>Click <strong>Create<\/strong>.<\/li><\/ol>\n\n\n\n<p>Review the Terms of Service and click <strong>Yes <\/strong>if you agree to those terms.<\/p>\n<\/div><\/div>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" width=\"1206\" height=\"909\" src=\"https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-2.png\" alt=\"How to create a GTM account - 2\" class=\"wp-image-25677\" srcset=\"https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-2.png 1206w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-2-300x226.png 300w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-2-1024x772.png 1024w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-2-768x579.png 768w\" sizes=\"(max-width: 1206px) 100vw, 1206px\" \/><\/figure>\n\n\n\n<div class=\"wp-block-group pr-notice pr-notice-info\"><div class=\"wp-block-group__inner-container\">\n<p class=\"pr-notice-title\">Step-by-step guide:<\/p>\n\n\n\n<ol><li>The web container installation code snippet will appear. This snippet fires tags and needs to be added to each web page. However, you do not need to do this manually thanks to the Cookie Consent extension built-in GTM integration. Just click OK to clear this dialog.<\/li><li>Near the top of the window, find your <strong id=\"gtm-container-id\">container ID<\/strong>, formatted as &#8220;GTM-XXXXXX&#8221;. Copy it to paste it later in the Magneto admin panel to set up the Magento 2 Cookie Consent extension integration (see the next step).<\/li><\/ol>\n<\/div><\/div>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" width=\"1206\" height=\"675\" src=\"https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-3.png\" alt=\"How to install GTM scripts in Magneto 2\" class=\"wp-image-25678\" srcset=\"https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-3.png 1206w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-3-300x168.png 300w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-3-1024x573.png 1024w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-3-768x430.png 768w\" sizes=\"(max-width: 1206px) 100vw, 1206px\" \/><\/figure>\n\n\n\n<h3 id=\"h-install-gtm-container-in-magento-2\">Install GTM Container in Magento 2<\/h3>\n\n\n\n<div class=\"wp-block-group pr-notice pr-notice-info\"><div class=\"wp-block-group__inner-container\">\n<p class=\"pr-notice-title\">Step-by-step guide:<\/p>\n\n\n\n<ol><li>In the Magento admin panel, go to <strong>Plumrocket<\/strong> -&gt; <strong>Cookie Consent extension<\/strong> -&gt; <strong>Configuration<\/strong>. <\/li><li>Scroll down to the Google Tag Manager Settings tab and paste your <a href=\"#gtm-container-id\">Container ID<\/a> in the <strong>Container Id<\/strong> field.  <\/li><li>Click <strong>Save Config<\/strong>.<\/li><\/ol>\n<\/div><\/div>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" width=\"1206\" height=\"696\" src=\"https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-4.png\" alt=\"Setting up GTM Container ID in Magento 2\" class=\"wp-image-25679\" srcset=\"https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-4.png 1206w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-4-300x173.png 300w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-4-1024x591.png 1024w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-4-768x443.png 768w\" sizes=\"(max-width: 1206px) 100vw, 1206px\" \/><\/figure>\n\n\n\n<h2 id=\"h-2-add-gtm-tags\">2. Add GTM tags<\/h2>\n\n\n\n<p>Once a GTM account and container are installed, you&#8217;re ready to add new tags.<\/p>\n\n\n\n<div class=\"wp-block-group pr-notice pr-notice-info\"><div class=\"wp-block-group__inner-container\">\n<p class=\"pr-notice-title\">Step-by-step guide:<\/p>\n\n\n\n<ol><li>In Google Tag Manager, click <strong>Tags<\/strong> from the navigation menu.<\/li><li>Click <strong>New<\/strong>. <\/li><\/ol>\n<\/div><\/div>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" width=\"1206\" height=\"512\" src=\"https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-5.png\" alt=\"How to create GTM tags (Google Consent Mode)\" class=\"wp-image-25680\" srcset=\"https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-5.png 1206w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-5-300x127.png 300w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-5-1024x435.png 1024w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-5-768x326.png 768w\" sizes=\"(max-width: 1206px) 100vw, 1206px\" \/><\/figure>\n\n\n\n<h3 id=\"h-tag-configuration\">Tag Configuration<\/h3>\n\n\n\n<div class=\"wp-block-group pr-notice pr-notice-info\"><div class=\"wp-block-group__inner-container\">\n<p class=\"pr-notice-title\">Step-by-step guide:<\/p>\n\n\n\n<ol><li>Click anywhere on the <strong>Tag Configuration<\/strong> field to start setting it up.<\/li><li>Find and choose the tag type that suits your needs. Some of the further configurations will be set by default according to the selected tag type requirements. However, in this tutorial, we will show you how to add a custom HTML tag. For this, scroll down and choose the <strong>Custom HTML<\/strong> tag type.<\/li><\/ol>\n<\/div><\/div>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" width=\"1206\" height=\"572\" src=\"https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-6.png\" alt=\"How to create GTM tags (Google Consent Mode) - 2\" class=\"wp-image-25681\" srcset=\"https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-6.png 1206w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-6-300x142.png 300w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-6-1024x486.png 1024w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-6-768x364.png 768w\" sizes=\"(max-width: 1206px) 100vw, 1206px\" \/><\/figure>\n\n\n\n<div class=\"wp-block-group pr-notice pr-notice-info\"><div class=\"wp-block-group__inner-container\">\n<p class=\"pr-notice-title\">Step-by-step guide:<\/p>\n\n\n\n<ol><li>In the <strong id=\"gtm-tag-html-code\">HTML <\/strong>section, add the code that will be executed when a user allows cookies on the site.<ul><li><em>For example:<\/em><br><kbd>&lt;script&gt;<br>alert('Consent accepted');<br>&lt;\/script&gt;<\/kbd><\/li><\/ul><\/li><\/ol>\n\n\n\n<ol start=\"2\"><li>Expand the <strong>Advanced Settings<\/strong>.<\/li><\/ol>\n<\/div><\/div>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" width=\"1206\" height=\"695\" src=\"https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-7-1.png\" alt=\"How to create GTM tags (Google Consent Mode) - 3\" class=\"wp-image-25683\" srcset=\"https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-7-1.png 1206w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-7-1-300x173.png 300w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-7-1-1024x590.png 1024w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-7-1-768x443.png 768w\" sizes=\"(max-width: 1206px) 100vw, 1206px\" \/><\/figure>\n\n\n\n<div class=\"wp-block-group pr-notice pr-notice-info\"><div class=\"wp-block-group__inner-container\">\n<p class=\"pr-notice-title\">Step-by-step guide:<\/p>\n\n\n\n<ol><li>Expand the <strong>Advanced Settings <\/strong>-&gt; <strong>Consent Settings <\/strong>and select the <em>Require additional consent for tag to fire <\/em>checkbox.<\/li><li>Add the required consent types <code>ad_storage<\/code> and <code>analytics_storage<\/code>. The following consent types are supported and can be used to control tag firing in Google:<\/li><\/ol>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><strong>Consent Type<\/strong><\/td><td><strong>Description<\/strong><\/td><\/tr><tr><td>ad_storage<\/td><td>Enables storage (such as cookies) related to advertising<\/td><\/tr><tr><td>analytics_storage<\/td><td>Enables storage (such as cookies) related to analytics e.g. visit duration<\/td><\/tr><tr><td>functionality_storage<\/td><td>Enables storage that supports the functionality of the website or app e.g. language settings<\/td><\/tr><tr><td>personalization_storage<\/td><td>Enables storage related to personalization e.g. video recommendations<\/td><\/tr><tr><td>security_storage<\/td><td>Enables storage related to security such as authentication functionality, fraud prevention, and other user protection<\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div><\/div>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" width=\"1206\" height=\"911\" src=\"https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-8.png\" alt=\"How to create GTM tags (Google Consent Mode) - 4\" class=\"wp-image-25684\" srcset=\"https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-8.png 1206w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-8-300x227.png 300w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-8-1024x774.png 1024w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-8-768x580.png 768w\" sizes=\"(max-width: 1206px) 100vw, 1206px\" \/><\/figure>\n\n\n\n<h3 id=\"h-triggering\">Triggering<\/h3>\n\n\n\n<p>At this point, you need to specify triggers for when the tag should fire. The Google Consent Initialization trigger is designed to ensure that all user consent is honored before any other triggers fire.<\/p>\n\n\n\n<div class=\"wp-block-group pr-notice pr-notice-info\"><div class=\"wp-block-group__inner-container\">\n<p class=\"pr-notice-title\">Step-by-step guide:<\/p>\n\n\n\n<ol><li>Click on the <strong>Triggering<\/strong> section and select the <strong>All Pages<\/strong> trigger to fire the tag after a user consent is granted.<\/li><li>Rename the tag before creation.<\/li><li>Click <strong>Save<\/strong>.<\/li><\/ol>\n<\/div><\/div>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" width=\"1206\" height=\"912\" src=\"https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-9.png\" alt=\"How to set up GTM tag triggering (Google Consent Mode)\" class=\"wp-image-25685\" srcset=\"https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-9.png 1206w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-9-300x227.png 300w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-9-1024x774.png 1024w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-9-768x581.png 768w\" sizes=\"(max-width: 1206px) 100vw, 1206px\" \/><\/figure>\n\n\n\n<div class=\"wp-block-group pr-notice pr-notice-info\"><div class=\"wp-block-group__inner-container\">\n<p class=\"pr-notice-title\">Step-by-step guide:<\/p>\n\n\n\n<ol><li>Review and apply the recent changes by clicking <strong>Submit<\/strong> -&gt; <strong>Publish<\/strong>.<\/li><\/ol>\n<\/div><\/div>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" width=\"1206\" height=\"500\" src=\"https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-10.png\" alt=\"How to create GTM tags (GTM Consent Mode)\" class=\"wp-image-25686\" srcset=\"https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-10.png 1206w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-10-300x124.png 300w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-10-1024x425.png 1024w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-10-768x318.png 768w\" sizes=\"(max-width: 1206px) 100vw, 1206px\" \/><\/figure>\n\n\n\n<h2 id=\"h-3-set-up-gtm-consent-mode-in-magento-2\">3. Set Up GTM Consent Mode in Magento 2<\/h2>\n\n\n\n<div class=\"wp-block-group pr-notice pr-notice-warning\"><div class=\"wp-block-group__inner-container\">\n<p class=\"pr-notice-title\">Important Information:<\/p>\n\n\n\n<p>Consent mode was updated in November 2023 and now contains two additional consent types: <code>ad_user_data<\/code> and <code>ad_personalization<\/code>. If you already use consent mode,&nbsp;upgrade your Magento to Consent Mode v2 by March 2024 to comply with the latest privacy regulations and ensure that data about new EEA users will be captured.<br><span class=\"has-inline-color has-white-color\">.<\/span><br>To ensure compliance with Consent Mode V2, please make sure that your Cookie Consent extension is version 1.11.2 or later. The newly introduced consent types are automatically assigned to cookie categories. However, if you have any customizations in place, please verify that the assigned cookie categories are accurate.<\/p>\n<\/div><\/div>\n\n\n\n<div class=\"wp-block-group pr-notice pr-notice-info\"><div class=\"wp-block-group__inner-container\">\n<p class=\"pr-notice-title\">Step-by-step guide:<\/p>\n\n\n\n<ol><li>In the Magento admin panel, go to <strong>Plumrocket<\/strong> -&gt; <strong>Cookie Consent extension<\/strong> -&gt; <strong>Configuration<\/strong>.<\/li><li>Scroll down to the Google Tag Manager Settings tab -&gt; <strong>Consent Types<\/strong> section.<\/li><li>Set <strong>Cookie Categories<\/strong> for the Consent types that you added in the <a href=\"#tag-configuration\">Tag Configuration<\/a> section. In our example, we set the <em>Marketing Cookies<\/em> and <em>Statistics Cookies<\/em> categories for the <code>ad_storage<\/code> and <code>analytics_storage<\/code> content types accordingly. <\/li><li>Click <strong>Save Config<\/strong>.<\/li><\/ol>\n<\/div><\/div>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" width=\"1206\" height=\"807\" src=\"https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2024\/03\/magento-2-setting-up-gtm-consent-tags-11-2.png\" alt=\"How to set up GTM Consent Mode in Magento 2\" class=\"wp-image-27391\" srcset=\"https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2024\/03\/magento-2-setting-up-gtm-consent-tags-11-2.png 1206w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2024\/03\/magento-2-setting-up-gtm-consent-tags-11-2-300x201.png 300w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2024\/03\/magento-2-setting-up-gtm-consent-tags-11-2-1024x685.png 1024w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2024\/03\/magento-2-setting-up-gtm-consent-tags-11-2-768x514.png 768w\" sizes=\"(max-width: 1206px) 100vw, 1206px\" \/><\/figure>\n\n\n\n<h3 id=\"h-test-gtm-consent-mode-in-magento-2\">Test GTM Consent Mode in Magento 2<\/h3>\n\n\n\n<p>Now, in order to fire the created tag, you need to agree to the Marketing and Statistics cookies on your website.<\/p>\n\n\n\n<div class=\"wp-block-group pr-notice pr-notice-info\"><div class=\"wp-block-group__inner-container\">\n<p class=\"pr-notice-title\">Step-by-step guide:<\/p>\n\n\n\n<ol><li>Go to your website&#8217;s frontend, and click <strong>Customize Settings<\/strong> when the cookie consent banner appears.<\/li><li>Enable <em>Marketing cookies <\/em>and <em>Statistics Cookies<\/em>, and then click <strong>Confirm My Choice<\/strong>.<\/li><\/ol>\n<\/div><\/div>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" width=\"1206\" height=\"645\" src=\"https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-12.png\" alt=\"Testing GTM Consent Mode in Magento 2\" class=\"wp-image-25688\" srcset=\"https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-12.png 1206w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-12-300x160.png 300w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-12-1024x548.png 1024w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-12-768x411.png 768w\" sizes=\"(max-width: 1206px) 100vw, 1206px\" \/><\/figure>\n\n\n\n<div class=\"wp-block-group pr-notice pr-notice-info\"><div class=\"wp-block-group__inner-container\">\n<p class=\"pr-notice-title\">Step-by-step guide:<\/p>\n\n\n\n<p>After cookie categories are enabled, you will see the &#8220;Consent accepted&#8221; message, which you have set in the tag <a href=\"#gtm-tag-html-code\">HTML section<\/a>.<\/p>\n<\/div><\/div>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" width=\"1206\" height=\"592\" src=\"https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-13.png\" alt=\"Testing GTM Consent Mode in Magento 2\" class=\"wp-image-25689\" srcset=\"https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-13.png 1206w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-13-300x147.png 300w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-13-1024x503.png 1024w, https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-13-768x377.png 768w\" sizes=\"(max-width: 1206px) 100vw, 1206px\" \/><\/figure>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>The Google Consent Mode is now properly configured. Please mark this post as helpful or not, and feel free to <a href=\"\/contacts\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">contact us<\/a> if you have any further questions.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this article, we will walk through each step of setting up Google Consent Mode in Tag Manager while configuring the Magento 2 Cookie Consent extension. GTM Consent mode is a new feature presented by Google that helps manage how tags behave based on the consent status of your users in a more flexible way. &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/plumrocket.com\/docs\/magento-cookie-consent\/v2\/userguides\/gtm-consent-mode\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How to Set Up GTM Consent Mode in Magento 2&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[382],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v17.2 (Yoast SEO v17.2) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Set Up GTM Consent Mode in Magento 2 - Plumrocket Documentation<\/title>\n<meta name=\"description\" content=\"In this article, we will walk through each step of setting up Google Consent Mode in Tag Manager while configuring the Magento 2 Cookie Consent extension.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/plumrocket.com\/docs\/magento-cookie-consent-pro\/v1\/userguides\/gtm-consent-mode\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Set Up GTM Consent Mode in Magento 2\" \/>\n<meta property=\"og:description\" content=\"In this article, we will walk through each step of setting up Google Consent Mode in Tag Manager while configuring the Magento 2 Cookie Consent extension.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/plumrocket.com\/docs\/magento-cookie-consent-pro\/v1\/userguides\/gtm-consent-mode\" \/>\n<meta property=\"og:site_name\" content=\"Plumrocket Documentation\" \/>\n<meta property=\"article:published_time\" content=\"2024-05-21T16:13:42+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-05-29T15:31:52+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-1.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Plumrocket\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to Set Up GTM Consent Mode in Magento 2 - Plumrocket Documentation","description":"In this article, we will walk through each step of setting up Google Consent Mode in Tag Manager while configuring the Magento 2 Cookie Consent extension.","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:\/\/plumrocket.com\/docs\/magento-cookie-consent-pro\/v1\/userguides\/gtm-consent-mode","og_locale":"en_US","og_type":"article","og_title":"How to Set Up GTM Consent Mode in Magento 2","og_description":"In this article, we will walk through each step of setting up Google Consent Mode in Tag Manager while configuring the Magento 2 Cookie Consent extension.","og_url":"https:\/\/plumrocket.com\/docs\/magento-cookie-consent-pro\/v1\/userguides\/gtm-consent-mode","og_site_name":"Plumrocket Documentation","article_published_time":"2024-05-21T16:13:42+00:00","article_modified_time":"2025-05-29T15:31:52+00:00","og_image":[{"url":"https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-1.png"}],"twitter_card":"summary_large_image","twitter_misc":{"Written by":"Plumrocket","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/plumrocket.com\/docs\/#website","url":"https:\/\/plumrocket.com\/docs\/","name":"Plumrocket Documentation","description":"Extensions docs, troubleshootings etc.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/plumrocket.com\/docs\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"ImageObject","@id":"https:\/\/plumrocket.com\/docs\/magento-cookie-consent-pro\/v1\/userguides\/gtm-consent-mode#primaryimage","inLanguage":"en-US","url":"https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-1.png","contentUrl":"https:\/\/plumrocket.com\/docs\/wp-content\/uploads\/2022\/05\/magento-2-setting-up-gtm-consent-tags-1.png","width":1206,"height":510},{"@type":"WebPage","@id":"https:\/\/plumrocket.com\/docs\/magento-cookie-consent-pro\/v1\/userguides\/gtm-consent-mode#webpage","url":"https:\/\/plumrocket.com\/docs\/magento-cookie-consent-pro\/v1\/userguides\/gtm-consent-mode","name":"How to Set Up GTM Consent Mode in Magento 2 - Plumrocket Documentation","isPartOf":{"@id":"https:\/\/plumrocket.com\/docs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/plumrocket.com\/docs\/magento-cookie-consent-pro\/v1\/userguides\/gtm-consent-mode#primaryimage"},"datePublished":"2024-05-21T16:13:42+00:00","dateModified":"2025-05-29T15:31:52+00:00","author":{"@id":"https:\/\/plumrocket.com\/docs\/#\/schema\/person\/c96fccdb89342ae6804272265723eca8"},"description":"In this article, we will walk through each step of setting up Google Consent Mode in Tag Manager while configuring the Magento 2 Cookie Consent extension.","breadcrumb":{"@id":"https:\/\/plumrocket.com\/docs\/magento-cookie-consent-pro\/v1\/userguides\/gtm-consent-mode#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/plumrocket.com\/docs\/magento-cookie-consent-pro\/v1\/userguides\/gtm-consent-mode"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/plumrocket.com\/docs\/magento-cookie-consent-pro\/v1\/userguides\/gtm-consent-mode#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Magento 2 Extensions","item":"https:\/\/plumrocket.com\/magento-extensions"},{"@type":"ListItem","position":2,"name":"Magento 2 Cookie Consent","item":"https:\/\/plumrocket.com\/magento-cookie-consent"},{"@type":"ListItem","position":3,"name":"Documentation","item":"https:\/\/plumrocket.com\/docs\/magento-cookie-consent"},{"@type":"ListItem","position":4,"name":"v2","item":"https:\/\/plumrocket.com\/docs\/magento-cookie-consent\/v2"},{"@type":"ListItem","position":5,"name":"How to Set Up GTM Consent Mode in Magento 2"}]},{"@type":"Person","@id":"https:\/\/plumrocket.com\/docs\/#\/schema\/person\/c96fccdb89342ae6804272265723eca8","name":"Plumrocket","image":{"@type":"ImageObject","@id":"https:\/\/plumrocket.com\/docs\/#personlogo","inLanguage":"en-US","url":"https:\/\/secure.gravatar.com\/avatar\/10c44aa45aab391250913d982e552e53?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/10c44aa45aab391250913d982e552e53?s=96&d=mm&r=g","caption":"Plumrocket"}}]}},"_links":{"self":[{"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/posts\/27482"}],"collection":[{"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/comments?post=27482"}],"version-history":[{"count":1,"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/posts\/27482\/revisions"}],"predecessor-version":[{"id":27483,"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/posts\/27482\/revisions\/27483"}],"wp:attachment":[{"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/media?parent=27482"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/categories?post=27482"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/tags?post=27482"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}