The SDK exposes two callbacks. Pick whichever you need.Documentation Index
Fetch the complete documentation index at: https://docs.kontext.so/llms.txt
Use this file to discover all available pages before exploring further.
onEvent — public ad lifecycle
onEvent fires for the small set of public ad-lifecycle events: ad.filled, ad.no-fill, ad.viewed, ad.clicked, ad.error, plus the video and reward events. These are the ones you typically wire your UI and analytics to.
The complete list with payloads lives on Ad lifecycle events.
onDebugEvent — detailed internal log
onDebugEvent fires for every internal step the SDK takes — preload requests starting and resolving, message-id pairing decisions, retry attempts, iframe loading milestones, and so on. It is verbose and not stable across SDK versions; treat it as a diagnostic log, not an API.
Wire it up only while you’re investigating something, then turn it back off in production:
When something looks off
If an ad doesn’t appear, fires the wrong event, or the SDK behaves unexpectedly:- Re-enable
onDebugEventin your build. - Reproduce the issue.
- Capture the full
onDebugEventoutput and share it with us at support@kontext.so.
skipCode reference
When an ad.no-fill event fires, its payload carries a skipCode explaining why no ad was returned. The values you might see:
skipCode | Meaning | What to do |
|---|---|---|
ads_disabled | Ads are disabled for this publisher account or session. | Check your account status; contact support if unexpected. |
ad_skipped | The server intentionally skipped this turn — typically because of pacing. | Expected; the next eligible turn will show an ad. |
ivt_blocked | An invalid-traffic check blocked the request. | Real users shouldn’t see this. If recurring in production, contact support. |
unfilled_bid | The auction ran but no bidder returned a usable ad. | Expected occasionally — fill rate is never 100%. |
session_disabled | The server disabled the session — most often geo-restriction, but can also be an account-level block or other server-side condition. | Verify the user’s region is supported; if it should be, contact support. |
illegal_content | The conversation content was flagged as unsafe for ads. | Review the message text — some categories don’t get ads. |
unknown | Catch-all for reasons we don’t yet expose individually. | Capture the onDebugEvent output and send it to support. |