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

Discovery Bid Adapter : support topics #11209

Merged
merged 20 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
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
2 changes: 2 additions & 0 deletions modules/discoveryBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,7 @@ function getParam(validBidRequests, bidderRequest) {
const page = utils.deepAccess(bidderRequest, 'refererInfo.page');
const referer = utils.deepAccess(bidderRequest, 'refererInfo.ref');
const firstPartyData = bidderRequest.ortb2;
const tpData = utils.deepAccess(bidderRequest, 'ortb2.user.data') || undefined;
const topWindow = window.top;
const title = getPageTitle();
const desc = getPageDescription();
Expand All @@ -463,6 +464,7 @@ function getParam(validBidRequests, bidderRequest) {
firstPartyData,
ssppid: storage.getCookie(COOKIE_KEY_SSPPID) || undefined,
pmguid: getPmgUID(),
tpData,
page: {
title: title ? title.slice(0, 100) : undefined,
desc: desc ? desc.slice(0, 300) : undefined,
Expand Down
3 changes: 3 additions & 0 deletions modules/topicsFpdModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ const bidderIframeList = {
}, {
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'
}]
}

Expand Down
4 changes: 4 additions & 0 deletions modules/topicsFpdModule.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ pbjs.setConfig({
bidder: 'taboola',
iframeURL: 'https://cdn.taboola.com/libtrc/static/topics/taboola-prebid-browsing-topics.html',
expiry: 7 // Configurable expiry days
}, {
bidder: 'discovery',
iframeURL: 'https://api.popin.cc/topic/prebid-topics-frame.html',
expiry: 7 // Configurable expiry days
}]
}
....
Expand Down
23 changes: 23 additions & 0 deletions test/spec/modules/discoveryBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,22 @@ describe('discovery:BidAdapterTests', function () {
bidderWinsCount: 0,
},
],
ortb2: {
user: {
data: {
segment: [
{
id: '412'
}
],
name: 'test.popin.cc',
ext: {
segclass: '1',
segtax: 503
}
}
}
}
};
let request = [];

Expand Down Expand Up @@ -189,6 +205,13 @@ describe('discovery:BidAdapterTests', function () {
let req_data = JSON.parse(request.data);
expect(req_data.imp).to.have.lengthOf(1);
});
describe('first party data', function () {
it('should pass additional parameter in request for topics', function () {
const request = spec.buildRequests(bidRequestData.bids, bidRequestData);
let res = JSON.parse(request.data);
expect(res.ext.tpData).to.deep.equal(bidRequestData.ortb2.user.data);
});
});

describe('discovery: buildRequests', function() {
describe('getPmgUID function', function() {
Expand Down