Mediakeys
Features
Bidder Code | mediakeys | Prebid.org Member | no |
---|---|---|---|
Media Types | display, video, native | GDPR TCF Support | yes |
User IDs | all | USP/CCPA Support | yes |
Supply Chain Support | yes | COPPA Support | yes |
Demand Chain Support | no | Safeframes OK | yes |
Supports Deals | check with bidder | Prebid.js Adapter | yes |
IAB GVL ID | 498 | Prebid Server Adapter | no |
Floors Module Support | yes | First Party Data Support | yes |
"Send All Bids" Ad Server Keys
These are the bidder-specific keys that would be targeted within GAM in a Send-All-Bids scenario. GAM truncates keys to 20 characters.hb_pb_mediakeys |
hb_bidder_mediakeys |
hb_adid_mediakeys |
hb_size_mediakeys |
hb_source_mediakeys |
hb_format_mediakeys |
hb_cache_host_mediak |
hb_cache_id_mediakey |
hb_uuid_mediakeys |
hb_cache_path_mediak |
hb_deal_mediakeys |
Table of Contents
Important Notice
The Mediakeys Bidding adapter requires setup before beginning and will respond with bids for whitelisted domains only.
Please contact us at prebidjs@mediakeys.com.
Bid Params
Name | Scope | Description | Example | Type |
---|---|---|---|---|
context |
required for native | Native context | 1 |
integer |
plcmttype |
required for native | Native placement type | 2 |
integer |
MediaType Banner
The Mediakeys adapter accepts any valid OpenRTB Spec 2.5 property.
Example Ad Unit:
const adUnits = [{
code: 'banner-1',
mediaTypes: {
banner: {
sizes: [[300, 250],[300, 600]],
}
},
bids: [{
bidder: 'mediakeys',
params: {} // no params required.
}]
}];
MediaType Video
The Mediakeys adapter accepts any valid OpenRTB Spec 2.5 video property.
Properties can be defined at the adUnit mediaTypes.video
or bid[].params
level.
Please refer to the following table to find acceptable values for mediakeys bidder:
Name | Scope | Description | Example | Type |
---|---|---|---|---|
context | required | instream or outstream | “outstream” | string |
playerSize (*) | required | width, height of the player in pixels | [640,360] translated to w and h in bid request |
array<integers> |
mimes | recommended | Content MIME types supported | [“video/x-ms-wmv”, “video/mp4”] default: [“video/mp4”] |
array<string> |
protocols | recommended | Array of supported video protocols: 2: VAST 2.0 3: VAST 3.0 |
[2,3] default: [3] |
array<integers> |
maxduration | recommended | Maximum video ad duration in seconds. | 30 default: not set |
integer |
skip | recommended | Indicates if the player will allow the video to be skipped, where 0 = no, 1 = yes. | 1 default: 0 |
integer |
(*) Mediakeys bidder will adapt the bid response to send the video format closest to the playerSize
(from an aspect ratio point of view). To maximize the responses, please consider requesting formats like:
- small video:
360x268
(minimal bandwidth, low quality) - medium video:
640x360
(low bandwidth, medium quality) - standard video:
640×480
(medium bandwidth, good quality) - full wide video:
854×480
(high bandwidth, superior quality) - HD video:
1280x720
(miximum bandwidth, best quality)
Instream video
For Instream Video, you have to enable the Instream Tracking Module to have Prebid emit the onBidWon
required event.
Required Prebid configuration:
a. Enable the instream tracking module and whitelist mediakeys Vast server url.
pbjs.que.push(function () {
pbjs.setConfig({
instreamTracking: {
// enable the `bidWon` event required by mediakeys
enabled: true,
// enable mediakeys vast server to have Prebid emit the `bidWon` event
urlPattern: /mediakeys\.io/
}
});
});
b. Do not mark the bid as “used” as it could prevent emitting the bidWon
event.
pbjs.que.push(function () {
pbjs.addAdUnits(adUnits);
pbjs.requestBids({
timeout: 1000,
bidsBackHandler: function (bids) {
const highestCpmBids = pbjs.getHighestCpmBids('video1');
if (highestCpmBids.length > 0) {
// !! DO NOT use this !!
// pbjs.markWinningBidAsUsed({
// adUnitCode: adUnits[0].code
// });
invokeVideoPlayer(highestCpmBids[0].vastUrl);
}
}
});
});
Example Ad Unit:
const adUnits = [{
code: 'video1',
mediaTypes: {
video: {
context: 'instream',
playerSize: [854, 480],
// additional OpenRTB video params
// placement: 2,
// ...
mimes: ['video/mp4'],
protocols: [2, 3],
skip: 1
}
},
bids: [{
bidder: 'mediakeys',
params: {
video: {
// additional OpenRTB video params
// will be merged with params defined at mediaTypes level
api: [1]
}
}
}]
}];
Outstream video
Required Prebid configuration:
You must set up your preferred outstream renderer in the ad unit and use the following example code to fetch the
vast xml
document from mediakeys ad-server.
Example Ad Unit:
const adUnits = [{
code: 'video1',
mediaTypes: {
video: {
context: 'outstream',
playerSize: [1280, 720],
// additional OpenRTB video params
// placement: 2,
// ...
mimes: ['video/mp4'],
protocols: [2, 3],
skip: 0
}
},
// this renderer is required for outstream video mediatype
renderer: {
url: 'https://acdn.adnxs.com/video/outstream/ANOutstreamVideo.js',
// the render method must fetch the vast xml document before displaying video
render: function (bid) {
var adResponse = fetch(bid.vastUrl).then(resp => resp.text()).then(text => ({
ad: {
video: {
content: text,
player_height: bid.playerHeight,
player_width: bid.playerWidth
}
}
}))
adResponse.then((content) => {
bid.renderer.push(() => {
ANOutstreamVideo.renderAd({
targetId: bid.adUnitCode,
adResponse: content
});
});
})
}
},
bids: [{
bidder: 'mediakeys',
params: {
placementId: 13232385,
video: {
// additional OpenRTB video params
// will be merged with params defined at mediaTypes level
api: [1]
}
}
}]
}];
MediaType Native
The Mediakeys adapter accepts any valid OpenRTB Native Ads Specification native property.
Please refer to Prebid native ad unit documentation, and the following table to see required and recommended parameters.
Name | Scope | Description | Example | Type |
---|---|---|---|---|
context | required | The context in which the ad appears | 1 |
integer |
plcmttype | recommended | The design/format/layout of the ad unit being offered | 1 |
integer |
Required Prebid configuration:
Refer to Prebid documentation to use your preferred method for native ad template rendering.
Example Ad Unit:
This example uses the external javascript file rendering method.
const adUnits = [{
code: 'native-1',
sizes: [360, 360],
mediaTypes: {
native: {
rendererUrl: 'https://example.com/nativeRender.js',
body: {
required: true
},
title: {
required: true,
len: 120
},
sponsoredBy: {
required: true
},
icon: {
required: true,
sizes: [180, 180]
},
image: {
required: true,
sizes: [300, 250]
}
}
},
bids: [{
bidder: 'mediakeys',
native: {
context: 1,
plcmttype: 1,
}
}]
}];