Title: Double Hit Pageview
Last modified: October 30, 2020

---

# Double Hit Pageview

 *  Resolved [maxgs3](https://wordpress.org/support/users/maxgs3/)
 * (@maxgs3)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/double-hit-pageview/)
 * Hi,
    i have set gtag script before </head> for Analytics in all pages. i’ve set
   the module like this image: [https://imgur.com/jA3UY4R](https://imgur.com/jA3UY4R)
 * All woocommerce page hit double pageview.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fdouble-hit-pageview%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [maxgs3](https://wordpress.org/support/users/maxgs3/)
 * (@maxgs3)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/double-hit-pageview/#post-13601090)
 * 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
 *  [Siew](https://wordpress.org/support/users/kosiew/)
 * (@kosiew)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/double-hit-pageview/#post-13613340)
 * 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](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](https://wordpress.org/support/users/maxgs3/)
 * (@maxgs3)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/double-hit-pageview/#post-13614078)
 * 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](https://wordpress.org/support/users/access/) public*
   [@return](https://wordpress.org/support/users/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; }

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Double Hit Pageview’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce-google-analytics-integration/assets/icon-256x256.
   png?rev=3234358)
 * [Google Analytics for WooCommerce](https://wordpress.org/plugins/woocommerce-google-analytics-integration/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-google-analytics-integration/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-google-analytics-integration/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-google-analytics-integration/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-google-analytics-integration/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-google-analytics-integration/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [maxgs3](https://wordpress.org/support/users/maxgs3/)
 * Last activity: [5 years, 6 months ago](https://wordpress.org/support/topic/double-hit-pageview/#post-13614078)
 * Status: resolved