Skip to content

Commit

Permalink
fix(permutiveRtd): remove bidder specific logic for keywords
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonioGargaro committed Mar 8, 2023
1 parent 77eb7ed commit 4adff93
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 25 deletions.
16 changes: 1 addition & 15 deletions modules/permutiveRtdProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,25 +159,11 @@ function updateOrtbConfig(bidder, currConfig, segmentIDs, sspSegmentIDs, transfo
deepSetValue(ortbConfig, 'ortb2.user.data', updatedUserData)

// Set ortb2.user.keywords
const getBidderSpecificKeywordGroups = () => {
if (bidder === 'appnexus') {
const keywords = {
[PERMUTIVE_CUSTOM_COHORTS_KEYWORD]: segmentData.appnexus
}
logger.logInfo(`Bidder specific ortb2.user.keywords`, {
bidder,
keywords,
})
return keywords
}

return {}
}
const currentKeywords = deepAccess(ortbConfig, 'ortb2.user.keywords')
const keywordGroups = {
[PERMUTIVE_STANDARD_KEYWORD]: segmentIDs,
[PERMUTIVE_STANDARD_AUD_KEYWORD]: sspSegmentIDs,
...getBidderSpecificKeywordGroups(),
[PERMUTIVE_CUSTOM_COHORTS_KEYWORD]: customCohortsData,
}

// Transform groups of key-values into a single array of strings
Expand Down
12 changes: 2 additions & 10 deletions test/spec/modules/permutiveRtdProvider_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,20 +312,12 @@ describe('permutiveRtdProvider', function () {

setBidderRtb(bidderConfig, moduleConfig, segmentsData)

const getBidderKeywords = (bidder) => {
if (bidder === 'appnexus') {
return {
[PERMUTIVE_CUSTOM_COHORTS_KEYWORD]: segmentsData.appnexus
}
}
return {}
}

acBidders.forEach(bidder => {
const customCohortsData = segmentsData[bidder] || []
const keywordGroups = {
[PERMUTIVE_STANDARD_KEYWORD]: segmentsData.ac,
[PERMUTIVE_STANDARD_AUD_KEYWORD]: segmentsData.ssp.cohorts,
...getBidderKeywords(bidder),
[PERMUTIVE_CUSTOM_COHORTS_KEYWORD]: customCohortsData
}

// Transform groups of key-values into a single array of strings
Expand Down

0 comments on commit 4adff93

Please sign in to comment.