Skip to content
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

Prebid Core: Only Send Optional Category Targeting Key if ACAT is Present on Page #9530

Merged
merged 4 commits into from
Feb 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/auction.js
Original file line number Diff line number Diff line change
Expand Up @@ -904,6 +904,7 @@ export function getStandardBidderSettings(mediaType, bidderCode) {
}
}
}

return standardSettings;
}

Expand Down Expand Up @@ -955,7 +956,7 @@ function setKeys(keyValues, bidderSettings, custBidObj, bidReq) {

if (
((typeof bidderSettings.suppressEmptyKeys !== 'undefined' && bidderSettings.suppressEmptyKeys === true) ||
key === CONSTANTS.TARGETING_KEYS.DEAL) && // hb_deal is suppressed automatically if not set
key === CONSTANTS.TARGETING_KEYS.DEAL || key === CONSTANTS.TARGETING_KEYS.ACAT) && // hb_deal & hb_acat are suppressed automatically if not set
(
isEmptyStr(value) ||
value === null ||
Expand Down
9 changes: 9 additions & 0 deletions test/spec/auctionmanager_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,15 @@ describe('auctionmanager.js', function () {
assert.deepEqual(response, expected);
});

it('should suppress acat if undefined', function () {
const noAcatBid = deepClone(DEFAULT_BID);
noAcatBid.meta.primaryCatId = ''
let expected = getDefaultExpected(noAcatBid);
delete expected.hb_acat;
let response = getKeyValueTargetingPairs(noAcatBid.bidderCode, noAcatBid);
assert.deepEqual(response, expected);
});

it('No bidder level configuration defined - default for video', function () {
config.setConfig({
cache: {
Expand Down