fix several issues in appnexus video bids #4154
Merged
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.
Type of change
Description of change
This PR addresses several issues that were present in how video bids were generated in the
appnexusBidAdapter
(and in cases when anyappnexus
alias was used, as reported under #3364 ).Below is a short summary of the issues:
For outstream bids, the appnexus bidder did not properly populate the typical
bid.vastXml
orbid.vastUrl
fields.The bidder was coded to only look for the
asset_url
value in the raw bid response, but this value is only used byinstream
oradpod
type bids. For outstream bids, the ad server returns vast XML code (via thertbBid.rtb.video.content
property) and should be set to thebid.vastXml
field.Fix: Added logic to look at the proper fields given the
context
used in the video bid object.When publishers have the
renderer
defined in an adUnit, they may have cases where the placement in the appnexus adserver is not automatically configured to return a renderer asset.Due to some logic used in the bidder (i.e. it assumed it had an outstream bid only if the
renderer_url
was present in the raw bid response from the AN adserver), this prevented some extra video bid information from being attached to the bid object (iebid.adResponse
).This lack of data in the bid in turn hindered the bid from rendering with the adUnit's renderer when the above use-case was used.
Fix: Updated the logic we use to consider what is an outstream bid and moved some logic around so proper values are set for outstream bids.
When looking for the
renderer_options
for outstream bids, it was hard-coded to always look at the first bid in thebidderRequest
object. When there are multiple bids of the same bidder, the desired video bid that should be referenced isn't always going to be first in the list.Fix: Updated the logic to find the correct bid in the
bidderRequest
object and use that to read therenderer_options
if they're defined.Other information
Fixes #3364
Fixes #4025