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 8 - deprecate bidder category translation feature in core #9898

Merged
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
100 changes: 100 additions & 0 deletions libraries/categoryTranslationMapping/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
/**
* Provides mapping objects used by bidders for categoryTranslation type logic for Adpod feature
*/
export const APPNEXUS_CATEGORY_MAPPING = {
'1': 'IAB20-3',
'2': 'IAB18-5',
'3': 'IAB10-1',
'4': 'IAB2-3',
'5': 'IAB19-8',
'6': 'IAB22-1',
'7': 'IAB18-1',
'8': 'IAB12-3',
'9': 'IAB5-1',
'10': 'IAB4-5',
'11': 'IAB13-4',
'12': 'IAB8-7',
'13': 'IAB9-7',
'14': 'IAB7-1',
'15': 'IAB20-18',
'16': 'IAB10-7',
'17': 'IAB19-18',
'18': 'IAB13-6',
'19': 'IAB18-4',
'20': 'IAB1-5',
'21': 'IAB1-6',
'22': 'IAB3-4',
'23': 'IAB19-13',
'24': 'IAB22-2',
'25': 'IAB3-9',
'26': 'IAB17-18',
'27': 'IAB19-6',
'28': 'IAB1-7',
'29': 'IAB9-30',
'30': 'IAB20-7',
'31': 'IAB20-17',
'32': 'IAB7-32',
'33': 'IAB16-5',
'34': 'IAB19-34',
'35': 'IAB11-5',
'36': 'IAB12-3',
'37': 'IAB11-4',
'38': 'IAB12-3',
'39': 'IAB9-30',
'41': 'IAB7-44',
'42': 'IAB7-1',
'43': 'IAB7-30',
'50': 'IAB19-30',
'51': 'IAB17-12',
'52': 'IAB19-30',
'53': 'IAB3-1',
'55': 'IAB13-2',
'56': 'IAB19-30',
'57': 'IAB19-30',
'58': 'IAB7-39',
'59': 'IAB22-1',
'60': 'IAB7-39',
'61': 'IAB21-3',
'62': 'IAB5-1',
'63': 'IAB12-3',
'64': 'IAB20-18',
'65': 'IAB11-2',
'66': 'IAB17-18',
'67': 'IAB9-9',
'68': 'IAB9-5',
'69': 'IAB7-44',
'71': 'IAB22-3',
'73': 'IAB19-30',
'74': 'IAB8-5',
'78': 'IAB22-1',
'85': 'IAB12-2',
'86': 'IAB22-3',
'87': 'IAB11-3',
'112': 'IAB7-32',
'113': 'IAB7-32',
'114': 'IAB7-32',
'115': 'IAB7-32',
'118': 'IAB9-5',
'119': 'IAB9-5',
'120': 'IAB9-5',
'121': 'IAB9-5',
'122': 'IAB9-5',
'123': 'IAB9-5',
'124': 'IAB9-5',
'125': 'IAB9-5',
'126': 'IAB9-5',
'127': 'IAB22-1',
'132': 'IAB1-2',
'133': 'IAB19-30',
'137': 'IAB3-9',
'138': 'IAB19-3',
'140': 'IAB2-3',
'141': 'IAB2-1',
'142': 'IAB2-3',
'143': 'IAB17-13',
'166': 'IAB11-4',
'175': 'IAB3-1',
'176': 'IAB13-4',
'182': 'IAB8-9',
'183': 'IAB3-5'
};
24 changes: 3 additions & 21 deletions modules/appnexusBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {
} from '../src/utils.js';
import {Renderer} from '../src/Renderer.js';
import {config} from '../src/config.js';
import {getIabSubCategory, registerBidder} from '../src/adapters/bidderFactory.js';
import {registerBidder} from '../src/adapters/bidderFactory.js';
import {ADPOD, BANNER, NATIVE, VIDEO} from '../src/mediaTypes.js';
import {auctionManager} from '../src/auctionManager.js';
import {find, includes} from '../src/polyfill.js';
Expand All @@ -37,6 +37,7 @@ import {getStorageManager} from '../src/storageManager.js';
import {bidderSettings} from '../src/bidderSettings.js';
import {hasPurpose1Consent} from '../src/utils/gpdr.js';
import { convertOrtbRequestToProprietaryNative } from '../src/native.js';
import { APPNEXUS_CATEGORY_MAPPING } from '../libraries/categoryTranslationMapping/index.js';

