OptimeleonOptimeleon
Request Access
Platform

WordPress & performance plugins

WP Rocket, LiteSpeed, Autoptimize, Perfmatters, SiteGround Optimizer and Cloudflare can re-host or delay the Optimeleon script. The exclusion rules that keep it intact.

Who this is for: anyone installing Optimeleon on WordPress, or on any site behind a caching, speed or CDN optimisation layer such as WP Rocket, LiteSpeed Cache, Autoptimize, Perfmatters, SiteGround Optimizer or Cloudflare.

What can go wrong

Performance plugins rewrite the <script> tags on your pages to make them “faster”. Two of those rewrites break Optimeleon, and both fail silently.

  1. Your site starts serving a copy of Optimeleon's script. Minify/combine features, and CDN “self-host third-party scripts” features, download our script and serve the copy from your own domain. It still loads and looks fine, but your analytics events are then posted to your web server, where they are lost. Your tests keep running, so nothing looks broken; the data just stops arriving. A copied script also freezes your campaign configuration at the moment the copy was made, so a variant you publish later can silently never go live.
  2. “Delay JavaScript execution” stops our script running. Delay features hold every tag until the visitor's first interaction: a scroll, a tap, a mouse move. Visitors who leave without interacting are never counted, and variants apply late and visibly.

The snippet protects itself, mostly

Optimeleon scans your site to see which speed plugin it runs, and the snippet you copy from the app carries the opt-out attributes that plugin honours. A site running none of these gets a clean snippet with no extra attributes at all.

AttributeAdded when we detectWhat it stops
nowprocketWP RocketDelay JavaScript execution, defer
data-no-minify="1"WP RocketMinify / combine JavaScript
data-no-optimize="1"LiteSpeed CacheJS optimisation (minify / combine)
data-no-defer="1"LiteSpeed CacheJS defer / delay
data-noptimize="1"AutoptimizeOptimisation
data-cfasync="false"Cloudflare Rocket LoaderDeferral
Important
If your snippet has these attributes, keep them. Do not strip or “clean up” the tags. If it has none and you have since installed one of these plugins, re-paste the current snippet from the app: it will come back carrying that plugin's attributes.

Attributes only protect tags the plugin can see them on, so they cannot rescue a snippet the plugin has already cached a rewritten copy of. Add the exclusions below in that case. And several tools (Perfmatters, SiteGround Optimizer, W3 Total Cache, NitroPack) publish no per-tag attribute at all, so for those the exclusions are the only protection. Add them regardless.

Plugin-by-plugin exclusions

WP Rocket

Two settings, and the order matters.

  1. First, stop WP Rocket serving a copy. Settings → WP Rocket → File Optimization → Minify JavaScript files → Excluded JavaScript Files:
    wp rocket · minify exclusion
    edge\.optimeleon\.com
  2. Purge the caches. WP Rocket → Clear cache, and also Remove all minified CSS and JS files. Reload your page and confirm the source loads the script from https://edge.optimeleon.com/…. If the URL still contains wp-content/cache/min, the exclusion did not take.
  3. Then stop WP Rocket delaying it. File Optimization → Delay JavaScript execution → Excluded JavaScript Files, add both lines:
    wp rocket · delay exclusion
    optimeleon
    __opti
Why minify must be excluded first
While minify is rewriting the tag, the script URL on your pages points at your own domain (your-site.com/wp-content/cache/min/…) and contains no “optimeleon” for the delay exclusion to match. Exclude minify first, purge, and only then does the delay exclusion see a URL it can match. (__opti covers the inline part of the snippet either way.)

LiteSpeed Cache

LiteSpeed Cache → Page Optimization → Tuning:

  • JS Excludes, add edge.optimeleon.com
  • JS Deferred / Delayed Excludes, add both edge.optimeleon.com and __opti

Then purge all caches (LiteSpeed Cache → Toolbox → Purge All).

Autoptimize

Settings → Autoptimize → JS, CSS & HTML → Exclude scripts from Autoptimize, add edge.optimeleon.com. Then Delete Cache.

Perfmatters

Perfmatters → Assets → JavaScript → Delay Behavior → Excluded from Delay, add both optimeleon and __opti. If script minification or combining is enabled, exclude edge.optimeleon.com there too.

SiteGround Optimizer

SG Optimizer (Speed Optimizer) → Frontend Optimization → JavaScript → Exclude from Minification / Combination / Defer, add edge.optimeleon.com. Then purge the dynamic cache.

Cloudflare and similar CDNs

  • Rocket Loader. Our tags already carry data-cfasync="false", which Rocket Loader honours. No action needed unless the attribute was stripped.
  • “Self-host third-party scripts” features. Exclude edge.optimeleon.com so our script is always loaded from us, never from a copy.

Verify it worked

  1. Open your page source and confirm both Optimeleon script tags load from https://edge.optimeleon.com/…, not from your own domain.
  2. Confirm the tags are plain <script async src="…">, not type="text/rocketlazyloadscript" or data-rocket-src="…".
  3. Load the site, accept your cookie banner, and check DevTools → Network for a POST https://edge.optimeleon.com/e/… returning 202.
Re-check after plugin updates
Plugin updates sometimes reset exclusion lists. After a major update of your performance plugin, repeat the three checks above. It takes under a minute and catches the silent failure mode before it costs you data.