Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(LEO-528): Allow multiple IAB categories level 2 in video metadata #10

Merged
merged 1 commit into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, I created dailymotion-oss/prebid.github.io#5 for this


# 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