const BIDDER_CODE = 'appnexus';
const URL = 'https://ib.adnxs.com/ut/v3/prebid';
Expand Down Expand Up @@ -89,7 +90,6 @@ const NATIVE_MAPPING = {
};
const SOURCE = 'pbjs';
const MAX_IMPS_PER_REQUEST = 15;
const mappingFileUrl = 'https://acdn.adnxs-simple.com/prebid/appnexus-mapping/mappings.json';
const SCRIPT_TAG_START = '<script';
const VIEWABILITY_URL_START = /\/\/cdn\.adnxs\.com\/v|\/\/cdn\.adnxs\-simple\.com\/v/;
const VIEWABILITY_FILE_NAME = 'trk.js';
Expand Down Expand Up @@ -420,24 +420,6 @@ export const spec = {
return bids;
},

/**
* @typedef {Object} mappingFileInfo
* @property {string} url mapping file json url
* @property {number} refreshInDays prebid stores mapping data in localstorage so you can return in how many days you want to update value stored in localstorage.
* @property {string} localStorageKey unique key to store your mapping json in localstorage
*/

/**
* Returns mapping file info. This info will be used by bidderFactory to preload mapping file and store data in local storage
* @returns {mappingFileInfo}
*/
getMappingFileInfo: function () {
return {
url: mappingFileUrl,
refreshInDays: 2
}
},

