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

Jixie adapter changes: adding sendingi of gpid, and send several ids that sits in first party cookie #10369

Merged
merged 22 commits into from
Aug 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
642803b
Adapter does not seem capable of supporting advertiserDomains #6650
jxdeveloper1 Jun 1, 2021
103b8ae
removed a blank line at the end of file
jxdeveloper1 Jun 1, 2021
704e974
in response to comment from reviewer. add the aspect of advertiserdom…
jxdeveloper1 Jun 2, 2021
0d26af8
Merge branch 'prebid:master' into master
jxdeveloper1 Jun 2, 2021
b23b95b
Merge branch 'prebid:master' into master
jxdeveloper1 Oct 18, 2021
7886688
added the code to get the keywords from the meta tags if available.
jxdeveloper1 Oct 18, 2021
b2f8f76
Merge branch 'jixie_add_keyword_frompage'
jxdeveloper1 Oct 18, 2021
49f1eca
Merge branch 'prebid:master' into master
jxdeveloper1 Apr 25, 2022
f5abaab
Merge remote-tracking branch 'upstream/master'
jxdeveloper1 Apr 26, 2022
4389ce4
Merge remote-tracking branch 'upstream/master'
jxdeveloper1 Apr 27, 2022
c358138
Merge remote-tracking branch 'upstream/master'
jxdeveloper1 May 10, 2022
e1622a4
Merge remote-tracking branch 'upstream/master'
jxdeveloper1 May 12, 2022
d11372c
Merge remote-tracking branch 'upstream/master'
jxdeveloper1 May 20, 2022
3d57c8b
Merge remote-tracking branch 'upstream/master'
jxdeveloper1 Jul 16, 2022
4e254b4
Merge remote-tracking branch 'upstream/master'
jxdeveloper1 Dec 13, 2022
63b7cc0
Merge remote-tracking branch 'upstream/master'
jxdeveloper1 Jul 19, 2023
4807683
WIP
jxdeveloper1 Aug 18, 2023
e2eb4c3
cleaned up
jxdeveloper1 Aug 18, 2023
efc9524
Merge remote-tracking branch 'upstream/master'
jxdeveloper1 Aug 18, 2023
5ef588b
Merge branch 'master' into rw-jixie-pass-gpid-etc
jxdeveloper1 Aug 18, 2023
1df612b
Merge branch 'rw-jixie-pass-gpid-etc'
jxdeveloper1 Aug 18, 2023
034b1fe
correcting formatting errors from circleci
jxdeveloper1 Aug 18, 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
28 changes: 11 additions & 17 deletions modules/jixieBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ function fetchIds_() {
client_id_c: '',
client_id_ls: '',
session_id_c: '',
session_id_ls: ''
session_id_ls: '',
jxeids: {}
};
try {
let tmp = storage.getCookie('_jxx');
Expand All @@ -55,8 +56,10 @@ function fetchIds_() {
if (tmp) ret.client_id_ls = tmp;
tmp = storage.getDataFromLocalStorage('_jxxs');
if (tmp) ret.session_id_ls = tmp;
tmp = storage.getCookie('_jxtoko');
if (tmp) ret.jxtoko_id = tmp;
['_jxtoko', '_jxifo', '_jxtdid', '__uid2_advertising_token'].forEach(function(n) {
tmp = storage.getCookie(n);
if (tmp) ret.jxeids[n] = tmp;
});
} catch (error) {}
return ret;
}
Expand Down Expand Up @@ -132,17 +135,6 @@ function getMiscDims_() {
return ret;
}

/* function addUserId(eids, id, source, rti) {
if (id) {
if (rti) {
eids.push({ source, id, rti_partner: rti });
} else {
eids.push({ source, id });
}
}
return eids;
} */

