OrcLink
← Help Center

Forms

Ninja Forms

Capture Ninja Forms submissions with the OrcLink script.

How to count Ninja Forms submissions as conversions in OrcLink. Tested against a copy of Ninja Forms's form markup and submit behaviour (app/api/capture/__tests__/fixtures/builders/ninja-forms.html, test app/api/capture/__tests__/tjs/builders.test.ts). Limits of that test: it is a copy of the markup and of the submit flow as documented, not the live builder; no Shadow DOM; the builder re-rendering the form is not modelled. Check your own page with the test tool.

Set up

  1. Add the OrcLink script to every page (Conversions > Install).
  2. In Conversions > Install > 3. Forms make sure form capture is on (it also switches orc.trackConversion on).
  3. Add the snippet below.

Ninja Forms submits with a button of type button and AJAX, so the browser fires no submit event and auto capture cannot see it. Use Ninja Forms' own JavaScript event and pass the values your page already has to orc.trackConversion:

<script>
jQuery(document).on('nfFormSubmitResponse', function (e, r) {
  var f = (r && r.response && r.response.data && r.response.data.fields) || {};
  var p = { kind: 'form', event_id: 'nf_' + r.response.data.actions.save.sub_id };
  for (var k in f) {
    if (f[k].type === 'email') p.email = f[k].value;
    if (f[k].type === 'phone') p.phone = f[k].value;
  }
  if (window.orc) window.orc.trackConversion(p);
});
</script>

Add it once, site-wide (for example in a code snippets plugin), after jQuery. Send only email, phone, kind and an id: the server drops every other key unless you allow it with a type (Capture > Rules > trackConversion fields; allowed keys are stored with the conversion), and never keeps free text in HIPAA mode. event_id (4-64 letters, digits, _ or -; nf_ + the submission id) makes a double fire one conversion.

Do not also add a form selector for Ninja Forms: it would never fire (no submit event), and is not needed.

The response field types (email, phone) are as Ninja Forms 3 documents them; check one submission in the test tool.

Check it

  1. Open Capture > Test tool in OrcLink and turn test mode on (or add data-orc-test to the script tag on a test copy of the page).
  2. Open the page from an OrcLink link (so the address has ?olid=), fill in the form and send it.
  3. Within a few seconds the test tool shows one row: kind, the field NAMES read and hashed (email, phone), match "click id", outcome "Yes". It never shows values.
  4. Turn test mode off. Test outcomes are never sent to an ad platform.

Privacy

  • With this snippet, YOUR code decides what is sent: it passes only the email and phone fields of Ninja Forms' response. The OrcLink script itself reads nothing from the form. Names, messages, dates of birth and every other field stay in the page. The server hashes the email and phone on arrival and never stores them raw.
  • Nothing is read or sent before the visitor gives advertising consent (when the workspace follows the consent manager). In HIPAA mode the same rules hold; hashes only.