Skip to content

Commit

Permalink
Prebid 9: Move bidders iframes urls to config
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcin Komorski authored and Marcin Komorski committed Jun 3, 2024
1 parent 93c7450 commit 8130495
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 35 deletions.
36 changes: 2 additions & 34 deletions modules/topicsFpdModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,38 +21,6 @@ export function reset() {
iframeLoadedURL = [];
}

const bidderIframeList = {
maxTopicCaller: 4,
bidders: [{
bidder: 'pubmatic',
iframeURL: 'https://ads.pubmatic.com/AdServer/js/topics/topics_frame.html'
}, {
bidder: 'rtbhouse',
iframeURL: 'https://topics.authorizedvault.com/topicsapi.html'
}, {
bidder: 'openx',
iframeURL: 'https://pa.openx.net/topics_frame.html'
}, {
bidder: 'improvedigital',
iframeURL: 'https://hb.360yield.com/privacy-sandbox/topics.html'
}, {
bidder: 'onetag',
iframeURL: 'https://onetag-sys.com/static/topicsapi.html'
}, {
bidder: 'taboola',
iframeURL: 'https://cdn.taboola.com/libtrc/static/topics/taboola-prebid-browsing-topics.html'
}, {
bidder: 'discovery',
iframeURL: 'https://api.popin.cc/topic/prebid-topics-frame.html'
}, {
bidder: 'undertone',
iframeURL: 'https://creative-p.undertone.com/spk-public/topics_frame.html'
}, {
bidder: 'vidazoo',
iframeURL: 'https://static.vidazoo.com/topics_api/topics_frame.html'
}]
}

export const coreStorage = getCoreStorageManager(MODULE_NAME);
export const topicStorageName = 'prebid:topics';
export const lastUpdated = 'lastUpdated';
Expand Down Expand Up @@ -161,7 +129,7 @@ export function processFpd(config, {global}, {data = topicsData} = {}) {
*/
export function getCachedTopics() {
let cachedTopicData = [];
const topics = config.getConfig('userSync.topics') || bidderIframeList;
const topics = config.getConfig('userSync.topics');
const bidderList = topics.bidders || [];
let storedSegments = new Map(safeJSONParse(coreStorage.getDataFromLocalStorage(topicStorageName)));
storedSegments && storedSegments.forEach((value, cachedBidder) => {
Expand Down Expand Up @@ -243,7 +211,7 @@ function listenMessagesFromTopicIframe() {
*/
export function loadTopicsForBidders(doc = document) {
if (!isTopicsSupported(doc)) return;
const topics = config.getConfig('userSync.topics') || bidderIframeList;
const topics = config.getConfig('userSync.topics');

if (topics) {
listenMessagesFromTopicIframe();
Expand Down
36 changes: 35 additions & 1 deletion src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,35 @@ const GRANULARITY_OPTIONS = {

const ALL_TOPICS = '*';

const DEFAULT_IFRAMES_CONFIG = {
maxTopicCaller: 4,
bidders: [{
bidder: 'pubmatic',
iframeURL: 'https://ads.pubmatic.com/AdServer/js/topics/topics_frame.html'
}, {
bidder: 'rtbhouse',
iframeURL: 'https://topics.authorizedvault.com/topicsapi.html'
}, {
bidder: 'openx',
iframeURL: 'https://pa.openx.net/topics_frame.html'
}, {
bidder: 'improvedigital',
iframeURL: 'https://hb.360yield.com/privacy-sandbox/topics.html'
}, {
bidder: 'onetag',
iframeURL: 'https://onetag-sys.com/static/topicsapi.html'
}, {
bidder: 'taboola',
iframeURL: 'https://cdn.taboola.com/libtrc/static/topics/taboola-prebid-browsing-topics.html'
}, {
bidder: 'discovery',
iframeURL: 'https://api.popin.cc/topic/prebid-topics-frame.html'
}, {
bidder: 'undertone',
iframeURL: 'https://creative-p.undertone.com/spk-public/topics_frame.html'
}]
}

export function newConfig() {
let listeners = [];
let defaults;
Expand Down Expand Up @@ -163,7 +192,12 @@ export function newConfig() {
maxNestedIframes: DEFAULT_MAX_NESTED_IFRAMES,

// default max bid
maxBid: DEFAULT_MAXBID_VALUE
maxBid: DEFAULT_MAXBID_VALUE,
// default bidders iframes urls

userSync: {
topics: DEFAULT_IFRAMES_CONFIG
}
};

Object.defineProperties(newConfig,
Expand Down

0 comments on commit 8130495

Please sign in to comment.