Skip to content

Commit

Permalink
Merge pull request #10 from dailymotion-oss/LEO-528_multiple_iabcat2
Browse files Browse the repository at this point in the history
feat(LEO-528): Allow multiple IAB categories level 2 in video metadata
  • Loading branch information
sebmil-daily authored Mar 20, 2024
2 parents 9a97052 + 3092928 commit 4b78d35
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
2 changes: 1 addition & 1 deletion modules/dailymotionBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function getVideoMetadata(bidRequest) {
const videoMetadata = {
description: videoParams.description || '',
duration: videoParams.duration || 0,
iabcat2: videoParams.iabcat2 || '',
iabcat2: Array.isArray(videoParams.iabcat2) ? videoParams.iabcat2 : [],
id: videoParams.id || '',
lang: videoParams.lang || '',
private: videoParams.private || false,
Expand Down
8 changes: 4 additions & 4 deletions modules/dailymotionBidAdapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const adUnits = [
api: [2,7],
description: 'this is a video description',
duration: 556,
iabcat2: 'test_cat',
iabcat2: ['6', '17'],
id: '54321',
lang: 'FR',
private: false,
Expand All @@ -75,7 +75,7 @@ const adUnits = [
video: {
description: 'this is a test video description',
duration: 330,
iabcat2: 'test_cat',
iabcat2: ['6', '17'],
id: '54321',
lang: 'FR',
private: false,
Expand All @@ -94,14 +94,14 @@ Following video metadata fields can be added in mediaTypes.video or bids.params.

* `description` - Video description
* `duration` - Video duration in seconds
* `iabcat2` - Video IAB category
* `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)
* `id` - Video unique ID in host video infrastructure
* `lang` - ISO 639-1 code for main language used in the video
* `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) and allows better targeting
* `xid` - Dailymotion video identifier (only applicable if using the Dailymotion player), allows better targeting

# Integrating the adapter

Expand Down
15 changes: 14 additions & 1 deletion test/spec/modules/dailymotionBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe('dailymotionBidAdapterTests', () => {
api: [2, 7],
description: 'this is a test video',
duration: 300,
iabcat2: 'test_cat',
iabcat2: ['6', '17'],
lang: 'ENG',
startdelay: 0,
},
Expand Down Expand Up @@ -153,6 +153,19 @@ describe('dailymotionBidAdapterTests', () => {
},
sizes: [],
});

expect(reqData.video_metadata).to.eql({
description: '',
duration: 0,
iabcat2: [],
id: '',
lang: '',
private: false,
tags: '',
title: '',
topics: '',
xid: '',
});
});

it('validates buildRequests - with empty/undefined validBidRequests', () => {
Expand Down

0 comments on commit 4b78d35

Please sign in to comment.