WP Rocket blocking Google Analytics Event Tracking

[ad_1]

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]

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer