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

Mediasquare bidder: remove old user sync method #7780

Merged
merged 4 commits into from
Nov 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 1 addition & 9 deletions modules/mediasquareBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ const BIDDER_CODE = 'mediasquare';
const BIDDER_URL_PROD = 'https://pbs-front.mediasquare.fr/'
const BIDDER_URL_TEST = 'https://bidder-test.mediasquare.fr/'
const BIDDER_ENDPOINT_AUCTION = 'msq_prebid';
const BIDDER_ENDPOINT_SYNC = 'cookie_sync';
const BIDDER_ENDPOINT_WINNING = 'winning';

export const spec = {
Expand Down Expand Up @@ -132,18 +131,11 @@ export const spec = {
* @return {UserSync[]} The user syncs which should be dropped.
*/
getUserSyncs: function(syncOptions, serverResponses, gdprConsent, uspConsent) {
let params = '';
let endpoint = document.location.search.match(/msq_test=true/) ? BIDDER_URL_TEST : BIDDER_URL_PROD;
if (typeof serverResponses === 'object' && serverResponses != null && serverResponses.length > 0 && serverResponses[0].hasOwnProperty('body') &&
serverResponses[0].body.hasOwnProperty('cookies') && typeof serverResponses[0].body.cookies === 'object') {
return serverResponses[0].body.cookies;
} else {
if (gdprConsent && typeof gdprConsent.consentString === 'string') { params += typeof gdprConsent.gdprApplies === 'boolean' ? `&gdpr=${Number(gdprConsent.gdprApplies)}&gdpr_consent=${gdprConsent.consentString}` : `&gdpr_consent=${gdprConsent.consentString}`; }
if (uspConsent && typeof uspConsent === 'string') { params += '&uspConsent=' + uspConsent }
return {
type: 'iframe',
url: endpoint + BIDDER_ENDPOINT_SYNC + '?type=iframe' + params
};
return [];
}
},

Expand Down
8 changes: 4 additions & 4 deletions test/spec/modules/mediasquareBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ describe('MediaSquare bid adapter tests', function () {
});
it('Verifies user sync without cookie in bid response', function () {
var syncs = spec.getUserSyncs({}, [BID_RESPONSE], DEFAULT_OPTIONS.gdprConsent, DEFAULT_OPTIONS.uspConsent);
expect(syncs).to.have.property('type').and.to.equal('iframe');
expect(syncs).to.have.lengthOf(0);
});
it('Verifies user sync with cookies in bid response', function () {
BID_RESPONSE.body.cookies = [{'type': 'image', 'url': 'http://www.cookie.sync.org/'}];
Expand All @@ -178,13 +178,13 @@ describe('MediaSquare bid adapter tests', function () {
});
it('Verifies user sync with no bid response', function() {
var syncs = spec.getUserSyncs({}, null, DEFAULT_OPTIONS.gdprConsent, DEFAULT_OPTIONS.uspConsent);
expect(syncs).to.have.property('type').and.to.equal('iframe');
expect(syncs).to.have.lengthOf(0);
});
it('Verifies user sync with no bid body response', function() {
var syncs = spec.getUserSyncs({}, [], DEFAULT_OPTIONS.gdprConsent, DEFAULT_OPTIONS.uspConsent);
expect(syncs).to.have.property('type').and.to.equal('iframe');
expect(syncs).to.have.lengthOf(0);
var syncs = spec.getUserSyncs({}, [{}], DEFAULT_OPTIONS.gdprConsent, DEFAULT_OPTIONS.uspConsent);
expect(syncs).to.have.property('type').and.to.equal('iframe');
expect(syncs).to.have.lengthOf(0);
});
it('Verifies native in bid response', function () {
const request = spec.buildRequests(NATIVE_PARAMS, DEFAULT_OPTIONS);
Expand Down