Skip to content

Commit

Permalink
Adnuntius Bid Adater: URL changes (prebid#7154)
Browse files Browse the repository at this point in the history
* Master merge issues

* Adnuntius Bid Adapter: Added tests for gdpr and segments

* Moved segments to read from ortb2 instead of a custom value.

* Changed bidder to read segments from ortb2.

* fixing lgtm alert

* Read USI from meta-information in browser.

* Changing URL and appending parameters.
  • Loading branch information
mikael-lundin authored and agrandes-tappx committed Sep 29, 2021
1 parent cc14421 commit 407540f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
7 changes: 4 additions & 3 deletions modules/adnuntiusBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { config } from '../src/config.js';
import { getStorageManager } from '../src/storageManager.js';

const BIDDER_CODE = 'adnuntius';
const ENDPOINT_URL = 'https://delivery.adnuntius.com/i?tzo=';
const ENDPOINT_URL = 'https://ads.adnuntius.delivery/i';
const GVLID = 855;

const checkSegment = function (segment) {
Expand Down Expand Up @@ -33,7 +33,6 @@ const handleMeta = function () {
adnMeta = JSON.parse(storage.getDataFromLocalStorage('adn.metaData'))
}
const meta = (adnMeta !== null) ? adnMeta.reduce((acc, cur) => { return { ...acc, [cur.key]: cur.value } }, {}) : {}
utils.logMessage('STORE', adnMeta, meta)
return meta
}

Expand Down Expand Up @@ -62,6 +61,8 @@ export const spec = {
const tzo = new Date().getTimezoneOffset();
const gdprApplies = utils.deepAccess(bidderRequest, 'gdprConsent.gdprApplies');
const consentString = utils.deepAccess(bidderRequest, 'gdprConsent.consentString');

request.push('tzo=' + tzo)
request.push('format=json')
if (gdprApplies !== undefined) request.push('consentString=' + consentString);
if (segments.length > 0) request.push('segments=' + segments.join(','));
Expand All @@ -87,7 +88,7 @@ export const spec = {
const network = networkKeys[j];
requests.push({
method: 'POST',
url: ENDPOINT_URL + tzo + '&' + request.join('&'),
url: ENDPOINT_URL + '?' + request.join('&'),
data: JSON.stringify(networks[network]),
bid: bidRequests[network]
});
Expand Down
3 changes: 1 addition & 2 deletions test/spec/modules/adnuntiusBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import * as utils from 'src/utils.js';
import { getStorageManager } from 'src/storageManager.js';

describe('adnuntiusBidAdapter', function () {
const URL = 'https://delivery.adnuntius.com/i?tzo=';
const URL = 'https://ads.adnuntius.delivery/i?tzo=';
const GVLID = 855;
const usi = utils.generateUUID()
const meta = [{ key: 'usi', value: usi }]
Expand All @@ -19,7 +19,6 @@ describe('adnuntiusBidAdapter', function () {
});
const tzo = new Date().getTimezoneOffset();
const ENDPOINT_URL = `${URL}${tzo}&format=json&userId=${usi}`;
// const ENDPOINT_URL_SEGMENTS_ = `${URL}${tzo}&format=json`;
const ENDPOINT_URL_SEGMENTS = `${URL}${tzo}&format=json&segments=segment1,segment2,segment3&userId=${usi}`;
const ENDPOINT_URL_CONSENT = `${URL}${tzo}&format=json&consentString=consentString&userId=${usi}`;
const adapter = newBidder(spec);
Expand Down

0 comments on commit 407540f

Please sign in to comment.