Event Tracking
Adkit tracks four events for every ad slot. These events power the analytics dashboard, fill rate calculations, and inactivity detection.
The four events
| Event | When it fires | Tracked by |
|---|---|---|
| slot_mount | Every time the slot component mounts | React SDK and JS SDK |
| slot_view | When 50% of the slot is visible in the viewport | IntersectionObserver |
| slot_click | When a visitor clicks the ad | Click handler |
| slot_duplicate | When the same slot appears more than once on a page | Deduplication logic |
slot_mount
Fires on every page load where the slot is rendered. This event is used to detect that the slot is still active on the publisher's site. If no slot_mount is received for 2 hours, the slot is marked inactive.
The slot_mount event also carries the current price from the publisher's implementation. This price is stored as a loading hint — after the API responds with the server-authoritative price, the loading hint is discarded and never used for billing.
slot_view
Fires once when the slot enters the viewport with at least 50% visibility, using the browser's IntersectionObserver API. This is counted as an impression in analytics. The event fires once per page load — if the slot scrolls out of view and back in, it does not fire again.
slot_click
Fires when a visitor clicks the ad creative. The click opens the destination URL in the same tab. The event is sent to the Events API before the navigation occurs.
slot_duplicate
Fires when the SDK detects that the same slot name is mounted more than once on a single page. This is a developer warning — it doesn't affect analytics or billing, but it indicates a configuration error. Only one instance of each slot should be present on a page.
slot_duplicate event in your analytics, check that you haven't included the same slot name more than once on a single page render.How events are sent
The React SDK uses navigator.sendBeacon to send events, falling back to fetch with keepalive: true if sendBeacon is not available.
The JavaScript CDN SDK uses fetch with keepalive: true.
Both SDKs send events to:
Event payload
Each event includes the slot identity (siteId:slotName), the event type, and metadata such as the visitor's page URL, referrer, screen dimensions, and device type. Device type is inferred from the user agent string.
Analytics aggregation
Events are aggregated into daily stats by a background job. The analytics dashboard reads from these aggregated stats for historical data, and supplements with live events from the current day for real-time accuracy.
Metrics derived from events
| Metric | Derivation |
|---|---|
| Impressions | Count of slot_view events |
| Clicks | Count of slot_click events |
| CTR | clicks ÷ impressions |
| Fill rate | Views with an active booking ÷ total slot_view events |
| RPM | (revenue ÷ impressions) × 1,000 |