Documentation

Everything you need to integrate IKAdsCampaign with your website or application.

API Base URL
https://ikadscampaign.vercel.app/api
Authentication
Two authentication methods depending on the endpoint.
API Key

For server-side endpoints (conversion tracking, webhooks). Pass in X-API-Key header.

Get your API key at registration or from Dashboard > Integration > API Keys.

Public

For client-side endpoints (click tracking, disclosure, ad serving). No auth needed.

Rate limited by IP address.

Quick Start
Get tracking in under 60 seconds.
  1. 1Create an account at /register
  2. 2Copy your Merchant ID from the dashboard
  3. 3Add the tracking script: <script src="https://ikadscampaign.vercel.app/api/sdk/tracker.js?m=YOUR_ID"></script>
  4. 4Send visitors to your site with ?ref=AFFILIATE_CODE
  5. 5Call the conversion API from your server when a sale happens
Tracking Script
The JavaScript snippet handles everything client-side.
  1. 1Detects ?ref= parameter in the URL
  2. 2🔴 CONSENT REQUIRED FIRST. The script records nothing and stores nothing until you tell it the visitor has consented. UK cookie law (PECR reg 6) does not allow us to store or read anything on a visitor's device without their consent, and an attribution cookie is not 'strictly necessary' for anything they asked for.
  3. 3Grant it in one of two ways: set window.ikadsConsent = true before the script loads, or call IKAds.setConsent(true) when your cookie banner is accepted. A later grant replays everything that was held back, so nothing is lost by denying first — the referral code is in the URL, not only the cookie.
  4. 4If you run a TCF-compliant consent platform, or Cookiebot, we read it automatically and you need do nothing. We deliberately do NOT guess from OneTrust group IDs or from dataLayer pushes: those can be wrong, and a wrong guess sets a cookie on the device of someone who refused.
  5. 5A browser sending Global Privacy Control always wins, even if you tell us consent was given. That is the individual saying no, and your assertion is about them rather than from them.
  6. 6Then: records the click via POST /api/track/click
  7. 7Then: sets an ikads_ref cookie (30-day default)
  8. 8Renders a server-side disclosure banner at the top of the page
  9. 9Finds <div data-ikad-slot> elements and fills them with ads
  10. 10Exposes IKAds.getReferralCode() so your checkout page can read the cookie and hand it to your own server
Conversion Tracking
Server-side API call to attribute a sale.
  1. 1Read the ikads_ref cookie value from the customer's request
  2. 2POST to /api/track/conversion with your X-API-Key header
  3. 3Body: { referralCode, merchantId, saleAmount, currency, orderId }
  4. 4We no longer ask for your customer's email. The field is still accepted so existing integrations keep working, but it is discarded on arrival and never stored — we had no use for it, so we should not have been holding it.
  5. 5Commission is created automatically with your configured hold period
  6. 6Override commission (1%) is paid to the affiliate's sponsor if they have one
  7. 7RETRY ON 503 or 429. A 503 carries Retry-After and means we did not record the sale — resend it. The call is idempotent, so a resend of a sale we did record answers 409 rather than paying twice. A conversion abandoned after one 503 is a commission an affiliate never receives, for a reason neither of you will ever see.
Webhooks
Push events from your system to IKAdsCampaign.
  1. 1POST to /api/webhooks/sector with your X-API-Key header
  2. 2Refund: { event: "payment.refunded", data: { commissionId: "..." } }
  3. 3New customer: { event: "customer.created", data: { email: "...", affiliateId: "..." } }
  4. 4Spam-trap emails trigger auto-termination if detected
  5. 5All events are logged in the compliance event trail
Ad Slots
Embed sponsored ads on your pages.
  1. 1Add <div data-ikad-slot="SLOT_ID" data-ikad-sector="SECTOR"></div> to your HTML
  2. 2The tracking script fills these automatically
  3. 3Ads are server-rendered with a 'Sponsored' label
  4. 4Ethics engine prevents inappropriate ads by sector
  5. 5Frequency cap: 3 impressions/day per creative. Fatigue cap: 10/session
Compliance
How IKAdsCampaign keeps you legally safe.
  1. 1Select your operating jurisdictions in Settings > Jurisdictions
  2. 2Override depth is capped at 1 level by default (UK/Nigeria/UAE safe)
  3. 3Affiliates start in 30-day probation (own channels only)
  4. 4KYC verification gates payout eligibility
  5. 5Spam-trap detection auto-terminates bad actors
  6. 6Kill switch: one-click atomic suspension with audit trail
  7. 7Forward-withholding handles chargebacks after payout