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

Sspbc Bid Adapter : add support for dsa and pass non standard ids #11173

Merged
merged 53 commits into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
1a37b62
Merge pull request #1 from prebid/master
wojciech-bialy-wpm Aug 18, 2020
5a90ba4
Update tests for sspBC adapter
wojciech-bialy-wpm Nov 16, 2020
2183a85
Merge pull request #9 from prebid/master
wojciech-bialy-wpm May 20, 2021
767334b
Merge pull request #11 from prebid/master
wojciech-bialy-wpm Jun 1, 2021
97d7ccf
Merge pull request #13 from prebid/master
wojciech-bialy-wpm Jul 29, 2021
8856c36
Merge pull request #15 from prebid/master
wojciech-bialy-wpm Sep 21, 2021
754df70
Merge pull request #16 from prebid/master
wojciech-bialy-wpm Oct 7, 2021
273e7db
[sspbc-adapter] 5.3 updates: content-type for notifications
Oct 8, 2021
08c90fb
[sspbc-adapter] pass CTA to native bid
Oct 14, 2021
363d342
[sspbc-5.3] keep pbsize for detected adunits
Oct 14, 2021
9f9cc49
[maintenance] - remove old test for sspBc bid adaptor
Oct 14, 2021
22b2afc
[sspbc-5.3] increment adaptor ver
Oct 14, 2021
62dad10
[sspbc-adapter] maintenance update to sspBCBidAdapter
Oct 14, 2021
65a7738
remove yarn.lock
Oct 14, 2021
d224072
Merge pull request #17 from prebid/master
wojciech-bialy-wpm Oct 14, 2021
cf9f3e0
Delete package-lock.json
wojciech-bialy-wpm Oct 25, 2021
1721574
remove package-lock.jsonfrom pull request
Oct 25, 2021
ee21d84
update sspbc-5.3 branch
Oct 25, 2021
170fdcd
Merge branch 'master' of https://github.com/prebid/Prebid.js into ssp…
Oct 25, 2021
26ca477
[sspbc-adapter] send pageViewId in request
Oct 25, 2021
2a8278b
[sspbc-adapter] update pageViewId test
Oct 25, 2021
14ac217
Merge pull request #19 from prebid/master
wojciech-bialy-wpm Nov 16, 2021
6d5bbd3
[sspbc-adapter] add viewabiility tracker to native ads
Nov 16, 2021
75174f6
[sspbc-adapter] add support for bid.admNative property
Nov 16, 2021
7891a9e
[sspbc-adapter] ensure that placement id length is always 3 (improves…
Nov 18, 2021
ad6a21a
[sspbc-adapter] read publisher id and custom ad label, then send them…
Nov 18, 2021
e422156
[sspbc-adapter] adlabel and pubid are set as empty strings, if not pr…
Nov 18, 2021
9a792f0
[sspbc-adapter] jstracker data fix
Nov 22, 2021
9ea4c7c
[sspbc-adapter] jstracker data fix
Nov 22, 2021
4461f6f
[sspbc-adapter] send tagid in notifications
Nov 24, 2021
ca7c5b4
[sspbc-adapter] add gvlid to spec; prepare getUserSyncs for iframe + …
Nov 26, 2021
e419627
update remote repo
wojciech-bialy-wpm Sep 20, 2022
af81f6f
update remote repo
wojciech-bialy-wpm Sep 20, 2022
cb7eed2
update remote repo
wojciech-bialy-wpm Sep 20, 2022
99801d1
Merge pull request #28 from prebid/master
wojciech-bialy-wpm Jul 3, 2023
7bb7efa
Merge pull request #29 from prebid/master
wojciech-bialy-wpm Jul 12, 2023
ac9e623
cleanup of grupawp/prebid master branch
wojciech-bialy-wpm Jul 12, 2023
5a206fd
update sspBC adapter to v 5.9
wojciech-bialy-wpm Jul 12, 2023
6d1f2a8
update tests for sspBC bid adapter
wojciech-bialy-wpm Jul 13, 2023
35a190f
Merge pull request #30 from prebid/master
wojciech-bialy-wpm Aug 23, 2023
8fd00ff
[sspbc-adapter] add support for topicsFPD module
wojciech-bialy-wpm Aug 30, 2023
e5eba5d
[sspbc-adapter] change topic segment ids to int
wojciech-bialy-wpm Sep 5, 2023
cc82ed7
Merge pull request #31 from prebid/master
wojciech-bialy-wpm Oct 30, 2023
e9c99f8
merge repo updates
wojciech-bialy-wpm Oct 30, 2023
c501072
Merge pull request #32 from prebid/master
wojciech-bialy-wpm Jan 8, 2024
f093c44
Merge branch 'prebid:master' into master
wojciech-bialy-wpm Feb 8, 2024
7b8d1a7
Merge pull request #33 from prebid/master
wojciech-bialy-wpm Feb 22, 2024
07d19f5
[sspbc-adapter] update v5.93 - add suport for DSA and non-standard us…
wojciech-bialy-wpm Mar 1, 2024
d0eb7fd
[sspbc-adapter] update v5.93 - remove unnecessary gdpr data
wojciech-bialy-wpm Mar 1, 2024
2dc6ce6
Merge pull request #34 from prebid/master
wojciech-bialy-wpm Mar 1, 2024
8e09983
Merge pull request #35 from grupawp/sspbc-5.93
wojciech-bialy-wpm Mar 5, 2024
57f3826
[sspbc-adapter] remove debug
wojciech-bialy-wpm Mar 5, 2024
65198e3
[sspbc-adapter] fix tests
wojciech-bialy-wpm Mar 7, 2024
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
39 changes: 22 additions & 17 deletions modules/sspBCBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const SYNC_URL = 'https://ssp.wp.pl/bidder/usersync';
const NOTIFY_URL = 'https://ssp.wp.pl/bidder/notify';
const GVLID = 676;
const TMAX = 450;
const BIDDER_VERSION = '5.92';
const BIDDER_VERSION = '5.93';
const DEFAULT_CURRENCY = 'PLN';
const W = window;
const { navigator } = W;
Expand Down Expand Up @@ -77,7 +77,7 @@ const getContentLanguage = () => {

/**
* Get Bid parameters - returns bid params from Object, or 1el array
* @param {*} bidData - bid (bidWon), or array of bids (timeout)
* @param {*} bidParams - bid (bidWon), or array of bids (timeout)
* @returns {object} params object
*/
const unpackParams = (bidParams) => {
Expand Down Expand Up @@ -216,8 +216,11 @@ const applyTopics = (validBidRequest, ortbRequest) => {
};

const applyUserIds = (validBidRequest, ortbRequest) => {
const eids = validBidRequest.userIdAsEids
if (eids && eids.length) {
const { userIdAsEids: eidsVbr = [], ortb2 = {} } = validBidRequest;
const eidsOrtb = ortb2.user?.ext?.data?.eids || [];
const eids = [...eidsVbr, ...eidsOrtb];

if (eids.length) {
const ids = { eids };
ortbRequest.user = { ...ortbRequest.user, ...ids };
}
Expand All @@ -243,7 +246,7 @@ const applyGdpr = (bidderRequest, ortbRequest) => {
* returns floor = 0 if getFloor() is not defined
*
* @param {object} slot bid request adslot
* @returns {float} floorprice
* @returns {number} floorprice
*/
const getHighestFloor = (slot) => {
const currency = getCurrency();
Expand Down Expand Up @@ -570,6 +573,7 @@ const parseNative = (nativeData, adUnitCode) => {
}

const renderCreative = (site, auctionId, bid, seat, request) => {
const { adLabel, id, slot, sn, page, publisherId, ref } = site;
let gam;

const mcad = {
Expand Down Expand Up @@ -619,16 +623,16 @@ const renderCreative = (site, auctionId, bid, seat, request) => {
}
</style>
<script>
window.rekid = ${site.id};
window.slot = ${parseInt(site.slot, 10)};
window.rekid = ${id};
window.slot = ${parseInt(slot, 10)};
window.responseTimestamp = ${Date.now()};
window.wp_sn = "${site.sn}";
window.wp_sn = "${sn}";
window.mcad = JSON.parse(decodeURI(atob("${mcbase}")));
window.gdpr = ${JSON.stringify(request.gdprConsent)};
window.page = "${site.page}";
window.ref = "${site.ref}";
window.adlabel = "${site.adLabel ? site.adLabel : ''}";
window.pubid = "${site.publisherId ? site.publisherId : ''}";
window.tcString = "${request.gdprConsent?.consentString || ''}";
window.page = "${page}";
window.ref = "${ref}";
window.adlabel = "${adLabel || ''}";
window.pubid = "${publisherId || ''}";
window.requestPVID = "${pageView.id}";
`;

Expand All @@ -654,15 +658,14 @@ const spec = {
return true;
},
buildRequests(validBidRequests, bidderRequest) {
logWarn('DEBUG: buildRequests', bidderRequest.auctionId, bidderRequest.bidderRequestId);

// convert Native ORTB definition to old-style prebid native definition
validBidRequests = convertOrtbRequestToProprietaryNative(validBidRequests);

if ((!validBidRequests) || (validBidRequests.length < 1)) {
return false;
}

const ortb2 = setOnAny(validBidRequests, 'ortb2');
const siteId = setOnAny(validBidRequests, 'params.siteId');
const publisherId = setOnAny(validBidRequests, 'params.publisherId');
const page = setOnAny(validBidRequests, 'params.page') || bidderRequest.refererInfo.page;
Expand All @@ -671,6 +674,7 @@ const spec = {
const pbver = '$prebid.version$';
const testMode = setOnAny(validBidRequests, 'params.test') ? 1 : undefined;
const ref = bidderRequest.refererInfo.ref;
const { regs = {} } = ortb2 || {};

const payload = {
id: bidderRequest.bidderRequestId,
Expand All @@ -686,7 +690,7 @@ const spec = {
cur: [getCurrency()],
tmax,
user: {},
regs: {},
regs,
device: {
language: getBrowserLanguage(),
w: screen.width,
Expand Down Expand Up @@ -740,7 +744,7 @@ const spec = {
const { bidId } = bidRequest || {};

// get ext data from bid
const { siteid = site.id, slotid = site.slot, pubid, adlabel, cache: creativeCache, vurls = [] } = ext;
const { siteid = site.id, slotid = site.slot, pubid, adlabel, cache: creativeCache, vurls = [], dsa } = ext;

// update site data
site = {
Expand Down Expand Up @@ -772,6 +776,7 @@ const spec = {
advertiserDomains: adomain,
networkName: seat,
pricepl: ext && ext.pricepl,
dsa,
},
netRevenue: true,
vurls,
Expand Down
2 changes: 1 addition & 1 deletion test/spec/modules/sspBCBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ describe('SSPBC adapter', function () {
expect(adcode).to.be.a('string');
expect(adcode).to.contain('window.rekid');
expect(adcode).to.contain('window.mcad');
expect(adcode).to.contain('window.gdpr');
expect(adcode).to.contain('window.tcString');
expect(adcode).to.contain('window.page');
expect(adcode).to.contain('window.requestPVID');
});
Expand Down