Skip to content

Commit

Permalink
Discovery Bid Adapter : support topics (prebid#11209)
Browse files Browse the repository at this point in the history
* Discovery Bid Adapter : add title, desc, keywords, hLen, nbw, hc, dm  add unit test resolve conflict

* Discovery Bid Adapter : add title, desc, keywords, hLen, nbw, hc, dm  add unit test

* Discovery Bid Adapter : synchronize mguid from third party cookie to first party cookie

* test

* Discovery Bid Adapter : Extend the expiration time of pmguid

* Discovery Bid Adapter : Extend the expiration time of pmguid

* Discovery Bid Adapter : Extend the expiration time of pmguid

* Discovery Bid Adapter : Extend the expiration time of pmguid

* Discovery Bid Adapter : support topics

* Discovery Bid Adapter : support topics

* Discovery Bid Adapter : support topics

* Discovery Bid Adapter : support topics

---------

Co-authored-by: lvhuixin <[email protected]>
  • Loading branch information
2 people authored and dgirardi committed Mar 20, 2024
1 parent e2f96ab commit 6d34941
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
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

0 comments on commit 6d34941

Please sign in to comment.