// easier for replacement in the unit test
export const internal = {
getDevice: getDevice_,
Expand Down Expand Up @@ -170,13 +162,16 @@ export const spec = {

let bids = [];
validBidRequests.forEach(function(one) {
bids.push({
let gpid = deepAccess(one, 'ortb2Imp.ext.gpid', deepAccess(one, 'ortb2Imp.ext.data.pbadslot', ''));
let tmp = {
bidId: one.bidId,
adUnitCode: one.adUnitCode,
mediaTypes: (one.mediaTypes === 'undefined' ? {} : one.mediaTypes),
sizes: (one.sizes === 'undefined' ? [] : one.sizes),
params: one.params,
});
gpid: gpid
};
bids.push(tmp);
});

let jixieCfgBlob = config.getConfig('jixie');
Expand All @@ -199,7 +194,6 @@ export const spec = {
if (!pg) {
pg = {};
}

let transformedParams = Object.assign({}, {
// TODO: fix auctionId leak: https://github.com/prebid/Prebid.js/issues/9781
auctionid: bidderRequest.auctionId,
Expand Down
52 changes: 45 additions & 7 deletions test/spec/modules/jixieBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,16 @@ describe('jixie Adapter', function () {
const clientIdTest1_ = '1aba6a40-f711-11e9-868c-53a2ae972xxx';
const sessionIdTest1_ = '1594782644-1aba6a40-f711-11e9-868c-53a2ae972xxx';
const jxtokoTest1_ = 'eyJJRCI6ImFiYyJ9';
const jxifoTest1_ = 'fffffbbbbbcccccaaaaae890606aaaaa';
const jxtdidTest1_ = '222223d1-1111-2222-3333-b9f129299999';
const __uid2_advertising_token_Test1 = 'AAAAABBBBBCCCCCDDDDDEEEEEUkkZPQfifpkPnnlJhtsa4o+gf4nfqgN5qHiTVX73ymTSbLT9jz1nf+Q7QdxNh9nTad9UaN5pzfHMt/rs1woQw72c1ip+8heZXPfKGZtZP7ldJesYhlo3/0FVcL/wl9ZlAo1jYOEfHo7Y9zFzNXABbbbbb==';

const refJxEids_ = {
'_jxtoko': jxtokoTest1_,
'_jxifo': jxifoTest1_,
'_jxtdid': jxtdidTest1_,
'__uid2_advertising_token': __uid2_advertising_token_Test1
};

// to serve as the object that prebid will call jixie buildRequest with: (param2)
const bidderRequest_ = {
Expand All @@ -90,7 +100,12 @@ describe('jixie Adapter', function () {
'adUnitCode': adUnitCode0_,
'bidId': bidId0_,
'bidderRequestId': bidderRequestId_,
'auctionId': auctionId_
'auctionId': auctionId_,
'ortb2Imp': {
'ext': {
'gpid': 'SUPERNEWS#DESKTOP#div-gpt-ad-Top_1-1'
}
}
},
{
'bidder': 'jixie',
Expand All @@ -109,7 +124,12 @@ describe('jixie Adapter', function () {
'adUnitCode': adUnitCode1_,
'bidId': bidId1_,
'bidderRequestId': bidderRequestId_,
'auctionId': auctionId_
'auctionId': auctionId_,
'ortb2Imp': {
'ext': {
'gpid': 'SUPERNEWS#DESKTOP#div-gpt-ad-Top_1-2'
}
}
},
{
'bidder': 'jixie',
Expand All @@ -128,7 +148,12 @@ describe('jixie Adapter', function () {
'adUnitCode': adUnitCode2_,
'bidId': bidId2_,
'bidderRequestId': bidderRequestId_,
'auctionId': auctionId_
'auctionId': auctionId_,
'ortb2Imp': {
'ext': {
'gpid': 'SUPERNEWS#DESKTOP#div-gpt-ad-Top_1-3'
}
}
}
];

Expand All @@ -141,7 +166,8 @@ describe('jixie Adapter', function () {
'sizes': [[300, 250], [300, 600]],
'params': {
'unit': 'prebidsampleunit'
}
},
'gpid': 'SUPERNEWS#DESKTOP#div-gpt-ad-Top_1-1'
},
{
'bidId': bidId1_,
Expand All @@ -157,7 +183,8 @@ describe('jixie Adapter', function () {
'sizes': [[300, 250]],
'params': {
'unit': 'prebidsampleunit'
}
},
'gpid': 'SUPERNEWS#DESKTOP#div-gpt-ad-Top_1-2'
},
{
'bidId': bidId2_,
Expand All @@ -173,7 +200,8 @@ describe('jixie Adapter', function () {
'sizes': [[300, 250], [300, 600]],
'params': {
'unit': 'prebidsampleunit'
}
},
'gpid': 'SUPERNEWS#DESKTOP#div-gpt-ad-Top_1-3'
}
];

Expand Down Expand Up @@ -202,6 +230,15 @@ describe('jixie Adapter', function () {
getCookieStub
.withArgs('_jxtoko')
.returns(jxtokoTest1_);
getCookieStub
.withArgs('_jxifo')
.returns(jxifoTest1_);
getCookieStub
.withArgs('_jxtdid')
.returns(jxtdidTest1_);
getCookieStub
.withArgs('__uid2_advertising_token')
.returns(__uid2_advertising_token_Test1);
getCookieStub
.withArgs('_jxx')
.returns(clientIdTest1_);
Expand All @@ -224,14 +261,15 @@ describe('jixie Adapter', function () {
it('sends bid request to ENDPOINT via POST', function () {
expect(request.method).to.equal('POST')
})

expect(request.data).to.be.an('string');
const payload = JSON.parse(request.data);
expect(payload).to.have.property('auctionid', auctionId_);
expect(payload).to.have.property('client_id_c', clientIdTest1_);
expect(payload).to.have.property('client_id_ls', clientIdTest1_);
expect(payload).to.have.property('session_id_c', sessionIdTest1_);
expect(payload).to.have.property('session_id_ls', sessionIdTest1_);
expect(payload).to.have.property('jxtoko_id', jxtokoTest1_);
expect(payload).to.have.property('jxeids').that.deep.equals(refJxEids_);
expect(payload).to.have.property('device', device_);
expect(payload).to.have.property('domain', domain_);
expect(payload).to.have.property('pageurl', pageurl_);
Expand Down