[Support request] Hook Element Priority

Home Forums Support [Support request] Hook Element Priority

Home Forums Support Hook Element Priority

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2337338
    Ana

    Hello,

    My Google analytics G4 tag is not tracking correctly. The UA analytics is working fine, and the script shows at the very beginning of the head.

    I added the G4 tag as a hook element in wp_head. However, when I inspect any page, the script shows at the very bottom of the head, after all the ad scripts. Accordingly, not all pages are tagged in G4, and not tracking all page hits.

    Which priority should I set to make it appear higher? or is there anything else I need to do?

    Here’s the site:homemadepizzapro.com and the tag.

    Thanks in advance for your help.

    <!– Google tag (gtag.js) –>
    <script async src=”https://www.googletagmanager.com/gtag/js?id=G-NHV97ZZXJW”></script&gt;
    <script>
    window.dataLayer = window.dataLayer || [];
    function gtag(){dataLayer.push(arguments);}
    gtag(‘js’, new Date());

    gtag(‘config’, ‘G-NHV97ZZXJW’);
    </script>

    #2337517
    Fernando
    Customer Support

    Hi Ana,

    In general, lower priority should place a code higher. Try a priority of 1.

    #2344847
    Ana

    Hello,

    I changed the priority to 1 but nothing changed. The GA4 script is still at the end after all ads. Consequently, GA4 is not tracking real-time activity correctly. Please let me know what else I can do. Thanks.

    #2345027
    David
    Staff
    Customer Support

    Hi there,

    you can set the priority to 0 zero – if there are other elements still appearing before that, then how were those added to the site ?

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.