Skip to content

Commit

Permalink
Colosuss Bid Adapter: add support First Party Data (prebid#9340)
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

* fix conflicts

* add onBidWon

* refactor

* add test for onBidWon()

* fix

* add group_id

* Trigger circleci

* fix

* update user sync

* fix window.location

* fix test

* updates

* fix conflict

* fix

* updates

* remove traffic param

* add transactionId to request data for colossusssp adapter

* Send tid in placements array

* update user sync

* updated tests

* remove changes package-lock file

* fix

* add First Party Data

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 committed Dec 21, 2022
1 parent b468831 commit d5746c3
Show file tree
Hide file tree
Showing 2 changed files with 97 additions and 2 deletions.
8 changes: 8 additions & 0 deletions modules/colossussspBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ export const spec = {
logMessage(e);
}

const firstPartyData = bidderRequest.ortb2 || {};
const userObj = firstPartyData.user;
const siteObj = firstPartyData.site;
const appObj = firstPartyData.app;

// TODO: does the fallback to window.location make sense?
const location = refferLocation || winLocation;
let placements = [];
Expand All @@ -97,6 +102,9 @@ export const spec = {
secure: location.protocol === 'https:' ? 1 : 0,
host: location.host,
page: location.pathname,
userObj,
siteObj,
appObj,
placements: placements
};

Expand Down
91 changes: 89 additions & 2 deletions test/spec/modules/colossussspBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,93 @@ describe('ColossussspAdapter', function () {
referer: 'http://www.example.com',
reachedTop: true,
},
ortb2: {
app: {
name: 'myappname',
keywords: 'power tools, drills',
content: {
data: [
{
name: 'www.dataprovider1.com',
ext: {
segtax: 6
},
segment: [
{
id: '687'
},
{
id: '123'
}
]
},
{
name: 'www.dataprovider1.com',
ext: {
segtax: 7
},
segment: [
{
id: '456'
},
{
id: '789'
}
]
}
]
}
},
site: {
name: 'example',
domain: 'page.example.com',
cat: ['IAB2'],
sectioncat: ['IAB2-2'],
pagecat: ['IAB2-2'],
page: 'https://page.example.com/here.html',
ref: 'https://ref.example.com',
keywords: 'power tools, drills',
search: 'drill',
content: {
userrating: '4',
data: [{
name: 'www.dataprovider1.com',
ext: {
segtax: 7,
cids: ['iris_c73g5jq96mwso4d8']
},
segment: [
{ id: '687' },
{ id: '123' }
]
}]
},
ext: {
data: {
pageType: 'article',
category: 'repair'
}
}
},
user: {
yob: 1985,
gender: 'm',
keywords: 'a,b',
data: [{
name: 'dataprovider.com',
ext: { segtax: 4 },
segment: [
{ id: '1' }
]
}],
ext: {
data: {
registered: true,
interests: ['cars']
}
}
}
},
bids: [bid]
}

Expand Down Expand Up @@ -91,7 +178,7 @@ describe('ColossussspAdapter', function () {
it('Returns valid data if array of bids is valid', function () {
let data = serverRequest.data;
expect(data).to.be.an('object');
expect(data).to.have.all.keys('deviceWidth', 'deviceHeight', 'language', 'secure', 'host', 'page', 'placements', 'ccpa', 'gdpr_consent', 'gdpr_require');
expect(data).to.have.all.keys('deviceWidth', 'deviceHeight', 'language', 'secure', 'host', 'page', 'placements', 'ccpa', 'gdpr_consent', 'gdpr_require', 'userObj', 'siteObj', 'appObj');
expect(data.deviceWidth).to.be.a('number');
expect(data.deviceHeight).to.be.a('number');
expect(data.language).to.be.a('string');
Expand Down Expand Up @@ -132,7 +219,7 @@ describe('ColossussspAdapter', function () {

let data = serverRequest.data;
expect(data).to.be.an('object');
expect(data).to.have.all.keys('deviceWidth', 'deviceHeight', 'language', 'secure', 'host', 'page', 'placements', 'ccpa', 'gdpr_consent', 'gdpr_require');
expect(data).to.have.all.keys('deviceWidth', 'deviceHeight', 'language', 'secure', 'host', 'page', 'placements', 'ccpa', 'gdpr_consent', 'gdpr_require', 'userObj', 'siteObj', 'appObj');
expect(data.deviceWidth).to.be.a('number');
expect(data.deviceHeight).to.be.a('number');
expect(data.language).to.be.a('string');
Expand Down

0 comments on commit d5746c3

Please sign in to comment.