• Resolved ebuege

    (@ebuege)


    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:

    1. Is there a way to make GDPR Cookie Compliance inject Google tag / GTM scripts immediately after the opening <head> tag?
    2. Can the plugin priority or hook order be changed?
    3. 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]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter ebuege

    (@ebuege)

    I SOLVE MY PROBLEM with an inject.. thank you ChatGPT

    add_action( 'init', function() {
    remove_action( 'wp_head', array( 'Moove_GDPR_Content', 'gdpr_google_consent_mode2_snippet' ), 10 );
    add_action( 'wp_head', array( 'Moove_GDPR_Content', 'gdpr_google_consent_mode2_snippet' ), 1 );
    }, 20 );

    Plugin Support Jane

    (@janeaustin)

    Hi @ebuege

    Thanks for using our plugins.

    This was fixed in our latest version.

    Hope this helps.

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.