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

Smartadserver Bid Adapter: support GPID #10004

Merged
merged 19 commits into from
May 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
8acd2b4
Smartadserver Bid Adapter: Add support for SDA user and site
mcourouble Nov 9, 2022
d3387b8
Merge branch 'prebid:master' into master
krzysztofequativ Nov 15, 2022
72c7169
Merge remote-tracking branch 'upstream/master'
mcourouble Nov 16, 2022
24ebad8
Smartadserver Bid Adapter: Fix SDA support getConfig and add to unit …
mcourouble Nov 16, 2022
3952d84
Merge branch 'prebid:master' into master
krzysztofequativ Jan 13, 2023
36312fd
support floors per media type
krzysztofequativ Jan 17, 2023
f7f51b6
Merge pull request #14 from smartadserver/floor-per-mediatype
krzysztofequativ Jan 18, 2023
18c659b
Merge branch 'prebid:master' into master
krzysztofequativ Jan 23, 2023
de0d762
Add GPP support
krzysztofequativ Jan 24, 2023
5b89a6e
Rework payloads enriching
krzysztofequativ Jan 24, 2023
6db82d2
Merge pull request #16 from smartadserver/floor-per-mediatype
krzysztofequativ Jan 25, 2023
f5767f7
Merge branch 'prebid:master' into master
krzysztofequativ Jan 26, 2023
9ef7251
Merge branch 'master' into gpp
krzysztofequativ Feb 1, 2023
d4dcbf9
Merge pull request #15 from smartadserver/gpp
krzysztofequativ Feb 1, 2023
fe96171
Merge branch 'prebid:master' into master
krzysztofequativ Feb 1, 2023
0a12454
Merge branch 'prebid:master' into master
krzysztofequativ Feb 2, 2023
10ee3df
Merge branch 'prebid:master' into master
krzysztofequativ May 19, 2023
7323339
Add gpid support
krzysztofequativ May 22, 2023
ebcb8e5
Merge pull request #17 from smartadserver/gpid
krzysztofequativ May 26, 2023
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: 5 additions & 0 deletions modules/smartadserverBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,11 @@ export const spec = {
sdc: sellerDefinedContext
};

const gpid = deepAccess(bid, 'ortb2Imp.ext.gpid', deepAccess(bid, 'ortb2Imp.ext.data.pbadslot', ''));
if (gpid) {
payload.gpid = gpid;
}

if (bidderRequest) {
if (bidderRequest.gdprConsent) {
payload.addtl_consent = bidderRequest.gdprConsent.addtlConsent;
Expand Down
42 changes: 42 additions & 0 deletions test/spec/modules/smartadserverBidAdapter_spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { expect } from 'chai';
import { BANNER, VIDEO } from 'src/mediaTypes.js';
import { config } from 'src/config.js';
import { deepClone } from 'src/utils.js';
import { spec } from 'modules/smartadserverBidAdapter.js';

// Default params with optional ones
Expand Down Expand Up @@ -1339,4 +1340,45 @@ describe('Smart bid adapter tests', function () {
expect(bannerRequest).to.have.property('formatid').and.to.equal('90');
});
});

describe('Global Placement ID (GPID)', function () {
it('should not include gpid by default', () => {
const request = spec.buildRequests(DEFAULT_PARAMS_WO_OPTIONAL);
const requestContent = JSON.parse(request[0].data);

expect(requestContent).to.not.have.property('gdid');
});

it('should include gpid if pbadslot in ortb2Imp', () => {
const gpid = '/19968336/header-bid-tag-1';
const bidRequests = deepClone(DEFAULT_PARAMS_WO_OPTIONAL);

bidRequests[0].ortb2Imp = {
ext: {
data: {
pbadslot: gpid
}
}
};

const request = spec.buildRequests(bidRequests);
const requestContent = JSON.parse(request[0].data);

expect(requestContent).to.have.property('gpid').and.to.equal(gpid);
});

it('should include gpid if imp[].ext.gpid exists', () => {
const gpid = '/1111/homepage#div-leftnav';
const bidRequests = deepClone(DEFAULT_PARAMS_WO_OPTIONAL);

bidRequests[0].ortb2Imp = {
ext: { gpid }
};

const request = spec.buildRequests(bidRequests);
const requestContent = JSON.parse(request[0].data);

expect(requestContent).to.have.property('gpid').and.to.equal(gpid);
});
});
});