Skip to content

Commit

Permalink
Jixie Bid Adapter: Add read jxtoko cookie (#9331)
Browse files Browse the repository at this point in the history
* Adapter does not seem capable of supporting advertiserDomains #6650
added response comment and some trivial code.

* removed a blank line at the end of file
added a space behind the // in comments

* in response to comment from reviewer. add the aspect of advertiserdomain in unit tests

* added the code to get the keywords from the meta tags if available.

* added some cookie fetching
  • Loading branch information
jxdeveloper1 authored Dec 13, 2022
1 parent 747f143 commit dc7e77f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modules/jixieBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ 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;
} catch (error) {}
return ret;
}
Expand Down
5 changes: 5 additions & 0 deletions test/spec/modules/jixieBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ describe('jixie Adapter', function () {

const clientIdTest1_ = '1aba6a40-f711-11e9-868c-53a2ae972xxx';
const sessionIdTest1_ = '1594782644-1aba6a40-f711-11e9-868c-53a2ae972xxx';
const jxtokoTest1_ = 'eyJJRCI6ImFiYyJ9';

// to serve as the object that prebid will call jixie buildRequest with: (param2)
const bidderRequest_ = {
Expand Down Expand Up @@ -198,6 +199,9 @@ describe('jixie Adapter', function () {
// get the interceptors ready:
let getCookieStub = sinon.stub(storage, 'getCookie');
let getLocalStorageStub = sinon.stub(storage, 'getDataFromLocalStorage');
getCookieStub
.withArgs('_jxtoko')
.returns(jxtokoTest1_);
getCookieStub
.withArgs('_jxx')
.returns(clientIdTest1_);
Expand Down Expand Up @@ -227,6 +231,7 @@ describe('jixie Adapter', function () {
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('device', device_);
expect(payload).to.have.property('domain', domain_);
expect(payload).to.have.property('pageurl', pageurl_);
Expand Down

0 comments on commit dc7e77f

Please sign in to comment.