Before you start
Install the Octanist pixel on the page first:window.OCT.submitLeadForm, do not also use data-forms="true" for that form.
Send a form submission
Usewindow.OCT.submitLeadForm(fields, options) after your form has successfully submitted.
true when Octanist accepted the payload for sending. It returns false when the payload is empty or invalid.
Supported options:
| Option | Description |
|---|---|
formIdentifier | A stable name for the form, such as contact-form or demo-request. |
path | Optional page path override. Use only when the form belongs to a different page path. |
title | Optional page title override. |
octa_sid. Field values are trimmed and long values are shortened.
AJAX example
For AJAX forms, send the form to your own endpoint first. Call Octanist only after the website knows the form was accepted.Read the session ID
Usewindow.OCT.getSessionId() when you need the browser session ID.
octa_sid.
Update consent manually
Usewindow.OCT.setConsent() when your consent banner has its own callback and Octanist cannot detect it automatically.
Set consent before OCT is ready
If your consent code can run before the pixel has finished loading, use one of these options. Set a global value before the pixel loads:Other OCT methods
| Method | Description |
|---|---|
window.OCT.getSessionId() | Returns the current session ID. |
window.OCT.getClientId() | Returns the visitor cookie ID when consent allows it, otherwise null. |
window.OCT.getConsentState() | Returns the current consent state. |
window.OCT.setConsent(consent) | Manually updates consent. |
window.OCT.submitLeadForm(fields, options) | Sends a browser-side form submission. |
window.OCT.debug() | Returns a debug snapshot for the current page. |
Debugging
Usewindow.OCT.debug() for a quick browser console snapshot. For a fuller support report, use the Octanist Debugger.