From ebea7543dd286c5e325aef212ea4f4b94fc038eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rok=20Su=C5=A1nik?= Date: Fri, 2 Apr 2021 12:56:11 +0200 Subject: [PATCH] Zemanta adapter: add advertiserDomains (#6517) --- modules/zemantaBidAdapter.js | 4 ++++ test/spec/modules/zemantaBidAdapter_spec.js | 14 ++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/modules/zemantaBidAdapter.js b/modules/zemantaBidAdapter.js index 582f0853d05..b6dafcaed77 100644 --- a/modules/zemantaBidAdapter.js +++ b/modules/zemantaBidAdapter.js @@ -139,6 +139,10 @@ export const spec = { bidObject.width = bidResponse.w; bidObject.height = bidResponse.h; } + bidObject.meta = {}; + if (bidResponse.adomain && bidResponse.adomain.length > 0) { + bidObject.meta.advertiserDomains = bidResponse.adomain; + } return bidObject; } }).filter(Boolean); diff --git a/test/spec/modules/zemantaBidAdapter_spec.js b/test/spec/modules/zemantaBidAdapter_spec.js index 8ee88b1eb23..523cdcd2eb3 100644 --- a/test/spec/modules/zemantaBidAdapter_spec.js +++ b/test/spec/modules/zemantaBidAdapter_spec.js @@ -352,7 +352,7 @@ describe('Zemanta Adapter', function () { nurl: 'http://example.com/win/${AUCTION_PRICE}', adm: '{"ver":"1.2","assets":[{"id":3,"required":1,"img":{"url":"http://example.com/img/url","w":120,"h":100}},{"id":0,"required":1,"title":{"text":"Test title"}},{"id":5,"data":{"value":"Test sponsor"}}],"link":{"url":"http://example.com/click/url"},"eventtrackers":[{"event":1,"method":1,"url":"http://example.com/impression"}]}', adomain: [ - 'example.co' + 'example.com' ], cid: '3487171', crid: '28023739', @@ -386,6 +386,11 @@ describe('Zemanta Adapter', function () { currency: 'USD', mediaType: 'native', nurl: 'http://example.com/win/${AUCTION_PRICE}', + meta: { + 'advertiserDomains': [ + 'example.com' + ] + }, native: { clickTrackers: undefined, clickUrl: 'http://example.com/click/url', @@ -459,7 +464,12 @@ describe('Zemanta Adapter', function () { nurl: 'http://example.com/win/${AUCTION_PRICE}', ad: '
ad
', width: 300, - height: 250 + height: 250, + meta: { + 'advertiserDomains': [ + 'example.com' + ] + }, } ]