Install on Kit (ConvertKit)
Kit has no site-wide head HTML slot and does not expose order data in templating, so installs are per-landing-page for click capture and server-side S2S for conversions.
Kit (formerly ConvertKit) has two architectural constraints Rekomi has to work around. First, Kit does not expose a site-wide custom-head-HTML slot; scripts attach per-landing-page and per-form individually. Second, Kit Commerce does not expose order data (amount, customer email) via templating on the post-purchase page, so the convert event has to come from a server-side webhook handler, not the browser. The install is more work than a head-script-and-Liquid-block setup, but it produces accurate attribution.
Note on the CRM vs Commerce sides of Kit
Kit has two distinct integrations with Rekomi. This doc covers Kit Commerce attribution (capturing sales of Kit-hosted products). If you want Rekomi to sync approved affiliates into Kit as tagged subscribers (separate integration, no relation to billing), see crm-convertkit.
Install the head script (per landing page)
Kit does not have a site-wide head HTML slot. You install the Rekomi script per landing page that should capture affiliate clicks. If you have five Kit landing pages running campaigns, you do this five times.
Step 1. In Kit, navigate to Grow > Landing Pages & Forms > select a landing page.
Step 2. In the landing page editor, click the + icon in the toolbar > Script.
Step 3. Paste the Rekomi head script:
<script>
(function(){
var s=document.createElement('script');
s.src='https://js.rekomi.com/v1/rekomi.js';
s.async=true;
s.dataset.programId='YOUR_PROGRAM_ID';
document.head.appendChild(s);
})();
</script>Step 4. Publish the landing page.
Step 5. Repeat for every landing page that affiliates send traffic to.
If you have many landing pages, automate this with a custom integration via Kit's API (PUT updates to each landing page with the script payload). For most accounts with 1-5 landing pages, manual install is faster than building automation.
Your program ID is in Rekomi at Settings > Tracking.
Fire conversions via server-side S2S (recommended)
Kit's post-purchase page does NOT expose order data via templating. You cannot Liquid-template the convert event with order id, amount, or email from the post-purchase page itself. The clean path is to fire conversions from a server-side handler listening to Kit's purchase.created webhook.
Step 1. In Kit, set up a webhook destination at Settings > Advanced > Webhooks or via Kit's V4 API webhook endpoints. Subscribe to purchase.created (and purchase.refunded for refund handling).
Step 2. Build a handler on your backend that receives the webhook payload and relays to Rekomi's S2S endpoint:
// Node example
app.post('/webhooks/kit', async (req, res) => {
// 1. Validate Kit's webhook signature (Kit signs with the secret you set
// during webhook creation; see Kit's webhooks docs).
const purchase = req.body.purchase;
// 2. Find the referral. Kit doesn't carry referral metadata natively;
// you have to capture it on the landing page (using the head script's
// window.Rekomi.getReferral()) and pass it through to Kit at signup
// via a hidden form field. The slug then lands on the subscriber record
// and is accessible via the subscriber API.
//
// If you don't pass it through, you can email-match: Rekomi finds the
// affiliate slug from recent clicks matching the customer's email.
const referral = purchase.subscriber?.fields?.rekomi_affiliate_slug;
if (!referral) {
// Fall back to email-matching: pass email only, let Rekomi resolve.
}
const body = JSON.stringify({
external_event_id: purchase.id,
affiliate_slug: referral,
amount_cents: purchase.total_amount_cents, // Kit returns this in cents
currency: purchase.currency,
customer_email: purchase.email_address,
});
const signature = hmacSha256(body, process.env.REKOMI_S2S_SECRET);
await fetch('https://api.rekomi.com/api/tracking/s2s', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Rekomi-Signature': signature,
},
body,
});
res.sendStatus(200);
});The external_event_id uses Kit's purchase id for idempotency.
Pass the referral through Kit's signup forms
For the cleanest attribution, capture the affiliate slug on the landing page and pass it into Kit at signup as a custom field. That way, when the buyer eventually completes a purchase, the referral travels with them via the subscriber record.
On the landing page, add a hidden field to your Kit form (Kit allows custom fields per form configuration). Name the field rekomi_affiliate_slug. Hydrate it with JavaScript on page load:
<script>
document.addEventListener('DOMContentLoaded', function(){
var slug = window.Rekomi && window.Rekomi.getReferral();
if (!slug) return;
var field = document.querySelector('input[name="fields[rekomi_affiliate_slug]"]');
if (field) field.value = slug;
});
</script>The slug then lands on the Kit subscriber record under the rekomi_affiliate_slug field, and your webhook handler can read it from purchase.subscriber.fields.rekomi_affiliate_slug.
Alternative: client-side render from webhook (fragile)
If server-side S2S is not an option, you can render the convert snippet server-side from your fulfillment webhook with the actual order values, then inject the rendered HTML into the Kit post-purchase page as a Script element. This requires hosting a server-rendered HTML fragment that Kit's post-purchase page iframes or fetches, which is more fragile than the S2S path. Use S2S unless you have a specific reason not to.
Quirks worth knowing
No site-wide head slot. Per-landing-page install is the only no-code option. If you frequently add new landing pages, build a Kit API script that pushes the Rekomi snippet to every new landing page automatically.
No order data in templating. Kit's post-purchase page does not expose {{order.total}}, {{customer.email}}, or similar Liquid placeholders. Server-side S2S is the recommended path because of this constraint.
Subscriber custom fields require form pre-configuration. Adding rekomi_affiliate_slug as a hidden field requires the field to exist on the Kit form first. In the Kit form editor, add a "Custom field" with the API name rekomi_affiliate_slug before adding the hidden HTML.
Kit Commerce refunds. Subscribe to purchase.refunded and POST to Rekomi's /api/tracking/refund with the matching external_event_id from the original conversion. Commission reverses automatically.
Kit subscriber syncing is a separate integration. Rekomi can also sync approved affiliates INTO Kit as tagged subscribers; that's a different integration from conversion tracking. See crm-convertkit for the subscriber sync setup.
Troubleshooting
Click cookie sets but conversions never fire. Check your webhook handler is receiving purchase.created events from Kit (test by completing a real purchase, with refund if needed). If the handler is firing but Rekomi shows no S2S call, verify the HMAC signature: it must be over the raw JSON.stringify(body) you POST to Rekomi, not over Kit's incoming payload.
Wrong amount on commissions. Kit returns total_amount_cents as cents (integer), so do NOT multiply by 100. Multiplying gives a 100x commission.
Referral slug missing from purchase webhook. The custom field on the Kit form was not pre-configured, or the hidden form-field hydration script did not run before form submit. Verify by inspecting a recent Kit subscriber record; the rekomi_affiliate_slug field should be populated if the install is correct.
Multiple landing pages, inconsistent attribution. You installed the head script on some landing pages but not others. Affiliates send traffic to all of them; only the ones with the script capture clicks. Install on every landing page that affiliates touch.
Related
- S2S tracking API reference
- JavaScript pixel reference
- crm-convertkit for subscriber syncing (separate integration)
Install on beehiiv
beehiiv blocks per-post script tags and offers no arbitrary head HTML field, so Rekomi installs via Google Tag Manager. Premium Subscriptions then attribute through beehiiv's Stripe Connect webhook.
Install on WordPress
WPCode plugin in the Header field. Block themes hid the Theme File Editor, so editing functions.php directly is not the modern path.