Revenue Integration Guide
For JS tag vendors integrating with the DigiKube bidder
Overview
DigiKube's bidder serves your JS tag template as the ad creative via OpenRTB. When the bidder wins an auction, your tag is returned with macros substituted (bid ID, subid, etc.). Your ad server should fire postback pixels at key events so DigiKube can optimize bids based on real revenue data.
How It Works
SSP sends bid request
DigiKube evaluates active campaigns against request attributes
DigiKube wins the auction
Ad markup with your JS tag template is returned to the exchange
Your tag loads on publisher page
Template macros are substituted with auction values (bid ID, subid, etc.)
User sees ad — impression postback fires
Your server sends GET to /pb/imp with estimated revenue value
User clicks — click postback fires
Your server sends GET to /pb/click with RPC value
Conversion happens — conversion postback fires
Your server sends GET to /pb/conv with CPA value
DigiKube computes eCPM and adjusts bids
Postback data is aggregated per subid to calibrate future bid prices
(Optional) Hourly revenue report pulled for calibration
DigiKube polls your report endpoint to reconcile approved vs estimated revenue
HTML Template & Macros
Your HTML template will be loaded like:
<script src="https://your-server.com/widget.js"></script>
<script>window.init({subid: 'camp001__US__mobile', bid: 'bid-abc123-imp1'});</script>Available macros (configured per campaign in the creative):
| Macro | Description | Example |
|---|---|---|
| ${AUCTION_ID} | SSP auction identifier | abc123 |
| ${BID_ID} | DigiKube bid identifier | bid-abc123-imp1 |
| ${CAMPAIGN_ID} | Campaign ID | 69b6bd32... |
| ${DEVICE_TYPE} | Resolved device type | mobile, tablet, desktop |
| ${GEO_COUNTRY} | User's country code | US, GB, DE |
| ${SUBID} | Auto-built dimension string | campId__US__mobile |
| ${AUCTION_IMP_ID} | Impression identifier | imp1 |
| ${CREATIVE_ID} | Creative ID | cr-001 |
| ${SSP_ID} | SSP endpoint identifier | 0cd5d3d0e217 |
| ${BID_PRICE} | Bid price CPM | 2.50 |
| ${SITE_DOMAIN} | Publisher domain | example.com |
| ${SITE_DOMAIN_ENC} | Publisher domain (URL-encoded) | example.com |
| ${DEVICE_IP} | Device IP address | 203.0.113.1 |
| ${DEVICE_UA} | User agent string | Mozilla/5.0... |
| ${DEVICE_UA_ENC} | User agent (URL-encoded) | Mozilla%2F5.0... |
| ${PAGE_URL} | Full page URL | https://example.com/page |
| ${PAGE_URL_ENC} | Full page URL (URL-encoded) | https%3A%2F%2Fexample.com%2Fpage |
| ${AUCTION_ID_ENC} | Auction ID (URL-encoded) | auc-abc123 |
| ${USER_ID} | User identifier | user-123 |
| ${TIMESTAMP} | Unix timestamp | 1773583556 |
| ${RANDOM} | Cache buster | 482917 |
Two template syntaxes: $${MACRO} for bid-time context (used in HTML templates and content field values). {{field}} for structured content fields (used in SSP output templates).
Click Redirect Tracking
DigiKube can wrap creative click URLs through a server-side redirect for accurate first-party click counting. Configure the mode per campaign under Tracking → Click Tracking.
Click Tracking Modes
| Mode | Description |
|---|---|
| none | No click tracking. Click URL passed through as-is. |
| redirect | Click URL is wrapped through our /click endpoint. Server records a click event before forwarding the user. This is the source of truth for click counts. |
| vendor | Click tracking is handled by vendor postbacks (/pb/click). Vendor-fired postbacks are promoted to the source of truth for click attribution. |
Click Redirect Endpoint
When redirect mode is active, click URLs are automatically wrapped at bid time. The endpoint:
GET https://rtb.dkadx.com/click?b={bid_id}&url={encoded_destination_url}| Param | Required | Description |
|---|---|---|
| b | Yes | Bid ID — used to record the click event and attribute to the campaign |
| url | Yes | URL-encoded destination URL — user is forwarded here after click is recorded |
The ${CLICK_URL} Macro
Use the ${CLICK_URL} macro in your HTML template to reference the creative's click URL. When the campaign's click tracking mode is redirect, this macro is automatically substituted with the wrapped redirect URL. Otherwise it resolves to the raw destination URL.
Example creative template:
<a href="${CLICK_URL}">
<img src="https://cdn.example.com/banner.jpg">
</a>Set the click URL in the creative settings. S2S campaigns: click URLs extracted from vendor responses are automatically wrapped when redirect mode is active — no template changes needed.
Postback Pixels
Fire these HTTP GET requests from your ad server (server-side). All endpoints return a 1x1 transparent GIF.
Fire on ad load (when your tag renders). Use an estimated revenue-per-click or eCPM value.
https://rtb.dkadx.com/pb/imp?b={bid_id}&v={estimated_rpc}Fire on user click. Use your measured revenue-per-click value.
https://rtb.dkadx.com/pb/click?b={bid_id}&v={rpc_value}Fire on conversion (lead, install, purchase). Use your CPA value. Optional ts param for late conversions.
https://rtb.dkadx.com/pb/conv?b={bid_id}&v={cpa_value}&ts={iso8601}Parameters
| Param | Required | Description |
|---|---|---|
| b | Yes | The bid ID — passed via ${BID_ID} macro in your tag |
| v | Yes | Revenue value in USD (e.g., 0.50 for $0.50 RPC) |
| ts | No | Conversion timestamp (ISO 8601) — for late conversions only, /pb/conv endpoint |
SubID Format
The subid parameter encodes campaign dimensions for revenue reporting and bid optimization.
Format
{campaign_id}__{dim1}__{dim2}
Delimiter
__ (double underscore)
Order
Campaign ID always first
Examples:
69b6bd3269b6bd32__US69b6bd32__US__mobileRevenue Reports (Optional Calibration)
For maximum bid accuracy, configure a daily report endpoint per campaign. DigiKube polls your endpoint daily with ?date=YYYYMMDD and calibrates its eCPM model with final approved revenue figures.
Expected response format (JSON array):
[
{
"subid": "69b6bd32__US__mobile",
"revenue": 150.00,
"clicks": 200,
"impressions": 50000,
"date": "2026-03-16"
}
]Configure the report URL in the campaign settings. DigiKube reconciles approved revenue against postback estimates and adjusts bid shading accordingly.
Partner Stats API
Supply partners can query stats about their traffic via a dedicated API endpoint. Authentication uses the SSP endpoint_id as the API key.
GET https://stats.dkadx.com/api/stats?key={endpoint_id}&startDate=YYYY-MM-DD&endDate=YYYY-MM-DD&breakdown=DATE&metrics=BID_REQUESTS,BIDS,WINS,IMPRESSIONS,GROSS_REVENUEAvailable Metrics:
| Metric | Description |
|---|---|
| BID_REQUESTS | Total bid requests received from this SSP |
| BIDS | Bid responses sent back |
| WINS | Auctions won |
| IMPRESSIONS | Confirmed ad renders |
| GROSS_REVENUE | Total revenue (sum of win prices) |
| AVG_BID_PRICE | Average bid CPM |
| WIN_RATE | Wins / Bids ratio |
Breakdown options: DATE (daily) or HOUR (hourly). Max date range: 31 days. Auth via query param key= or header Authorization: Bearer.
Native Ads
Structured creatives can serve both banner and native formats. The SSP defines output templates that render creative content into the required format. Templates use {{field}} for content fields and ${MACRO} for bid-time context.
Structured Content Fields
| Field | Required | Description |
|---|---|---|
| {{title}} | Yes | Ad headline |
| {{description}} | No | Body text |
| {{image_url}} | No | Main image URL |
| {{icon_url}} | No | Small icon/logo URL |
| {{click_url}} | Yes | Landing page (supports ${MACRO} substitution) |
| {{sponsored_by}} | No | Advertiser name |
| {{cta}} | No | Call to action text (e.g., "Shop Now") |
SSP Output Template Examples
Example 1: Simple native (title + click)
{"native":{"ver":"1.1","link":{"url":"{{click_url}}"},"assets":[{"id":1,"title":{"text":"{{title}}"}}]}}Example 2: Full native (title + image + description + sponsored)
{"native":{"ver":"1.1","link":{"url":"{{click_url}}"},"assets":[{"id":1,"title":{"text":"{{title}}"}},{"id":2,"img":{"url":"{{image_url}}","w":300,"h":250}},{"id":3,"data":{"type":2,"value":"{{description}}"}},{"id":4,"data":{"type":1,"value":"{{sponsored_by}}"}}],"eventtrackers":[{"event":1,"method":1,"url":"https://your-tracker.com/imp?id=${BID_ID}"}]}}Example 3: Banner from structured content
<div style="width:300px;height:250px;position:relative">
<a href="{{click_url}}" target="_blank">
<img src="{{image_url}}" width="300" height="250">
<div style="position:absolute;bottom:0;background:rgba(0,0,0,0.7);color:#fff;padding:8px;width:100%;box-sizing:border-box">
<strong>{{title}}</strong><br>
<small>{{sponsored_by}} · {{cta}}</small>
</div>
</a>
</div>Note: For native ads, impression tracking must use burl (server-side), not ADM pixel (cannot append HTML to JSON). Configure this in the SSP settings.
Testing Your Integration
Verify postbacks are received
Use the Postback Log page in the dashboard to confirm events arrive and are attributed correctly.
Fire a test postback with curl
curl "https://rtb.dkadx.com/pb/click?b=test-bid-001&v=0.50"
Confirm event appears in the log
Events should appear in the Postback Log within 60 seconds of being fired.