clickstorm/cs_seo

$ is not defined

filippoff opened this issue · 3 comments

Error in browser console. Appears if the site does not use jQuery. The error reduces PageSpeed scores. jQuery itself, by the way, too. It is necessary to get rid of the dependency in the frontend, or at least split the static template into two parts - for the backend and frontend.

Uncaught ReferenceError: $ is not defined at jquery.cs_seo.ga.js?1651512688:56:4

you have a point. we could remove jquery here. also we could remove the whole file, because it is only for costum events in Google Analytics. Google Analytics 4 offers a lot of default events.

Quick fix would be to remove the file
page.includeJSFooter.654 >

I will also rewrite the file in plain JS. In later versions, I will remove it completely.

file is online. does it work for you?

both works :) yes, I just removed TS from static inclusions in the template and added google tags to the code manually. Unfortunately, I could not reproduce the original problem: when static was disabled, the processing of information in the backend stopped working for me. Now everything works and there are no errors on the frontend. To tell you the truth, I didn't think about what frontend scripts do :)