Skip to content

Commit

Permalink
update AdGenetation adapter (+1 squashed commit)
Browse files Browse the repository at this point in the history
Squashed commits:
[1b55ca0] update AdGenetation adapter
  • Loading branch information
banakemi committed Nov 29, 2018
1 parent 56b154c commit 67d1ff7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions modules/adgenerationBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,6 @@ export const spec = {
return [];
}
const bidRequest = bidRequests.bidRequest;
if (!bidRequest.mediaTypes || bidRequest.mediaTypes.banner) {
if (!body.w || !body.h) {
return [];
}
}
const bidResponse = {
requestId: bidRequest.bidId,
cpm: body.cpm || 0,
Expand All @@ -91,7 +86,7 @@ export const spec = {
netRevenue: true,
ttl: body.ttl || 10,
};
if (bidRequest.mediaTypes && bidRequest.mediaTypes.native) {
if (isNative(body)) {
bidResponse.native = createNativeAd(body);
bidResponse.mediaType = NATIVE;
} else {
Expand Down Expand Up @@ -124,6 +119,11 @@ function createAd(body, bidRequest) {
return ad;
}

function isNative(body) {
if (!body) return false;
return body.native_ad && body.native_ad.assets.length > 0;
}

function createNativeAd(body) {
let native = {};
if (body.native_ad && body.native_ad.assets.length > 0) {
Expand Down

0 comments on commit 67d1ff7

Please sign in to comment.