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 async src="https://api.rekomi.com/api/v1/r/loader.js" data-program-id="YOUR_PROGRAM_ID"></script>Step 4. Publish the landing page.
Step 5. Repeat for every landing page that affiliates send traffic to.
Kit's public API has no endpoint for updating landing-page content, so the paste is manual per page. For most accounts with 1-5 landing pages that is a few minutes of work; budget accordingly if you run many.
Copy the snippet with your program ID already filled in from Setup > Install in Rekomi.
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 webhook.
Step 1. Create the webhook via Kit's V4 API (Kit webhooks are API-managed; there is no dashboard screen for them): POST to Kit's /v4/webhooks endpoint with your handler URL as the target and the event purchase.purchase_create. Kit has no purchase-refund webhook event, so refunds are handled separately (see Quirks below).
Step 2. Build a handler on your backend that receives the webhook payload and relays to Rekomi's S2S endpoint. The request needs your bearer API key (rk_live_...) in the Authorization header, plus an HMAC-SHA256 signature computed with your separate signing secret (rks_...) over the string <timestamp>.<raw body>:
// Node example
const crypto = require('crypto');
app.post('/webhooks/kit', async (req, res) => {
// 1. Verify the request really came from Kit (per 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 lives on the subscriber
// record. The purchase payload does NOT include subscriber custom
// fields, so look the subscriber up first.
const subRes = await fetch(
`https://api.kit.com/v4/subscribers/${purchase.subscriber_id}`,
{ headers: { 'X-Kit-Api-Key': process.env.KIT_API_KEY } }
);
const subscriber = (await subRes.json()).subscriber;
const referral = subscriber?.fields?.rekomi_affiliate_slug;
if (!referral) {
return res.sendStatus(200); // no referral captured; nothing to attribute
}
const body = JSON.stringify({
externalEventId: String(purchase.id),
affiliateSlug: referral,
// Kit money fields (total, subtotal, discount) are decimal currency
// units, not cents. Convert before sending.
amountCents: Math.round(purchase.total * 100),
currency: purchase.currency,
customerId: purchase.email_address,
});
const ts = Math.floor(Date.now() / 1000);
const sig = crypto
.createHmac('sha256', process.env.REKOMI_SIGNING_SECRET) // the rks_... signing secret
.update(`${ts}.${body}`)
.digest('hex');
await fetch('https://api.rekomi.com/api/tracking/s2s', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${process.env.REKOMI_API_KEY}`, // rk_live_...
'X-Rekomi-Signature': `t=${ts},sig=${sig}`,
},
body,
});
res.sendStatus(200);
});The externalEventId uses Kit's purchase id for idempotency. Field names are camelCase; snake_case keys are not accepted. See the S2S tracking API reference for the full contract.
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. Kit's purchase webhook payload does not include subscriber custom fields, so your handler fetches the subscriber from Kit's subscribers API (as in the example above) to read it.
Why coupon codes are not a fallback here
Rekomi coupon codes are real discount codes minted on a connected payment gateway (Stripe, Shopify, or Wix), and attribution happens when that gateway reports the redemption. Kit Commerce runs its own checkout with its own discount codes, so a code typed there never reaches Rekomi. For Kit-hosted products, the S2S relay above is the attribution path; coupon-based attribution only applies if you sell through a connected gateway instead of Kit Commerce.
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. Kit has no purchase-refund webhook event, so refunds cannot be automated from Kit's side. When you refund a Kit sale, POST to Rekomi's /api/tracking/refund with the matching externalEventId (the Kit purchase id) yourself, from an admin script or as a step in your refund process. Commission reverses automatically once the call lands.
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.purchase_create 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 request: the bearer API key (rk_live_...) goes in the Authorization header, and the X-Rekomi-Signature header must be t=<timestamp>,sig=<hex> where the hex is HMAC-SHA256 with your signing secret over <timestamp>.<raw body>, the exact body you POST to Rekomi, not Kit's incoming payload.
Wrong amount on commissions. Kit money fields (total, subtotal, discount) are decimal currency units, not cents. Convert with Math.round(purchase.total * 100) before sending amountCents; sending purchase.total raw under-reports the sale 100x, and non-integer values are rejected.
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
- No-code and non-Stripe checkout tracking
- crm-convertkit for subscriber syncing (separate integration)
Install on beehiiv
beehiiv has no site-wide head HTML field, so Rekomi installs via Google Tag Manager. A second GTM tag records subscriber emails as leads, and Premium Subscription sales on your connected Stripe attribute by email match.
Install on WordPress
The Rekomi plugin is the one-click path, with or without WooCommerce. WPCode stays documented as the no-plugin alternative.