Conversion events
A conversion event is the reward signal the optimizer learns from. Create one in the app, paste its snippet where the conversion happens, and watch it verify.
A conversion event is what the optimizer is optimizing for. It is the reward signal: every variant's performance is measured by how often visitors who saw it went on to fire your event.
Get this wrong and everything downstream is wrong. The bandit will faithfully optimize toward whatever you told it to count.
Create the event first, paste the code second
Unlike 1.0, events are declared in the app before they exist in your code. Go to Settings → Conversion events and create one. The pane opens once Tracking Setup has your script live and your consent banner connected.
| Field | What it means |
|---|---|
| Event name | A readable name for the event, such as Lead submitted. It is what you see in the app. |
| Tracking code | The identifier your code passes to track. Optimeleon generates it from the name (lead_submitted), and you can edit it. |
Primary and secondary are set per page
Whether an event steers a page is not a property of the event. It is decided on the page:
- The primary goal is the outcome you actually want, and it is what the optimizer learns from. You choose it when you add the page. After that it is fixed, because changing it would restart the page's measurement from zero. If a page needs a different goal, talk to your Optimeleon contact.
- Secondary events are measured and reported but do not steer traffic allocation. Add or remove them in the page's settings at any time.
The events table shows each event's role across your pages: Objective, Step, Secondary, or Tracked only when no page uses it yet.
Paste its snippet where the conversion happens
Once the event exists, Optimeleon generates its snippet. Copy it from the event and put it on the code path that runs when the conversion actually occurs: your order confirmation handler, your form success callback, your booking confirmation.
Directly in your page
<script>
window.optimeleon && window.optimeleon('track', 'lead_submitted', {});
</script>Through Google Tag Manager
Create a Custom HTML tag with the same call and attach your existing conversion trigger to it: the click, form-submit or custom-event trigger you already fire on.
<script>
window.optimeleon && window.optimeleon('track', 'lead_submitted', {});
</script>window.optimeleon && guard is there on purpose: it makes the call a safe no-op on a page where the install snippet is absent, instead of a ReferenceError in your conversion handler. Keep it. Firing the same event more than once is also safe.If the conversion happens on a page that does not carry the Optimeleon script, or on your server, each event also offers a self-contained version of its snippet and a server request you can send instead.
Sending properties
The third argument is a plain object. Revenue events are the common case:
window.optimeleon('track', 'purchase', {
value: 149.00,
currency: 'EUR',
});Timing: calls before the script loads are safe
The inline bootstrap installs a queue, so a track call that runs before the tracking bundle has finished loading is queued and replayed in order rather than lost. You do not need to wrap it in a readiness check.
Shopify: pick your events, do not write them
On Shopify there is no event code to paste at all. Once the Custom Pixel is live it listens to your store's own events (purchases, started checkouts, payment submissions, adds to cart, browse and search activity) and the Events page lists what your store is actually sending, with how many times each has been seen since Optimeleon started listening. Click one to make it a conversion goal. See Shopify.
Verify it fires
- Load your site and accept your cookie banner, because nothing is recorded without consent.
- Complete the conversion yourself, or trigger the code path that fires it.
- Watch DevTools → Network for a
POST https://edge.optimeleon.com/e/…returning 202, or open the preview overlay with?opti_debug=1and watch the event appear in its live feed. - Back in Optimeleon, the event row shows it was seen and the conversion step of the checklist turns green.
?opti_debug=1 is an inspection overlay, not a mute. The page tracks exactly as it would for a real visitor, which is what makes it useful for confirming an event fires. If you want to look at a variant without recording anything, use a Preview link instead.When to create an event
- Before you publish your first variant. Without a conversion event the bandit has no reward signal and cannot learn.
- One primary goal per page you optimize. Different pages can and should have different primaries. A pricing page and a blog post are not chasing the same outcome.
- Secondaries generously. They cost nothing, they do not steer anything, and they make your Performance view far more informative when a result surprises you.
