Hey, we’ve had a similar bug on one of our websites.
We fixed it with popping this code in functions.php
/**
* Fix bug with GA4 page views not tracking
*/
add_filter("woocommerce_gtag_snippet","flaunt_ga_page_views",10,1);
function flaunt_ga_page_views($gtag_snippet) {
$gtag_snippet .= "
<script>
gtag('event','page_view',{
page_title: document.title,
page_location: window.location.href
});
</script>";
return $gtag_snippet;
}
-
This reply was modified 2 years, 1 month ago by flauntsam.