Michael K
(@mikkamp)
Automattic Happiness Engineer
Hi @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.
Thread Starter
dyin
(@dyin)
@mikkamp thank you for the info. I am using WP Rocket. Anything they/I can do to fix this?
Michael K
(@mikkamp)
Automattic Happiness Engineer
Based on the documentation here: 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
(@dyin)
@mikkamp this is the answer I got:
Regarding the console error:
Please add the following exclusion to Delay JavaScript Execution: 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
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.
Thread Starter
dyin
(@dyin)
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.
I am having a similar error:
Uncaught TypeError: wcgai.trackClassicPages is not a function
at (index):974:7
Hi @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
(@dyin)
i do indeed use wp-rocket
Hi @dyin,
Could you confirm for us if the plugin works as expected if all caching plugins are disabled, temporarily?
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.