Thread Starter
maxgs3
(@maxgs3)
add_filter( ‘wc_google_analytics_send_pageview’, ‘__return_false’ );
i’ve found this spec in your guide, but if i add this line code, Ecommerce tracking stop to work
Hi there,
> set gtag script before </head> for Analytics in all pages.
Google Analytics Integration support for gtag.js is being worked on here in this github issue:
https://github.com/woocommerce/woocommerce-google-analytics-integration/issues/102
Can you try by removing the gtag.js in header in the meantime?
Thread Starter
maxgs3
(@maxgs3)
Hi,
i’ve have fix temporarily with this function.
I use gtags where page is not Woocommerce template, otherwise hit with your module.
/**
* is_realy_woocommerce_page – Returns true if on a page which uses WooCommerce templates (cart and checkout are standard pages with shortcodes and which are also included)
*
* @access public
* @return bool
*/
function is_realy_woocommerce_page () {
if( function_exists ( “is_woocommerce” ) && is_woocommerce()){
return true;
}
$woocommerce_keys = array ( “woocommerce_shop_page_id” ,
“woocommerce_terms_page_id” ,
“woocommerce_cart_page_id” ,
“woocommerce_checkout_page_id” ,
“woocommerce_pay_page_id” ,
“woocommerce_thanks_page_id” ,
“woocommerce_myaccount_page_id” ,
“woocommerce_edit_address_page_id” ,
“woocommerce_view_order_page_id” ,
“woocommerce_change_password_page_id” ,
“woocommerce_logout_page_id” ,
“woocommerce_lost_password_page_id” ) ;
foreach ( $woocommerce_keys as $wc_page_id ) {
if ( get_the_ID () == get_option ( $wc_page_id , 0 ) ) {
return true ;
}
}
return false;
}