Skip to content

Commit

Permalink
Colossus Adapter: add pbAdSlot support (prebid#7464)
Browse files Browse the repository at this point in the history
* add video&native traffic colossus ssp

* Native obj validation

* Native obj validation #2

* Added size field in requests

* fixed test

* fix merge conflicts

* move to 3.0

* move to 3.0

* fix IE11 new URL issue

* fix IE11 new URL issue

* fix IE11 new URL issue

* https for 3.0

* add https test

* add ccp and schain features

* fix test

* sync with upstream, fix conflicts

* Update colossussspBidAdapter.js

remove commented code

* Update colossussspBidAdapter.js

lint fix

* identity extensions

* identity extensions

* fix

* fix

* fix

* fix

* fix

* add tests for user ids

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* add gdpr support

* add gdpr support

* id5id support

* Update colossussspBidAdapter.js

add bidfloor parameter

* Update colossussspBidAdapter.js

check bidfloor

* Update colossussspBidAdapter.js

* Update colossussspBidAdapter.js

* Update colossussspBidAdapter.js

* Update colossussspBidAdapter_spec.js

* use floor module

* Revert "use floor module"

This reverts commit f0c5c24.

* use floor module

* update to 5v

* fix

* add uid2 and bidFloor support

* fix

* add pbadslot support

Co-authored-by: Vladislav Isaiko <vladis@smartyads.com>
Co-authored-by: Aiholkin <artem.iholkin@smartyads.com>
Co-authored-by: Mykhailo Yaremchuk <m.yaremchuk@smartyads.com>
  • Loading branch information
4 people authored Sep 24, 2021
1 parent 8eb0f77 commit d02fee2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
4 changes: 4 additions & 0 deletions modules/colossussspBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ export const spec = {
if (bid.schain) {
placement.schain = bid.schain;
}
let gpid = utils.deepAccess(bid, 'ortb2Imp.ext.data.pbadslot');
if (gpid) {
placement.gpid = gpid;
}
if (bid.userId) {
getUserId(placement.eids, bid.userId.britepoolid, 'britepool.com');
getUserId(placement.eids, bid.userId.idl_env, 'identityLink');
Expand Down
20 changes: 14 additions & 6 deletions test/spec/modules/colossussspBidAdapter_spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {expect} from 'chai';
import {spec} from '../../../modules/colossussspBidAdapter.js';
import { expect } from 'chai';
import { spec } from '../../../modules/colossussspBidAdapter.js';

describe('ColossussspAdapter', function () {
let bid = {
Expand All @@ -16,6 +16,13 @@ describe('ColossussspAdapter', function () {
sizes: [[300, 250]]
}
},
ortb2Imp: {
ext: {
data: {
pbadslot: '/19968336/prebid_cache_video_adunit'
}
}
},
transactionId: '3bb2f6da-87a6-4029-aeb0-bfe951372e62',
schain: {
ver: '1.0',
Expand Down Expand Up @@ -71,7 +78,7 @@ describe('ColossussspAdapter', function () {
it('Returns valid URL', function () {
expect(serverRequest.url).to.equal('https://colossusssp.com/?c=o&m=multi');
});
it('Should contain ccpa', function() {
it('Should contain ccpa', function () {
expect(serverRequest.data.ccpa).to.be.an('string')
})

Expand All @@ -88,13 +95,14 @@ describe('ColossussspAdapter', function () {
let placements = data['placements'];
for (let i = 0; i < placements.length; i++) {
let placement = placements[i];
expect(placement).to.have.all.keys('placementId', 'eids', 'bidId', 'traffic', 'sizes', 'schain', 'floor');
expect(placement).to.have.all.keys('placementId', 'eids', 'bidId', 'traffic', 'sizes', 'schain', 'floor', 'gpid');
expect(placement.schain).to.be.an('object')
expect(placement.placementId).to.be.a('number');
expect(placement.bidId).to.be.a('string');
expect(placement.traffic).to.be.a('string');
expect(placement.sizes).to.be.an('array');
expect(placement.floor).to.be.an('object');
expect(placement.gpid).to.be.an('string');
}
});
it('Returns empty data if no valid requests are passed', function () {
Expand Down Expand Up @@ -135,7 +143,7 @@ describe('ColossussspAdapter', function () {

describe('interpretResponse', function () {
let resObject = {
body: [ {
body: [{
requestId: '123',
mediaType: 'banner',
cpm: 0.3,
Expand All @@ -150,7 +158,7 @@ describe('ColossussspAdapter', function () {
advertiserDomains: ['google.com'],
advertiserId: 1234
}
} ]
}]
};
let serverResponses = spec.interpretResponse(resObject);
it('Returns an array of valid server responses if response object is valid', function () {
Expand Down

0 comments on commit d02fee2

Please sign in to comment.