Skip to content

Commit 72022b7

Browse files
Bill Newmanvladis-teqblazeAiholkinMykhailo Yaremchuk
authored
Colossus Bidder: update user sync (prebid#8050)
* 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 Co-authored-by: Vladislav Isaiko <[email protected]> Co-authored-by: Aiholkin <[email protected]> Co-authored-by: Mykhailo Yaremchuk <[email protected]>
1 parent 0da6138 commit 72022b7

File tree

2 files changed

+24
-7
lines changed

2 files changed

+24
-7
lines changed

modules/colossussspBidAdapter.js

+21-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ import { getWindowTop, deepAccess, logMessage } from '../src/utils.js';
22
import { registerBidder } from '../src/adapters/bidderFactory.js';
33
import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js';
44
import { ajax } from '../src/ajax.js';
5+
import { config } from '../src/config.js';
56

67
const BIDDER_CODE = 'colossusssp';
78
const G_URL = 'https://colossusssp.com/?c=o&m=multi';
8-
const G_URL_SYNC = 'https://colossusssp.com/?c=o&m=cookie';
9+
const G_URL_SYNC = 'https://sync.colossusssp.com';
910

1011
function isBidResponseValid(bid) {
1112
if (!bid.requestId || !bid.cpm || !bid.creativeId || !bid.ttl || !bid.currency) {
@@ -175,10 +176,26 @@ export const spec = {
175176
return response;
176177
},
177178

178-
getUserSyncs: () => {
179+
getUserSyncs: (syncOptions, serverResponses, gdprConsent, uspConsent) => {
180+
let syncType = syncOptions.iframeEnabled ? 'html' : 'hms.gif';
181+
let syncUrl = G_URL_SYNC + `/${syncType}?pbjs=1`;
182+
if (gdprConsent && gdprConsent.consentString) {
183+
if (typeof gdprConsent.gdprApplies === 'boolean') {
184+
syncUrl += `&gdpr=${Number(gdprConsent.gdprApplies)}&gdpr_consent=${gdprConsent.consentString}`;
185+
} else {
186+
syncUrl += `&gdpr=0&gdpr_consent=${gdprConsent.consentString}`;
187+
}
188+
}
189+
if (uspConsent && uspConsent.consentString) {
190+
syncUrl += `&ccpa_consent=${uspConsent.consentString}`;
191+
}
192+
193+
const coppa = config.getConfig('coppa') ? 1 : 0;
194+
syncUrl += `&coppa=${coppa}`;
195+
179196
return [{
180-
type: 'image',
181-
url: G_URL_SYNC
197+
type: syncType,
198+
url: syncUrl
182199
}];
183200
},
184201

test/spec/modules/colossussspBidAdapter_spec.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -199,13 +199,13 @@ describe('ColossussspAdapter', function () {
199199
})
200200

201201
describe('getUserSyncs', function () {
202-
let userSync = spec.getUserSyncs();
202+
let userSync = spec.getUserSyncs({}, {}, {}, {});
203203
it('Returns valid URL and type', function () {
204204
expect(userSync).to.be.an('array').with.lengthOf(1);
205205
expect(userSync[0].type).to.exist;
206206
expect(userSync[0].url).to.exist;
207-
expect(userSync[0].type).to.be.equal('image');
208-
expect(userSync[0].url).to.be.equal('https://colossusssp.com/?c=o&m=cookie');
207+
expect(userSync[0].type).to.be.equal('hms.gif');
208+
expect(userSync[0].url).to.be.equal('https://sync.colossusssp.com/hms.gif?pbjs=1&coppa=0');
209209
});
210210
});
211211
});

0 commit comments

Comments
 (0)