Skip to content

JS SDK

JS SDK (optional)

If your flow is client‑side, the SDK is the fastest way to track conversions.

  1. Entry page (after redirect): capture the click id
<script src="https://cdn.shortkit.io/sdk/shortkit.min.js"
data-shortkit data-event="init" data-clid-param="clid"></script>

If you used {clickid} with a custom param (e.g., cid), set data-clid-param="cid".

  1. Thank‑you page: send the event
<script src="https://cdn.shortkit.io/sdk/shortkit.min.js" data-shortkit data-event="init"></script>
<script>
ShortKit('track', { event: 'lead' });
// Or
// ShortKit('track', { event: 'purchase', order_id: 'INV-42', amount: 9.99, currency: 'USD' });
</script>

Notes

  • The SDK stores the click id and retries automatically when offline.
  • Prefer server‑to‑server postback if your checkout already runs in the backend.
  • Safe build is available as shortkit.safe.min.js if your CSP/tooling is strict.

See: Conversions