Data Attributes
Configure ad slots using HTML data attributes. All slot behavior is controlled entirely through attributes — no JavaScript required.
Required attributes
Every slot element must have these four attributes. A slot with a missing or invalid required attribute is silently skipped — it won't render and won't throw an error.
| Attribute | Type | Description |
|---|---|---|
| data-adkit-site | string | Your Adkit site ID from the publisher dashboard |
| data-adkit-slot | string | Unique placement name. Must match /^[a-zA-Z0-9_-]+$/ — alphanumeric, hyphens, and underscores only. |
| data-adkit-aspect-ratio | string | One of: "16:9" "4:3" "1:1" "9:16" "banner" |
| data-adkit-price | integer string | Daily rate in cents — non-negative integer. "2500" = $25/day. |
Price is in cents
"2500" = $25.00/day. The server validates and enforces the price at checkout — it cannot be manipulated client-side.Optional attributes
| Attribute | Type | Default | Description |
|---|---|---|---|
| data-adkit-size | "sm" | "md" | "lg" | "lg" | Text size preset for placeholder label and CTA |
| data-adkit-theme | "light" | "dark" | "auto" | "auto" | Color theme. "auto" follows the system prefers-color-scheme. |
| data-adkit-silent | "true" | — | Disable all event tracking for this slot |
| data-adkit-bg-color | CSS color | transparent | Placeholder background fill color |
| data-adkit-text-color-primary | CSS color | theme-based | Price text color |
| data-adkit-text-color-secondary | CSS color | theme-based | Label and CTA text color |
| data-adkit-border-color | CSS color | theme-based | Dashed border color (applied at 40%/60% opacity for normal/hover) |
Aspect ratio values
| Value | CSS ratio | Typical use |
|---|---|---|
| "16:9" | 16 / 9 | In-content video-format placements |
| "4:3" | 4 / 3 | Sidebar boxes |
| "1:1" | 1 / 1 | Square placements |
| "9:16" | 9 / 16 | Vertical / story-format placements |
| "banner" | 728 / 90 | Horizontal leaderboard (header / footer) |
Full example
Slot naming rules
Slot names must match /^[a-zA-Z0-9_-]+$/. Slots with invalid names are silently skipped.
A slot identity is siteId:slot. If the same identity appears twice on a page, the second instance is skipped and a slot_duplicate event is sent.
Recommended patterns:
sidebarheader-bannerin-content-1footer-leaderboard