Cache and JavaScript optimization
How to adjust plugins cache and optimization so that they do not break GLAMI pixel and do not show the "glami is not defined" error.
Plugins speed (e.g. WP Rocket, LiteSpeed Cache, Autoptimize, Permatters) often delay, unite or move scripts. If the GLAMI script loads after from events, the browser shows glami is not defined And the measurement is lost.
Settings to check#
- Delay JavaScript execution (run delay until interaction): exclude scripts containing glami.
- Combine / Minify JavaScript: exclude the GLAMI code from the merger.
- Defer / Load JS deferred: if events are incorrect, exclude GLAMI.
- Page cache on Thanksgiving page: the order confirmation page should not be served by cache. Most plugins cache already exclude it, along with basket and cashier.
Steps#
- Add the word
glamithe JavaScript exceptions of the plugin cache. - Clean the cache of the site, CDN (e.g. Cloudflare) and browser.
- Do it. verification and check the tab Console.
If the error persists#
Disable JavaScript optimization temporarily and try again. If the error disappears, the cause is optimization; if not, open a request to OBS with the name of the theme, plugin cache and a screenshot of the console.
Send a request; the plugin and the article are automatically completed.