So this one is driving me crazy. I moved from MonsterInsights to just putting the GA code in my header, and my bounce rate went up 10% / event tracking stopped completely.
I’ve excluded the following in WP Rocket’s “Delay JavaScript Execution”:
google-analytics.com/analytics.js
gtag.js
googletagmanager.com/gtag/js?id=UA-1234567-2
googletagmanager.com/gtag/js
ga\( ‘
ga\(‘
__gtagTracker
monsterinsights_frontend
/google-analytics-for-wordpress/assets/js/frontend-gtag.min.js
scripts.mediavine.com
/gtag/js
gtag\(
/gtm.js
/gtm-
And the GA code that’s apparently not firing properly is:
<!– Google tag (gtag.js) –>
<script async src=”https://www.googletagmanager.com/gtag/js?id=UA-82922720-2″></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag(‘js’, new Date());
gtag(‘config’, ‘UA-1234567-2’);
</script>
Can anyone tell me what I’m missing that could be causing this disconnect?
[ad_2]