getUserSyncs: function (syncOptions, responses, gdprConsent, uspConsent, gppConsent) {
function checkGppStatus(gppConsent) {
// this is a temporary measure to supress usersync in US-based GPP regions
Expand Down Expand Up @@ -667,7 +649,7 @@ function newBid(serverBid, rtbBid, bidderRequest) {
const videoContext = deepAccess(bidRequest, 'mediaTypes.video.context');
switch (videoContext) {
case ADPOD:
const primaryCatId = getIabSubCategory(bidRequest.bidder, rtbBid.brand_category_id);
const primaryCatId = (APPNEXUS_CATEGORY_MAPPING[rtbBid.brand_category_id]) ? APPNEXUS_CATEGORY_MAPPING[rtbBid.brand_category_id] : null;
bid.meta = Object.assign({}, bid.meta, { primaryCatId });
const dealTier = rtbBid.deal_priority;
bid.video = {
Expand Down
24 changes: 3 additions & 21 deletions modules/goldbachBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@ import {
transformBidderParamKeywords
} from '../src/utils.js';
import {config} from '../src/config.js';
import {getIabSubCategory, registerBidder} from '../src/adapters/bidderFactory.js';
import {registerBidder} from '../src/adapters/bidderFactory.js';
import {ADPOD, BANNER, NATIVE, VIDEO} from '../src/mediaTypes.js';
import {auctionManager} from '../src/auctionManager.js';
import {find, includes} from '../src/polyfill.js';
import {INSTREAM, OUTSTREAM} from '../src/video.js';
import {hasPurpose1Consent} from '../src/utils/gpdr.js';
import { convertOrtbRequestToProprietaryNative } from '../src/native.js';
import { APPNEXUS_CATEGORY_MAPPING } from '../libraries/categoryTranslationMapping/index.js';

const BIDDER_CODE = 'goldbach';
const URL = 'https://ib.adnxs.com/ut/v3/prebid';
Expand Down Expand Up @@ -86,7 +87,6 @@ const NATIVE_MAPPING = {
};
const SOURCE = 'pbjs';
const MAX_IMPS_PER_REQUEST = 15;
const mappingFileUrl = 'https://acdn.adnxs-simple.com/prebid/appnexus-mapping/mappings.json';
const SCRIPT_TAG_START = '<script';
const VIEWABILITY_URL_START = /\/\/cdn\.adnxs\.com\/v|\/\/cdn\.adnxs\-simple\.com\/v/;
const VIEWABILITY_FILE_NAME = 'trk.js';
Expand Down Expand Up @@ -376,24 +376,6 @@ export const spec = {
return bids;
},

/**
* @typedef {Object} mappingFileInfo
* @property {string} url mapping file json url
* @property {number} refreshInDays prebid stores mapping data in localstorage so you can return in how many days you want to update value stored in localstorage.
* @property {string} localStorageKey unique key to store your mapping json in localstorage
*/

/**
* Returns mapping file info. This info will be used by bidderFactory to preload mapping file and store data in local storage
* @returns {mappingFileInfo}
*/
getMappingFileInfo: function () {
return {
url: mappingFileUrl,
refreshInDays: 2
}
},

getUserSyncs: function (syncOptions, responses, gdprConsent) {
if (syncOptions.iframeEnabled && hasPurpose1Consent({gdprConsent})) {
return [{
Expand Down Expand Up @@ -656,7 +638,7 @@ function newBid(serverBid, rtbBid, bidderRequest) {
const videoContext = deepAccess(bidRequest, 'mediaTypes.video.context');
switch (videoContext) {
case ADPOD:
const primaryCatId = getIabSubCategory(bidRequest.bidder, rtbBid.brand_category_id);
const primaryCatId = (APPNEXUS_CATEGORY_MAPPING[rtbBid.brand_category_id]) ? APPNEXUS_CATEGORY_MAPPING[rtbBid.brand_category_id] : null;
bid.meta = Object.assign({}, bid.meta, { primaryCatId });
const dealTier = rtbBid.deal_priority;
bid.video = {
Expand Down
24 changes: 3 additions & 21 deletions modules/mediafuseBidAdapter.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { convertCamelToUnderscore, isArray, isNumber, isPlainObject, logError, logInfo, deepAccess, logMessage, convertTypes, isStr, getParameterByName, deepClone, chunk, logWarn, getBidRequest, createTrackPixelHtml, isEmpty, transformBidderParamKeywords, getMaxValueFromArray, fill, getMinValueFromArray, isArrayOfNums, isFn } from '../src/utils.js';
import { Renderer } from '../src/Renderer.js';
import { config } from '../src/config.js';
import { registerBidder, getIabSubCategory } from '../src/adapters/bidderFactory.js';
import { registerBidder } from '../src/adapters/bidderFactory.js';
import { BANNER, NATIVE, VIDEO, ADPOD } from '../src/mediaTypes.js';
import { auctionManager } from '../src/auctionManager.js';
import {find, includes} from '../src/polyfill.js';
Expand All @@ -10,6 +10,7 @@ import { getStorageManager } from '../src/storageManager.js';
import { bidderSettings } from '../src/bidderSettings.js';
import {hasPurpose1Consent} from '../src/utils/gpdr.js';
import { convertOrtbRequestToProprietaryNative } from '../src/native.js';
import { APPNEXUS_CATEGORY_MAPPING } from '../libraries/categoryTranslationMapping/index.js';

const BIDDER_CODE = 'mediafuse';
const URL = 'https://ib.adnxs.com/ut/v3/prebid';
Expand Down Expand Up @@ -57,7 +58,6 @@ const NATIVE_MAPPING = {
};
const SOURCE = 'pbjs';
const MAX_IMPS_PER_REQUEST = 15;
const mappingFileUrl = 'https://acdn.adnxs-simple.com/prebid/mediafuse-mapping/mappings.json';
const SCRIPT_TAG_START = '<script';
const VIEWABILITY_URL_START = /\/\/cdn\.adnxs\.com\/v|\/\/cdn\.adnxs\-simple\.com\/v/;
const VIEWABILITY_FILE_NAME = 'trk.js';
Expand Down Expand Up @@ -321,24 +321,6 @@ export const spec = {
return bids;
},

/**
* @typedef {Object} mappingFileInfo
* @property {string} url mapping file json url
* @property {number} refreshInDays prebid stores mapping data in localstorage so you can return in how many days you want to update value stored in localstorage.
* @property {string} localStorageKey unique key to store your mapping json in localstorage
*/

/**
* Returns mapping file info. This info will be used by bidderFactory to preload mapping file and store data in local storage
* @returns {mappingFileInfo}
*/
getMappingFileInfo: function () {
return {
url: mappingFileUrl,
refreshInDays: 2
}
},

getUserSyncs: function (syncOptions, responses, gdprConsent) {
if (syncOptions.iframeEnabled && hasPurpose1Consent({gdprConsent})) {
return [{
Expand Down Expand Up @@ -621,7 +603,7 @@ function newBid(serverBid, rtbBid, bidderRequest) {
const videoContext = deepAccess(bidRequest, 'mediaTypes.video.context');
switch (videoContext) {
case ADPOD:
const primaryCatId = getIabSubCategory(bidRequest.bidder, rtbBid.brand_category_id);
const primaryCatId = (APPNEXUS_CATEGORY_MAPPING[rtbBid.brand_category_id]) ? APPNEXUS_CATEGORY_MAPPING[rtbBid.brand_category_id] : null;
bid.meta = Object.assign({}, bid.meta, { primaryCatId });
const dealTier = rtbBid.deal_priority;
bid.video = {
Expand Down
Loading