Bindings

Fire events from what the site does — a background form submission that succeeds, an element that appears — without editing the theme or the form plugin.

Tracking code pasted into templates gets copied, forked and lost on the next redesign. A binding lives in one place, in Pixelonce, and is included in the configuration export.

Ajax bindings

An ajax binding watches background requests made with jQuery. It matches a WordPress admin-ajax.php request by its action, or any endpoint by part of its URL (useful for REST routes that have no action field).

It fires on success, not on HTTP 200. WordPress ajax handlers answer 200 with {success:false} when validation fails, so firing on the status code alone would count applications that never went through. Require success is on by default; you can also require specific response fields, such as status = mail_sent (dotted paths allowed).

{
  "type": "ajax",
  "emit": "Lead",
  "action": "submit_application",
  "require_success": true,
  "success_when": { "data.stage": "complete" },
  "params_from_payload": { "content_name": "plan" }
}

params_from_payload copies values from the submitted form data into event parameters.

Appear bindings

An appear binding fires when an element matching a selector becomes visible — for example the “thank you” panel a form swaps in after submitting.

{
  "type": "appear",
  "emit": "CompleteRegistration",
  "selector": ".application-complete"
}

How bindings and pages work together

A binding only signals. The event still has to be declared on the page with the trigger When the site signals it, and its “how often” setting still decides whether it fires. So a form that is submitted twice still reports one Lead if the event is set to once per visitor.

Events sent elsewhere

If an event is listed under Settings → Events sent elsewhere (for example a server-side Purchase), a binding that tries to emit it is dropped and logged, so the browser cannot double-count it.

Is my binding still working?

The trigger health check records the last time each binding, click selector and submit selector matched. A trigger that has gone quiet after a theme or form plugin update is flagged on the Pixelonce dashboard.