However, no event is triggered on my UA propriety. (nor on the GA4 propriety). How can I get the data?
]]>add_filter( 'woocommerce_gtag_snippet', function( $gtag_snippet ) {
return preg_replace( '~</script>~', "gtag('config', 'UA-xxxxxxxxxx-1');\n</script>", $gtag_snippet );
} );
I have added it into my functions.php file and I can see it making changes when I check the page source so it is working but it is not helping with tracking.
Any help would be appreciated
]]>I’ve just installed GSite Kit in order to check that I have all functionalities working OK (AdWords and Analytics). I’ve manually inserted the Analytics tag on my header.php through WordPress and it’s already receiving data about real time connections. Also, when checking with the Tag Assistant Companion (Chrome extension) it shows it is connected, so I assume everything is ok. However, when checking on Google Site Kit plugin in WP it shows my UA property connected but my GA4 property states that “Snippet is not inserted”.
Any recommendation would be truly appreciated.
Thanks.
But you guys *really* need to update the UA string at least once in a while. The latest version has this in checkers/http.php:
//Masquerade as a recent version of Chrome
$ua = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36';
That’s going to cause a lot of 403s from stupid web servers who now block really old UAs. I got one for this site:
$ curl -IA "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36" https://www.nginx.com
HTTP/2 403
Changed it to:
Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.34 Safari/537.36
And it works again.