-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
add vastUrl + media type for video bids Prebid Server #1739
Merged
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ import { STATUS, S2S } from 'src/constants'; | |
import { cookieSet } from 'src/cookie.js'; | ||
import adaptermanager from 'src/adaptermanager'; | ||
import { config } from 'src/config'; | ||
import { VIDEO } from 'src/mediaTypes'; | ||
|
||
const getConfig = config.getConfig; | ||
|
||
|
@@ -111,7 +112,9 @@ function PrebidServer() { | |
if (videoMediaType) { | ||
// pbs expects a ad_unit.video attribute if the imp is video | ||
adUnit.video = Object.assign({}, videoMediaType); | ||
delete adUnit.mediaTypes.video; | ||
delete adUnit.mediaTypes; | ||
// default is assumed to be 'banner' so if there is a video type we assume video only until PBS can support multi format auction. | ||
adUnit.media_types = ['video']; | ||
} | ||
}) | ||
convertTypes(adUnits); | ||
|
@@ -196,10 +199,26 @@ function PrebidServer() { | |
bidObject.creative_id = bidObj.creative_id; | ||
bidObject.bidderCode = bidObj.bidder; | ||
bidObject.cpm = cpm; | ||
bidObject.ad = bidObj.adm; | ||
if (bidObj.nurl) { | ||
bidObject.ad += utils.createTrackPixelHtml(decodeURIComponent(bidObj.nurl)); | ||
// From ORTB see section 4.2.3: adm Optional means of conveying ad markup in case the bid wins; supersedes the win notice if markup is included in both. | ||
if (bidObj.media_type === VIDEO) { | ||
bidObject.mediaType = VIDEO; | ||
if (bidObj.adm) { | ||
bidObject.vastXml = bidObj.adm; | ||
} | ||
if (bidObj.nurl) { | ||
bidObject.vastUrl = bidObj.nurl; | ||
} | ||
} else { | ||
if (bidObj.adm && bidObj.nurl) { | ||
bidObject.ad = bidObj.adm; | ||
bidObject.ad += utils.createTrackPixelHtml(decodeURIComponent(bidObj.nurl)); | ||
} else if (bidObj.adm) { | ||
bidObject.ad = bidObj.adm; | ||
} else if (bidObj.nurl) { | ||
bidObject.adUrl = bidObj.nurl | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like these should be the other way around. From the spec,
(see section 4.2.3) |
||
} | ||
|
||
bidObject.width = bidObj.width; | ||
bidObject.height = bidObj.height; | ||
bidObject.adserverTargeting = bidObj.ad_server_targeting; | ||
|
@@ -223,7 +242,6 @@ function PrebidServer() { | |
bidObject.source = TYPE; | ||
bidObject.adUnitCode = bidRequest.placementCode; | ||
bidObject.bidderCode = bidRequest.bidder; | ||
|
||
bidmanager.addBidResponse(bidObject.adUnitCode, bidObject); | ||
}); | ||
}); | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to use the
VIDEO
constant here too?