Skip to content

fix hb_cache_id for adpod bids #3617

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

Merged
merged 1 commit into from
Mar 6, 2019
Merged

Conversation

jsnellbaker
Copy link
Collaborator

Type of change

  • Bugfix

Description of change

In the adpod module, we're now populating the bid.videoCacheKey property in the bid object to ensure the hb_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 and hb_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 the bid.videoCacheKey.

With the adpod logic, we were generating our own key values for the hb_cache_id key - but we were not populating the bid.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 an undefined because of the missing bid.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 the hb_cache_id key.

Copy link
Member

@mkendall07 mkendall07 left a comment

Choose a reason for hiding this comment

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

LGTM. Do we need to add a unit test to the adpod.spec ?

@jsnellbaker
Copy link
Collaborator Author

I updated the adpod unit test to also check the presence of the bid.videoCacheKey when it's reviewing the processed bids.

@mkendall07
Copy link
Member

Oops missed it. Thanks! 👍

@jaiminpanchal27
Copy link
Collaborator

LGTM. Verified on demo page.

@jaiminpanchal27 jaiminpanchal27 merged commit 5a67d89 into master Mar 6, 2019
@jsnellbaker jsnellbaker deleted the fix_adpod_targeting branch March 18, 2019 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants