Skip to content

Commit

Permalink
update AdGenetation adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
banakemi committed Nov 26, 2018
1 parent f8b14ec commit 1b55ca0
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;
}

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

0 comments on commit 1b55ca0

Please sign in to comment.