-
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
fix two issues related to hb_uuid and hb_cache_id targeting keys #3605
Conversation
@@ -386,6 +386,10 @@ export function doCallbacksIfTimedout(auctionInstance, bidResponse) { | |||
|
|||
// Add a bid to the auction. | |||
export function addBidToAuction(auctionInstance, bidResponse) { | |||
let bidderRequests = auctionInstance.getBidRequests(); | |||
let bidderRequest = find(bidderRequests, bidderRequest => bidderRequest.bidderCode === bidResponse.bidderCode); | |||
setupBidTargeting(bidResponse, bidderRequest); |
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.
Why are we calling this function for all formats ? We need hb_uuid
and hb_cache_id
only when cache is done i.e only for video as of now. Won't it be easier if we attach after hook function to callPrebidCache
. That way these two targeting keys will only be added if we do caching.
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.
Because it's not exclusively used by the cache related keys; it sets up all the targeting for the bid object.
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.
LGTM
Type of change
NOTE This is the re-submission of #3568 (which was reverted due to a last minute code conflict that came when #3573 was merged to
master
).Description of change
This PR incorporates some fixes related to the
hb_uuid
andhb_cache_id
targeting keys.Some issues that were fixed:
due to the order in which the code was executed, the
bid.adserverTargeting.hb_uuid
andbid.adserverTargeting.hb_cache_id
fields weren't properly populated with the bid'svideoCacheKey
after it came back from Prebid Cache. This caused other functions that pulled the targeting keys (likepbjs.getAdserverTargetingForAdUnitCode()
) to be missing this information when it was otherwise expected to be there.a consequence to the above issue, when the publisher tried to overwrite the values for these keys in the
pbjs.bidderSettings
feature - the overwrites wouldn't work because thebid.videoCacheKey
wasn't populated at the time thesebidderSettings
values were used.The changes in this PR addresses the above issues through mainly moving the code around to populate the
bid.adserverTargeting
object once we know the bid is complete (ie back from prebid cache for that use-case).Note - removed the
dfpAdServerVideo
code since it's now redundant.