From 9527cc2341d04203be194935e8147fb2b2042deb Mon Sep 17 00:00:00 2001 From: Matt Lane Date: Fri, 19 Aug 2016 15:03:41 -0700 Subject: [PATCH] Log unsupported ad type only for good bids (#547) This addresses an issue where bids are returned from the server with a `nobid` field. In that case, bids won't have an ad_type field and an error message is logged that states 'undefined ad type not supported', but bids are still regsitered to the bid manager with status `NO_BID`. This change aims to remove confusion by only loging the error message in cases where a good bid response comes back from the server with an ad_type other than `banner`, which is not currently supported by this adapter. --- src/adapters/appnexusAst.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/adapters/appnexusAst.js b/src/adapters/appnexusAst.js index f90955c1191..e62180668a7 100644 --- a/src/adapters/appnexusAst.js +++ b/src/adapters/appnexusAst.js @@ -76,10 +76,6 @@ function AppnexusAstAdapter() { const cpm = tag.ads && tag.ads[0].cpm; const type = tag.ads && tag.ads[0].ad_type; - if (type !== 'banner') { - utils.logError(`${type} ad type not supported`); - } - let status; if (cpm !== 0 && type === 'banner') { status = STATUS.GOOD; @@ -87,6 +83,10 @@ function AppnexusAstAdapter() { status = STATUS.NO_BID; } + if (type && type !== 'banner') { + utils.logError(`${type} ad type not supported`); + } + tag.bidId = tag.uuid; // bidfactory looks for bidId on requested bid const bid = createBid(status, tag); const placement = bidRequests[bid.adId].placementCode;