Title: Javascript exception with theme
Last modified: September 21, 2017

---

# Javascript exception with theme

 *  Resolved [jimkeir](https://wordpress.org/support/users/jimkeir/)
 * (@jimkeir)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/javascript-exception-with-theme/)
 * If a theme uses product display from a page that isn’t the WC shop or product
   page, Google Analytics is not installed because is_woocommerce() returns false.
   However, the shop item loop items do not check for this.
 * In includes/class-wc-google-analytics-js.php, at the top of function listing_impression,
   add:
 *     ```
             if (!is_woocommerce())
             {
                return;
             }
       ```
   

The topic ‘Javascript exception with theme’ 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/)

 * 0 replies
 * 1 participant
 * Last reply from: [jimkeir](https://wordpress.org/support/users/jimkeir/)
 * Last activity: [8 years, 8 months ago](https://wordpress.org/support/topic/javascript-exception-with-theme/)
 * Status: resolved