Use server-side form capture when browser-side form detection is unreliable, blocked by another script, or not suitable for the website’s form stack.
This setup keeps attribution intact by installing the Octanist pixel on the website, reading the hidden session ID from the submitted form, and sending the lead from your server to the Octanist API.
Keep your Octanist API key on the server. Do not call the Create Lead API directly from browser JavaScript.
How it works
- The Octanist pixel creates a browser session.
- The pixel injects a hidden session field into the form.
- The visitor submits the form to your backend.
- Your backend reads the hidden session ID and the form fields.
- Your backend sends the lead to
POST /api/leads with sessionId.
- Octanist links the lead to the existing pixel session, page views, click IDs, UTMs, and consent state.
Install the pixel
Install the Octanist pixel site-wide. If your backend sends the lead, remove data-forms="true" from the script so the browser does not also submit the same lead.
<script
src="https://c.octani.st/p"
data-id="OCT-XXXXXXXX"
data-consent-mode="auto"
></script>
Read the session field
The pixel injects this hidden field into normal forms:
<input type="hidden" name="octa_sid" value="..." />
For Elementor forms, it also injects:
<input type="hidden" name="form_fields[octa_sid]" value="..." />
Read that value in your backend and send it to Octanist as sessionId.
Send the lead
Send the submitted form data to the Create Lead API from your backend:
{
"name": "John Doe",
"email": "john@example.com",
"phone": "+1234567890",
"sessionId": "value-from-octa_sid"
}
If sessionId is valid, Octanist links the new lead to the existing pixel session. If it is missing, Octanist can still create the lead, but the lead may lose the original session and attribution context.
See Create Lead for authentication, supported fields, and full request examples.
If your form submits through same-origin AJAX, the pixel also adds this request header when possible:
X-Octanist-Session-Id: value-from-octa_sid
Your backend can use either the hidden field or the header. Prefer the hidden field when available because it is part of the submitted form payload.
Duplicate prevention
Use one capture method per form:
- Server-side form capture through your backend
- Browser-side pixel form detection through
data-forms="true"
- WordPress server-side capture through the Octanist plugin
- GTM DataLayer lead sending
Do not enable multiple capture methods for the same form unless support has confirmed the setup.
If the form only exists in browser-side JavaScript and does not submit to your backend, use the Client-side API instead.