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

relaido Bid Adapter: Add meta OBJ to BidResponse #6914

Merged
merged 13 commits into from
Jun 2, 2021
6 changes: 5 additions & 1 deletion modules/relaidoBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { getStorageManager } from '../src/storageManager.js';

const BIDDER_CODE = 'relaido';
const BIDDER_DOMAIN = 'api.relaido.jp';
const ADAPTER_VERSION = '1.0.3';
const ADAPTER_VERSION = '1.0.4';
const DEFAULT_TTL = 300;
const UUID_KEY = 'relaido_uuid';

Expand Down Expand Up @@ -112,6 +112,10 @@ function interpretResponse(serverResponse, bidRequest) {
ttl: body.ttl || DEFAULT_TTL,
netRevenue: true,
mediaType: mediaType,
meta: {
advertiserDomains: body.adomain || [],
mediaType: VIDEO
}
};
if (mediaType === VIDEO) {
bidResponse.vastXml = body.vast;
Expand Down
6 changes: 5 additions & 1 deletion test/spec/modules/relaidoBidAdapter_spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { expect } from 'chai';
import { spec } from 'modules/relaidoBidAdapter.js';
import * as utils from 'src/utils.js';
import { BANNER, VIDEO } from 'src/mediaTypes.js';
import { getStorageManager } from '../../../src/storageManager.js';

const UUID_KEY = 'relaido_uuid';
Expand Down Expand Up @@ -59,7 +60,8 @@ describe('RelaidoAdapter', function () {
uuid: relaido_uuid,
vast: '<VAST version="3.0"><Ad><InLine></InLine></Ad></VAST>',
playerUrl: 'https://relaido/player.js',
syncUrl: 'https://relaido/sync.html'
syncUrl: 'https://relaido/sync.html',
adomain: ['relaido.co.jp', 'www.cmertv.co.jp']
}
};
serverRequest = {
Expand Down Expand Up @@ -276,6 +278,8 @@ describe('RelaidoAdapter', function () {
expect(response.currency).to.equal(serverResponse.body.currency);
expect(response.creativeId).to.equal(serverResponse.body.creativeId);
expect(response.vastXml).to.equal(serverResponse.body.vast);
expect(response.meta.advertiserDomains).to.equal(serverResponse.body.adomain);
expect(response.meta.mediaType).to.equal(VIDEO);
expect(response.ad).to.be.undefined;
});

Expand Down