Skip to content

Commit

Permalink
Zeta Bid Adapter: bugfix for the possibility to overwrite data with g…
Browse files Browse the repository at this point in the history
…dpr consent (#6967)

* bugfix

* update Prebid definer id

* use compatible syntax

* polishing

* polishing
  • Loading branch information
mwehr-zeta authored Jun 8, 2021
1 parent ee90abe commit 11c3b49
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
27 changes: 14 additions & 13 deletions modules/zetaBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import * as utils from '../src/utils.js';
import { registerBidder } from '../src/adapters/bidderFactory.js';
import {BANNER} from '../src/mediaTypes.js';
const BIDDER_CODE = 'zeta_global';
const PREBID_DEFINER_ID = '44253'
const ENDPOINT_URL = 'https://prebid.rfihub.com/prebid';
const USER_SYNC_URL = 'https://p.rfihub.com/cm?pub=42770&in=1';
const USER_SYNC_URL = 'https://p.rfihub.com/cm?in=1&pub=';
const DEFAULT_CUR = 'USD';
const TTL = 200;
const NET_REV = true;
Expand Down Expand Up @@ -87,10 +88,12 @@ export const spec = {
badv: params.badv,
bapp: params.bapp,
source: params.source ? params.source : {},
regs: params.regs ? params.regs : {},
ext: params.ext ? params.ext : {}
};

payload.device.ua = navigator.userAgent;
payload.device.ip = navigator.ip;
payload.site.page = bidderRequest.refererInfo.referer;
payload.site.mobile = /(ios|ipod|ipad|iphone|android)/i.test(navigator.userAgent) ? 1 : 0;
payload.ext.definerId = params.definerId;
Expand All @@ -99,20 +102,18 @@ export const spec = {
payload.test = params.test;
}
if (request.gdprConsent) {
payload.regs = {
ext: {
gdpr: request.gdprConsent.gdprApplies === true ? 1 : 0
}
};
payload.regs.ext = Object.assign(
payload.regs.ext,
{gdpr: request.gdprConsent.gdprApplies === true ? 1 : 0}
);
}
if (request.gdprConsent && request.gdprConsent.gdprApplies) {
payload.user = {
ext: {
consent: request.gdprConsent.consentString
}
};
payload.user.ext = Object.assign(
payload.user.ext,
{consent: request.gdprConsent.consentString}
);
}
const postUrl = params.definerId !== '0' ? ENDPOINT_URL.concat('/', params.definerId) : ENDPOINT_URL;
const postUrl = params.definerId !== PREBID_DEFINER_ID ? ENDPOINT_URL.concat('/', params.definerId) : ENDPOINT_URL;
return {
method: 'POST',
url: postUrl,
Expand Down Expand Up @@ -162,7 +163,7 @@ export const spec = {
if (syncOptions.iframeEnabled) {
syncs.push({
type: 'iframe',
url: USER_SYNC_URL
url: USER_SYNC_URL.concat(PREBID_DEFINER_ID)
});
}
return syncs;
Expand Down
2 changes: 1 addition & 1 deletion modules/zetaBidAdapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Module that connects to Zeta's demand sources
country: 'USA'
}
},
definerId: '0',
definerId: '44253',
test: 1
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/spec/modules/zetaBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe('Zeta Bid Adapter', function() {
country: 'USA'
}
},
definerId: '0',
definerId: '44253',
test: 1
}
}];
Expand Down

0 comments on commit 11c3b49

Please sign in to comment.