Skip to content

Commit

Permalink
Prebid Core: Only Send Optional Category Targeting Key if ACAT is Pre…
Browse files Browse the repository at this point in the history
…sent on Page (#9530)

* only send hb_acat if acat is present

* removed a couple unneeded files

* reverted a few more unneeded changes

* updated acat test
  • Loading branch information
jlquaccia authored Feb 28, 2023
1 parent 109d6da commit 8275dc4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/auction.js
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,7 @@ export function getStandardBidderSettings(mediaType, bidderCode) {
}
}
}

return standardSettings;
}

Expand Down Expand Up @@ -965,7 +966,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

0 comments on commit 8275dc4

Please sign in to comment.