Skip to content

Commit

Permalink
Quantcast Bid Adapter: add advertiserDomains to meta (prebid#6929)
Browse files Browse the repository at this point in the history
* qc adds advertisers domain to meta

* fix type in spec
  • Loading branch information
SleimanJneidi authored and agrandes-tappx committed Sep 29, 2021
1 parent f910a3c commit d056e61
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
7 changes: 6 additions & 1 deletion modules/quantcastBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ export const spec = {
}

const bidResponsesList = response.bids.map(bid => {
const { ad, cpm, width, height, creativeId, currency, videoUrl, dealId } = bid;
const { ad, cpm, width, height, creativeId, currency, videoUrl, dealId, meta } = bid;

const result = {
requestId: response.requestId,
Expand All @@ -270,6 +270,11 @@ export const spec = {
if (dealId !== undefined && dealId) {
result['dealId'] = dealId;
}
result.meta = {};

if (meta !== undefined && meta.advertiserDomains && utils.isArray(meta.advertiserDomains)) {
result.meta.advertiserDomains = meta.advertiserDomains;
}

return result;
});
Expand Down
18 changes: 14 additions & 4 deletions test/spec/modules/quantcastBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,10 @@ describe('Quantcast adapter', function () {
'<!DOCTYPE html><div style="height: 250; width: 300; display: table-cell; vertical-align: middle;"><div style="width: 300px; margin-left: auto; margin-right: auto;"><script src="https://adserver.adtechus.com/addyn/3.0/5399.1/2394397/0/-1/QUANTCAST;size=300x250;target=_blank;alias=;kvp36=;sub1=;kvl=;kvc=;kvs=300x250;kvi=;kva=;sub2=;rdclick=http://exch.quantserve.com/r?a=;labels=_qc.clk,_click.adserver.rtb,_click.rand.;rtbip=;rtbdata2=;redirecturl2=" type="text/javascript"></script><img src="https://exch.quantserve.com/pixel/p_12345.gif?media=ad&p=&r=&rand=&labels=_qc.imp,_imp.adserver.rtb&rtbip=&rtbdata2=" style="display: none;" border="0" height="1" width="1" alt="Quantcast"/></div></div>',
creativeId: 1001,
width: 300,
height: 250
height: 250,
meta: {
advertiserDomains: ['dailymail.com']
}
}
]
};
Expand Down Expand Up @@ -718,7 +721,10 @@ describe('Quantcast adapter', function () {
ttl: QUANTCAST_TTL,
creativeId: 1001,
netRevenue: QUANTCAST_NET_REVENUE,
currency: 'USD'
currency: 'USD',
meta: {
advertiserDomains: ['dailymail.com']
}
};
const interpretedResponse = qcSpec.interpretResponse(response);

Expand All @@ -738,7 +744,10 @@ describe('Quantcast adapter', function () {
creativeId: 1001,
netRevenue: QUANTCAST_NET_REVENUE,
currency: 'USD',
dealId: 'test-dealid'
dealId: 'test-dealid',
meta: {
advertiserDomains: ['dailymail.com']
}
};
const interpretedResponse = qcSpec.interpretResponse(response);

Expand All @@ -757,7 +766,8 @@ describe('Quantcast adapter', function () {
creativeId: undefined,
ad: undefined,
netRevenue: QUANTCAST_NET_REVENUE,
currency: 'USD'
currency: 'USD',
meta: {}
};
const interpretedResponse = qcSpec.interpretResponse(videoResponse);

Expand Down

0 comments on commit d056e61

Please sign in to comment.