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

Topics Fpd Module: Add RtbHouse topics network #10107

Merged
merged 6 commits into from
Jul 10, 2023
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
5 changes: 4 additions & 1 deletion modules/topicsFpdModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,13 @@ let LOAD_TOPICS_INITIALISE = false;
const HAS_DEVICE_ACCESS = hasDeviceAccess();

const bidderIframeList = {
maxTopicCaller: 1,
maxTopicCaller: 2,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jlquaccia hopefully this change of default is fine with you

Copy link
Collaborator

Choose a reason for hiding this comment

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

@piwanczak know this has already been merged, but yea seems alright to me. Thanks for the heads up! I took some time off last week, so was just getting around to seeing this PR today.

bidders: [{
bidder: 'pubmatic',
iframeURL: 'https://ads.pubmatic.com/AdServer/js/topics/topics_frame.html'
}, {
bidder: 'rtbhouse',
iframeURL: 'https://topics.authorizedvault.com/topicsapi.html'
}]
}
export const coreStorage = getCoreStorageManager(MODULE_NAME);
Expand Down
4 changes: 4 additions & 0 deletions modules/topicsFpdModule.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ pbjs.setConfig({
bidder: 'pubmatic',
iframeURL: 'https://ads.pubmatic.com/AdServer/js/topics/topics_frame.html',
expiry: 7 // Configurable expiry days
},{
bidder: 'rtbhouse',
iframeURL: 'https://topics.authorizedvault.com/topicsapi.html',
expiry: 7 // Configurable expiry days
},{
bidder: 'rubicon',
iframeURL: 'https://rubicon.com:8080/topics/fpd/topic.html', // dummy URL
Expand Down
14 changes: 10 additions & 4 deletions test/spec/modules/topicsFpdModule_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -372,11 +372,16 @@ describe('getCachedTopics()', () => {
}
];

const evt = {
const evt_pm = {
data: '{"segment":{"domain":"ads.pubmatic.com","topics":[{"configVersion":"chrome.1","modelVersion":"2206021246","taxonomyVersion":"1","topic":165,"version":"chrome.1:1:2206021246"}],"bidder":"pubmatic"},"date":1669743901858}',
origin: 'https://ads.pubmatic.com'
};

const evt_rh = {
data: '{"segment":{"domain":"topics.authorizedvault.com","topics":[{"configVersion":"chrome.1","modelVersion":"2206021246","taxonomyVersion":"1","topic":165,"version":"chrome.1:1:2206021246"}],"bidder":"rtbhouse"},"date":1669743901858}',
origin: 'https://topics.authorizedvault.com'
};

let gdprDataHdlrStub;
beforeEach(() => {
gdprDataHdlrStub = sinon.stub(gdprDataHandler, 'getConsentData');
Expand Down Expand Up @@ -413,9 +418,10 @@ describe('getCachedTopics()', () => {
it('should stored segments if receiveMessage event is triggerred with segment data', () => {
return processFpd({}, {global: {}}, {data: Promise.resolve(mockData)})
.then(({global}) => {
receiveMessage(evt);
receiveMessage(evt_pm);
receiveMessage(evt_rh);
let segments = new Map(safeJSONParse(storage.getDataFromLocalStorage(topicStorageName)));
expect(segments.has('pubmatic')).to.equal(true);
expect(segments.has('pubmatic') || segments.has('rtbhouse')).to.equal(true);
});
});

Expand All @@ -424,7 +430,7 @@ describe('getCachedTopics()', () => {
storage.setDataInLocalStorage(topicStorageName, storedSegments);
return processFpd({}, {global: {}}, {data: Promise.resolve(mockData)})
.then(({global}) => {
receiveMessage(evt);
receiveMessage(evt_pm);
let segments = new Map(safeJSONParse(storage.getDataFromLocalStorage(topicStorageName)));
expect(segments.get('pubmatic')[2206021246].segment.length).to.equal(1);
});
Expand Down