-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dailymotion Bid Adapter: accept ortb2 field (#11366)
* Dailymotion Bid Adaptor: initial release * .md file lint issue resolved * Dailymotion Bid Adaptor: build bidder request based on param with fallbacks * Dailymotion Bid Adaptor: support video metadata * Dailymotion Bid Adaptor: add support for sending adUnitCode * Dailymotion Bid Adaptor: add support for sending startDelay * feat(LEO-528): Allow multiple IAB categories in video metadata The same way as we can have an array of IAB categories level 1 in the ORTB request, this PR introduces an array for the IAB categories level 2. To be forward compatible with level [2.2](https://github.com/InteractiveAdvertisingBureau/Taxonomies/blob/main/Content%20Taxonomies/Content%20Taxonomy%202.2.tsv) and [3.0](https://github.com/InteractiveAdvertisingBureau/Taxonomies/blob/main/Content%20Taxonomies/Content%20Taxonomy%203.0.tsv) specifications, the category IDs should be sent as strings. * Dailymotion bid adapter: Clarify the video metadata to provide in each player context * Dailymotion bid adapter: Move API key to bid params * Dailymotion bid adapter: Verify API key is string Co-authored-by: Rumesh <[email protected]> * Dailymotion bid adapter: Move API key to bid params (fix tests) * Dailymotion Bid Adaptor: add gpp support and get coppa from request * Dailymotion Bid Adaptor: fix lint error * Dailymotion Bid Adaptor: add iabcat1 and fallback to ortb2 for iabcat2 * Dailymotion Bid Adaptor: get iabcats from ortb2.site.content.data * Dailymotion Bid Adaptor: get content data from ortb2.site.content * Dailymotion Bid Adaptor: add support for iabcat1 in videoParams and document mapping of ortb2 fpd to video metadata * Dailymotion Bid Adaptor: add support for Object: App * Dailymotion Bid Adaptor: only support video adunits in context instream * Dailymotion bid adapter: Add standard ORTB video parameters Note: I changed the case of `startdelay` to be consistent with the other parameters, but it won't have any impact on current deployments as this parameter is not used onsite. * Dailymotion Bid Adaptor: add support for livestream and app * Dailymotion Bid Adaptor: drop support for non standard fields in mediaTypes.video * Dailymotion Bid Adaptor: update docs examples --------- Co-authored-by: Kevin Siow <[email protected]> Co-authored-by: Aditi Chaudhary <[email protected]> Co-authored-by: Kevin Siow <[email protected]> Co-authored-by: Rumesh <[email protected]>
- Loading branch information
1 parent
9353327
commit 14d2a0e
Showing
3 changed files
with
354 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,10 +9,11 @@ Maintainer: [email protected] | |
# Description | ||
|
||
Dailymotion prebid adapter. | ||
Supports video ad units in instream context. | ||
|
||
# Configuration options | ||
|
||
Before calling this adapter, you need to set at least the API key in the bid parameters: | ||
Before calling this adapter, you need to at least set a video adUnit in an instream context and the API key in the bid parameters: | ||
|
||
```javascript | ||
const adUnits = [ | ||
|
@@ -21,8 +22,14 @@ const adUnits = [ | |
bidder: 'dailymotion', | ||
params: { | ||
apiKey: 'fake_api_key' | ||
} | ||
}] | ||
}, | ||
}], | ||
code: 'test-ad-unit', | ||
mediaTypes: { | ||
video: { | ||
context: 'instream', | ||
}, | ||
}, | ||
} | ||
]; | ||
``` | ||
|
@@ -39,9 +46,15 @@ const adUnits = [ | |
bids: [{ | ||
bidder: 'dailymotion', | ||
params: { | ||
apiKey: 'dailymotion-testing' | ||
} | ||
}] | ||
apiKey: 'dailymotion-testing', | ||
}, | ||
}], | ||
code: 'test-ad-unit', | ||
mediaTypes: { | ||
video: { | ||
context: 'instream', | ||
}, | ||
}, | ||
} | ||
]; | ||
``` | ||
|
@@ -51,7 +64,7 @@ Please note that failing to set these will result in the adapter not bidding at | |
# Sample video AdUnit | ||
|
||
To allow better targeting, you should provide as much context about the video as possible. | ||
There are two ways of doing this depending on if you're using Dailymotion player or a third party one. | ||
There are three ways of doing this depending on if you're using Dailymotion player or a third party one. | ||
|
||
If you are using the Dailymotion player, you should only provide the video `xid` in your ad unit, example: | ||
|
||
|
@@ -61,17 +74,20 @@ const adUnits = [ | |
bids: [{ | ||
bidder: 'dailymotion', | ||
params: { | ||
apiKey: 'dailymotion-testing' | ||
apiKey: 'dailymotion-testing', | ||
video: { | ||
xid: 'x123456' // Dailymotion infrastructure unique video ID | ||
}, | ||
} | ||
}], | ||
code: 'test-ad-unit', | ||
mediaTypes: { | ||
video: { | ||
api: [2, 7], | ||
context: 'instream', | ||
playerSize: [ [1280, 720] ], | ||
startDelay: 0, | ||
xid: 'x123456' // Dailymotion infrastructure unique video ID | ||
startdelay: 0, | ||
w: 1280, | ||
h: 720, | ||
}, | ||
} | ||
} | ||
|
@@ -91,7 +107,17 @@ const adUnits = [ | |
params: { | ||
apiKey: 'dailymotion-testing', | ||
video: { | ||
description: 'overriden video description' | ||
description: 'this is a video description', | ||
duration: 556, | ||
iabcat1: ['IAB-2'], | ||
iabcat2: ['6', '17'], | ||
id: '54321', | ||
lang: 'FR', | ||
livestream: 0, | ||
private: false, | ||
tags: 'tag_1,tag_2,tag_3', | ||
title: 'test video', | ||
topics: 'topic_1, topic_2', | ||
} | ||
} | ||
}], | ||
|
@@ -100,37 +126,42 @@ const adUnits = [ | |
video: { | ||
api: [2, 7], | ||
context: 'instream', | ||
description: 'this is a video description', | ||
duration: 556, | ||
iabcat2: ['6', '17'], | ||
id: '54321', | ||
lang: 'FR', | ||
playerSize: [ [1280, 720] ], | ||
private: false, | ||
startDelay: 0, | ||
tags: 'tag_1,tag_2,tag_3', | ||
title: 'test video', | ||
topics: 'topic_1, topic_2', | ||
startdelay: 0, | ||
w: 1280, | ||
h: 720, | ||
}, | ||
} | ||
} | ||
]; | ||
``` | ||
|
||
Each of the following video metadata fields can be added in mediaTypes.video or bids.params.video. | ||
If a field exists in both places, it will be overridden by bids.params.video. | ||
Each of the following video metadata fields can be added in bids.params.video. | ||
|
||
* `description` - Video description | ||
* `duration` - Video duration in seconds | ||
* `iabcat2` - List of IAB category IDs from the [2.0 taxonomy](https://github.com/InteractiveAdvertisingBureau/Taxonomies/blob/main/Content%20Taxonomies/Content%20Taxonomy%202.0.tsv) | ||
* `iabcat1` - List of IAB category IDs from the [1.0 taxonomy](https://github.com/InteractiveAdvertisingBureau/Taxonomies/blob/main/Content%20Taxonomies/Content%20Taxonomy%201.0.tsv) | ||
* `iabcat2` - List of IAB category IDs from the [2.0 taxonomy](https://github.com/InteractiveAdvertisingBureau/Taxonomies/blob/main/Content%20Taxonomies/Content%20Taxonomy%202.0.tsv) and above | ||
* `id` - Video unique ID in host video infrastructure | ||
* `lang` - ISO 639-1 code for main language used in the video | ||
* `livestream` - 0 = not live, 1 = content is live | ||
* `private` - True if video is not publicly available | ||
* `tags` - Tags for the video, comma separated | ||
* `title` - Video title | ||
* `topics` - Main topics for the video, comma separated | ||
* `xid` - Dailymotion video identifier (only applicable if using the Dailymotion player) | ||
|
||
If you already specify [First-Party data](https://docs.prebid.org/features/firstPartyData.html) through the `ortb2` object when calling [`pbjs.requestBids(requestObj)`](https://docs.prebid.org/dev-docs/publisher-api-reference/requestBids.html), we will fallback to those values when possible. See the mapping below. | ||
|
||
| From ortb2 | Metadata fields | | ||
|---------------------------------------------------------------------------------|-----------------| | ||
| `ortb2.site.content.cat` OR `ortb2.site.content.data` where `ext.segtax` is `4` | `iabcat1` | | ||
| `ortb2.site.content.data` where `ext.segtax` is `5`, `6` or `7` | `iabcat2` | | ||
| `ortb2.site.content.id` | `id` | | ||
| `ortb2.site.content.language` | `lang` | | ||
| `ortb2.site.content.livestream` | `livestream` | | ||
| `ortb2.site.content.keywords` | `tags` | | ||
| `ortb2.site.content.title` | `title` | | ||
|
||
# Integrating the adapter | ||
|
||
To use the adapter with any non-test request, you first need to ask an API key from Dailymotion. Please contact us through **[email protected]**. | ||
|
Oops, something went wrong.