Recipes

Plain HTML form and any backend

Credit partners from a plain HTML form posting to PHP, Python, Ruby or any server, by passing the partner code through to the conversions API.

The script fills hidden fields; your backend sends them on.

HTML
<script src="https://intrio.co/sdk.js" data-key="pk_…" async></script>

<form method="post" action="/enquire">
  <input name="email" type="email" required>
  <input type="hidden" name="pp_ref">
  <input type="hidden" name="pp_click">
  <button>Send</button>
</form>

On Growth and above, report the lead from your server:

<?php
$ref = $_POST['pp_ref'] ?? '';
if ($ref !== '') {
    $ch = curl_init('https://intrio.co/api/v1/conversions');
    curl_setopt_array($ch, [
        CURLOPT_POST => true,
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_TIMEOUT => 5,
        CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('INTRIO_API_KEY'), 'Content-Type: application/json'],
        CURLOPT_POSTFIELDS => json_encode([
            'id' => 'lead_' . $leadId,
            'type' => 'signup',
            'programme' => 'enquiries',
            'ref' => $ref,
            'click_id' => $_POST['pp_click'] ?: null,
            'customer' => ['id' => (string) $leadId, 'email' => $_POST['email']],
        ]),
    ]);
    curl_exec($ch);
}

On Free or Starter, report from the browser after the form succeeds instead: intrio.track("lead", { customer: { email } }).

Last updated 20 November 2026. Building with an AI assistant? Point it at /docs/llms-full.txt.