Title: Console error
Last modified: March 8, 2024

---

# Console error

 *  Resolved [dyin](https://wordpress.org/support/users/dyin/)
 * (@dyin)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/console-error-75/)
 * I am getting this console error:
   Uncaught TypeError: wcgai.trackClassicPages 
   is not a function
 * Not 100% sure if it is from this plugin but WC sounds like “woocommerce” and 
   track classic pages seems consistent with what this plugin does.
 * Any idea for a solution?
 * Thx!

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

 *  [Michael K](https://wordpress.org/support/users/mikkamp/)
 * (@mikkamp)
 * Automattic Happiness Engineer
 * [2 years, 2 months ago](https://wordpress.org/support/topic/console-error-75/#post-17484933)
 * Hi [@dyin](https://wordpress.org/support/users/dyin/)
 * With the new release, we changed the structure of JS scripts. The error you mention
   may be a result of some caching or a script-defer plugin you use that may reorder
   scripts. See [the similar report](https://github.com/woocommerce/woocommerce-google-analytics-integration/issues/368#issuecomment-1981476757).
 *  Thread Starter [dyin](https://wordpress.org/support/users/dyin/)
 * (@dyin)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/console-error-75/#post-17484940)
 * [@mikkamp](https://wordpress.org/support/users/mikkamp/) thank you for the info.
   I am using WP Rocket. Anything they/I can do to fix this?
 *  [Michael K](https://wordpress.org/support/users/mikkamp/)
 * (@mikkamp)
 * Automattic Happiness Engineer
 * [2 years, 2 months ago](https://wordpress.org/support/topic/console-error-75/#post-17485044)
 * Based on the documentation here: [https://docs.wp-rocket.me/article/1351-javascript-minify-combine](https://docs.wp-rocket.me/article/1351-javascript-minify-combine)
 * It sounds like the only “Minify” mode would not change load order, which should
   make it suitable.
 * Although it also mentions that the “Combined” mode takes both js scripts and 
   inline scripts, I’d imagine when it combines them it leaves the order intact,
   but the documentation isn’t clear about that. Maybe that would be something to
   clarify with their help.
   The goal is to find a set of settings where the loading
   order of js scripts and inline scripts remains the same.
 *  Thread Starter [dyin](https://wordpress.org/support/users/dyin/)
 * (@dyin)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/console-error-75/#post-17486295)
 * [@mikkamp](https://wordpress.org/support/users/mikkamp/) this is the answer I
   got:
   Regarding the console error:Please add the following exclusion to Delay 
   JavaScript Execution: [https://prnt.sc/nI1OPCIqeQQ8](https://prnt.sc/nI1OPCIqeQQ8)/
   wp-content/plugins/woocommerce-google-analytics-integration/assets/js/build/main.
   jsIn the following screenshot, you can see how to add it: [https://prnt.sc/5vIuILtU8CN2](https://prnt.sc/5vIuILtU8CN2)
 * However, is this smart to do? If I exclude your JS won’t it run any analytics
   before consent is given?
 * Another major issue I am having is that my data in analytics is completely wrong
   since implementing consent mode and updating to the latest plugin version. Not
   sure what is going on
 * edit: after implementing it I now have an extra console error: wgai is not defined
    -  This reply was modified 2 years, 2 months ago by [dyin](https://wordpress.org/support/users/dyin/).
 *  Thread Starter [dyin](https://wordpress.org/support/users/dyin/)
 * (@dyin)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/console-error-75/#post-17486411)
 * I have decided to for the time being remove the plugin and proceed only with 
   GTM. I will investigate further after all this consent mode v2 dust has settled.
   No correct data was coming through anyway.
 * I would really like to thank you for the assistance though.
 *  [cgllc](https://wordpress.org/support/users/mfulham/)
 * (@mfulham)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/console-error-75/#post-17492019)
 * I am having a similar error:
 *     ```
       Uncaught TypeError: wcgai.trackClassicPages is not a function
           at (index):974:7
       ```
   
 *  Plugin Support [Saravanan S, a11n](https://wordpress.org/support/users/simplysaru/)
 * (@simplysaru)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/console-error-75/#post-17511467)
 * Hi [@mfulham](https://wordpress.org/support/users/mfulham/),
 * 
   Could you please confirm for us if you have any caching plugins on your store,
   that could be causing this issue?
 *  Thread Starter [dyin](https://wordpress.org/support/users/dyin/)
 * (@dyin)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/console-error-75/#post-17511573)
 * i do indeed use wp-rocket
 *  [cgllc](https://wordpress.org/support/users/mfulham/)
 * (@mfulham)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/console-error-75/#post-17511782)
 * we also use wp rocket
 *  Plugin Support [Saravanan S, a11n](https://wordpress.org/support/users/simplysaru/)
 * (@simplysaru)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/console-error-75/#post-17523595)
 * Hi [@dyin](https://wordpress.org/support/users/dyin/), 
   Could you confirm for
   us if the plugin works as expected if all caching plugins are disabled, temporarily?
 *  Plugin Support [Feten L. a11n](https://wordpress.org/support/users/fetenlakhal/)
 * (@fetenlakhal)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/console-error-75/#post-17806814)
 * Hi there!
 * We haven’t heard back from you in a while, so I’m going to mark this as resolved–
   we’ll be here if and/or when you are ready to continue.

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

The topic ‘Console error’ 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/)

 * 11 replies
 * 5 participants
 * Last reply from: [Feten L. a11n](https://wordpress.org/support/users/fetenlakhal/)
 * Last activity: [1 year, 11 months ago](https://wordpress.org/support/topic/console-error-75/#post-17806814)
 * Status: resolved