clickstorm / cs_seo

[clickstorm] SEO
Other
33 stars 49 forks source link

$ is not defined #294

Closed filippoff closed 2 years ago

filippoff commented 2 years ago

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

mhirdes commented 2 years ago

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.

mhirdes commented 2 years ago

file is online. does it work for you?

filippoff commented 2 years ago

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 :)