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>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag(‘js’, new Date());
gtag(‘config’, ‘G-NHV97ZZXJW’);
</script>