fix hb_cache_id for adpod bids #3617
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
In the
adpod
module, we're now populating thebid.videoCacheKey
property in the bid object to ensure thehb_cache_id
targeting key value is setup properly.Also updated/added some unit tests to properly reflect the change of logic in the standard keys generated for video bids.
Context for the change
When #3528 was merged, it introduced a change that made the two targeting cache keys
hb_uuid
andhb_cache_id
to be considered part of the standard set of adserver targeting keys (for video bids). The values for these keys were populated by reading thebid.videoCacheKey
.With the adpod logic, we were generating our own key values for the
hb_cache_id
key - but we were not populating thebid.videoCacheKey
(since there's different logic used for adpod bids when they're passed to the adserver and we assumed at the time it wasn't needed for the bid).As a result of the above - when the logic here ran, it overwrote the bid's
adserverTargeting.hb_cache_id
with anundefined
because of the missingbid.videoCacheKey
.The fix addresses the problem by populating the expected field in the bid when it's processed by the adpod module.
A note related to this line of code - we're keeping this value here as a backup in the case the publisher sets the
pbjs.bidderSettings.standard
property and doesn't setup the overwrite for thehb_cache_id
key.