{"id":18913766,"date":"2026-05-20T14:58:52","date_gmt":"2026-05-20T14:58:52","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/google-tags-are-injected-too-late-in-the-head-section\/"},"modified":"2026-05-20T14:58:52","modified_gmt":"2026-05-20T14:58:52","slug":"google-tags-are-injected-too-late-in-the-head-section","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/google-tags-are-injected-too-late-in-the-head-section\/","title":{"rendered":"Google tags are injected too late in the head section"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Hello,<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I am using GDPR Cookie Compliance on my WordPress website with Google Consent Mode v2.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The plugin seems to inject the Google tag \/ GTM scripts quite late inside the <code>&lt;head&gt;<\/code> section. In my page source, the Google tag appears around line 327, while the <code>&lt;head&gt;<\/code> section starts much earlier.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Google Ads \/ Tag Assistant shows a warning that the Google tag should be placed higher on the page.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">My questions:<\/p>\n\n\n\n<ol start=\"1\">\n<li>Is there a way to make GDPR Cookie Compliance inject Google tag \/ GTM scripts immediately after the opening <code>&lt;head&gt;<\/code> tag?<\/li>\n\n\n\n<li>Can the plugin priority or hook order be changed?<\/li>\n\n\n\n<li>Is there a recommended method to load the default consent script earlier, while still letting the plugin manage the consent update after user approval?<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">I want to avoid duplicate GTM containers and keep Consent Mode v2 working correctly.<br \/><br \/>same issues with this topic:<br \/><a href=\"https:\/\/wordpress.org\/support\/topic\/your-tag-may-be-installed-too-low-in-the-page-which-can-impact-performance-2\/\">https:\/\/wordpress.org\/support\/topic\/your-tag-may-be-installed-too-low-in-the-page-which-can-impact-performance-2\/<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thank you.<\/p>\n","protected":false},"template":"","class_list":["post-18913766","topic","type-topic","status-publish","hentry","topic-tag-tag-manager"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/18913766","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/18913766\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=18913766"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}