Skip to content

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.

Updated 4 Nov 2026 1 min read Step 10 of 11
WooCommerce GLAMI Pixel Plugin Buy Support

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#

  1. Add the word glami the JavaScript exceptions of the plugin cache.
  2. Clean the cache of the site, CDN (e.g. Cloudflare) and browser.
  3. 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.

Did this article help you?
It's not solved?

Send a request; the plugin and the article are automatically completed.

Request support