Google tags are injected too late in the head section
-
Hello,
I am using GDPR Cookie Compliance on my WordPress website with Google Consent Mode v2.
The plugin seems to inject the Google tag / GTM scripts quite late inside the
<head>section. In my page source, the Google tag appears around line 327, while the<head>section starts much earlier.Google Ads / Tag Assistant shows a warning that the Google tag should be placed higher on the page.
My questions:
- Is there a way to make GDPR Cookie Compliance inject Google tag / GTM scripts immediately after the opening
<head>tag? - Can the plugin priority or hook order be changed?
- Is there a recommended method to load the default consent script earlier, while still letting the plugin manage the consent update after user approval?
I want to avoid duplicate GTM containers and keep Consent Mode v2 working correctly.
same issues with this topic:
https://wordpress.org/support/topic/your-tag-may-be-installed-too-low-in-the-page-which-can-impact-performance-2/Thank you.
The page I need help with: [log in to see the link]
- Is there a way to make GDPR Cookie Compliance inject Google tag / GTM scripts immediately after the opening
You must be logged in to reply to this topic.