OptimeleonOptimeleon
Request Access
Setup · Step 3

Installing the script

One paste into your <head>: an inline bootstrap plus two async bundles, one that serves variants and one that captures behavior. What each part does, where it has to sit, and how to prove it landed.

One paste, into the <head> of every page you want Optimeleon on. Copy it from Setup → Script in the app. It is stamped with your project's token, so do not retype it from here.

Important
The snippet below is a simplified sketch of the shape. Always copy the real one from the app: it carries your project token, and on sites running a speed plugin it also carries that plugin's opt-out attributes.
the shape of the paste
<!-- Optimeleon. Paste once, inside <head>. Do not modify. -->
<script>/* Optimeleon bootstrap: call queue + anti-flicker guard */</script>
<script async crossorigin="anonymous" src="https://edge.optimeleon.com/b/YOUR_TOKEN.js"></script>
<script async crossorigin="anonymous" src="https://edge.optimeleon.com/c/YOUR_TOKEN.js"></script>

What each part is for

TagRoleIf it fails
Inline scriptInstalls the call queue so nothing you call early is lost, and raises the anti-flicker guard before any body content paints.The page never hides, so no flicker protection. The page is visible, which is the safe direction.
/b/…jsThe experimentation bundle. Fetches the variant decision and applies it, then reveals the page.The page reveals itself and visitors see your original.
/c/…jsThe tracking bundle. Captures pageviews, behavior and your conversion events.No measurement. Variants still serve.
Keep every attribute on the tags
Both bundle tags carry crossorigin="anonymous", and on some sites the tags carry extra attributes as well. They are there for serving performance and for surviving speed plugins. Copy the snippet as given and do not tidy the tags up.
01

Put it as high in the head as you can

Ideally the first thing in <head>, above your tag manager, your analytics, and your fonts. The anti-flicker guard can only protect what has not painted yet, so every tag ahead of it is a tag that can delay it.

Optimeleon checks this for you and raises a non-blocking warning if the snippet is sitting lower than it should. The install verifies either way. It is worth fixing, not worth stopping for.

Tip
If your platform will not let you reach the top of the head, a Shopify app embed for example, that is fine and supported. It just means the guard has slightly less runway. See Shopify.
02

Do not modify, minify, defer or move it

The four ways installs actually break, in the order we see them:

  • A speed plugin re-hosts the bundles from your own domain. The page looks fine and the tests keep running, but your events are being posted to your web server, where they vanish. A copied bundle also freezes your campaign configuration at the moment the copy was made, so a variant you publish later silently never goes live.
  • “Delay JavaScript execution” holds the tags until first interaction. Visitors who never scroll or tap are never counted, and variants apply late and visibly.
  • The tags are moved into a tag manager. Same problem, different cause. See Google Tag Manager.
  • A Content Security Policy blocks them. Covered below.

If your site runs WP Rocket, LiteSpeed, Autoptimize, Perfmatters, SiteGround Optimizer, W3 Total Cache, NitroPack or Cloudflare Rocket Loader, read WordPress & performance plugins before you go live. The snippet carries the opt-out attributes those plugins honour, but several publish no attribute at all and need an explicit exclusion.

03

Allow Optimeleon in your Content Security Policy

If your site sends a CSP header, the edge origin has to be allowed for scripts and for the connections the bundles make.

CSP directives
script-src  'self' https://edge.optimeleon.com;
connect-src 'self' https://edge.optimeleon.com;
Note
The inline bootstrap also needs to run. If your policy has no 'unsafe-inline' for scripts, add a nonce or hash for it. Note that a nonce has to be applied to the tag as you paste it, so this is a change to make in the template, not in the snippet.
04

Verify

The script step hands you a test link that opens your own site with a verification flag on it. Load it once and the step turns green, with no waiting for organic traffic.

To check by hand instead:

  1. Open your page source and confirm both tags load from https://edge.optimeleon.com/… and not from your own domain.
  2. Confirm they are plain <script async src="…"> tags, not type="text/rocketlazyloadscript" or data-rocket-src="…".
  3. Load the page, accept your cookie banner, and watch DevTools → Network for a POST https://edge.optimeleon.com/e/… returning 202.

The install health panel

Below the snippet, Optimeleon shows what it can see about your live install: whether the bundles are being served from us or from a copy, whether execution is being blocked or delayed, whether the anti-flicker guard is intact, and where in the head the paste is sitting.

Each finding names the thing to fix. A green pageview signal with an amber finding beside it means “this works, and it is still worth fixing”. The checklist will not show you a clean tick over a panel that is asking for work.

The AI Installation Kit

If you are handing the install to a developer or an agency, open Custom instructions on the script step. Optimeleon detects your stack and generates install instructions written for it, including the exclusions your specific speed plugin needs, which you can send on as a self-contained brief.

Installed
Once the script step is green, carry on to Consent & cookies. Until your consent banner is wired, Optimeleon serves variants but records nothing.