Skip to content
Closed
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
24 changes: 0 additions & 24 deletions modules/1plusXRtdProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const ORTB2_NAME = '1plusX.com'
const PAPI_VERSION = 'v1.0';
const LOG_PREFIX = '[1plusX RTD Module]: ';
const OPE_FPID = 'ope_fpid'
const LEGACY_SITE_KEYWORDS_BIDDERS = ['appnexus'];
export const segtaxes = {
// cf. https://github.com/InteractiveAdvertisingBureau/openrtb/pull/108
AUDIENCE: 526,
Expand Down Expand Up @@ -152,17 +151,6 @@ const getTargetingDataFromPapi = (papiUrl) => {
* @returns {Object} Object describing the updates to make on bidder configs
*/
export const buildOrtb2Updates = ({ segments = [], topics = [] }, bidder) => {
// Currently appnexus bidAdapter doesn't support topics in `site.content.data.segment`
// Therefore, writing them in `site.keywords` until it's supported
// Other bidAdapters do fine with `site.content.data.segment`
const writeToLegacySiteKeywords = LEGACY_SITE_KEYWORDS_BIDDERS.includes(bidder);
if (writeToLegacySiteKeywords) {
const site = {
keywords: topics.join(',')
};
return { site };
}

const userData = {
name: ORTB2_NAME,
segment: segments.map((segmentId) => ({ id: segmentId }))
Expand Down Expand Up @@ -216,14 +204,6 @@ export const updateBidderConfig = (bidder, ortb2Updates, bidderConfigs) => {
return bidderConfigCopy;
};

const setAppnexusAudiences = (audiences) => {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

removing this means that appnexus won't get audience data; I'm not sure that's the intent. Airgrid is replacing this with another kind of appnexus logic that's slightly more general, but they are not removing it entirely.

config.setConfig({
appnexusAuctionKeywords: {
'1plusX': audiences,
},
});
}

/**
* Updates bidder configs with the targeting data retreived from Profile API
* @param {Object} papiResponse Response from Profile API
Expand All @@ -243,10 +223,6 @@ export const setTargetingDataToConfig = (papiResponse, { bidders }) => {
config: updatedBidderConfig
});
}
if (bidder === 'appnexus') {
// Do the legacy stuff for appnexus with segments
setAppnexusAudiences(segments);
}
}
}

Expand Down
43 changes: 1 addition & 42 deletions test/spec/modules/1plusXRtdProvider_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,18 +195,6 @@ describe('1plusXRtdProvider', () => {
}
expect([ortb2Updates]).to.deep.include.members([expectedOutput]);
});
it('fills site.keywords in the ortb2 config (appnexus specific)', () => {
const rtdData = { segments: fakeResponse.s, topics: fakeResponse.t };
const ortb2Updates = buildOrtb2Updates(rtdData, 'appnexus');

const expectedOutput = {
site: {
keywords: rtdData.topics.join(','),
}
}
expect([ortb2Updates]).to.deep.include.members([expectedOutput]);
});

it('defaults to empty array if no segment is given', () => {
const rtdData = { topics: fakeResponse.t };
const ortb2Updates = buildOrtb2Updates(rtdData, randomBidder());
Expand Down Expand Up @@ -242,17 +230,6 @@ describe('1plusXRtdProvider', () => {
}
expect(ortb2Updates).to.deep.include(expectedOutput);
})
it('defaults to empty string if no topic is given (appnexus specific)', () => {
const rtdData = { segments: fakeResponse.s };
const ortb2Updates = buildOrtb2Updates(rtdData, 'appnexus');

const expectedOutput = {
site: {
keywords: '',
}
}
expect(ortb2Updates).to.deep.include(expectedOutput);
})
})

describe('extractConsent', () => {
Expand Down Expand Up @@ -384,24 +361,6 @@ describe('1plusXRtdProvider', () => {
expect(newBidderConfig.ortb2.user).to.deep.include(bidderConfigInitial.ortb2.user);
})

it('merges fetched data in bidderConfig for configured bidders (appnexus specific)', () => {
const bidder = 'appnexus';
// Set initial config
config.setBidderConfig({
bidders: [bidder],
config: bidderConfigInitial
});
// Call submodule's setBidderConfig
const newBidderConfig = updateBidderConfig(bidder, ortb2UpdatesAppNexus, config.getBidderConfig());

// Check that the targeting data has been set in the config
expect(newBidderConfig).not.to.be.null;
expect(newBidderConfig.ortb2.site).to.deep.include(ortb2UpdatesAppNexus.site);
// Check that existing config didn't get erased
expect(newBidderConfig.ortb2.site).to.deep.include(bidderConfigInitial.ortb2.site);
expect(newBidderConfig.ortb2.user).to.deep.include(bidderConfigInitial.ortb2.user);
})

it('overwrites an existing 1plus.com entry in ortb2.user.data', () => {
const bidder = randomBidder();
// Set initial config
Expand Down Expand Up @@ -495,7 +454,7 @@ describe('1plusXRtdProvider', () => {
}

it('sets the config for the selected bidders', () => {
const bidders = ['appnexus', 'rubicon'];
const bidders = ['rubicon'];
// setting initial config for those bidders
config.setBidderConfig({
bidders,
Expand Down