Skip to content

Commit

Permalink
Log unsupported ad type only for good bids (#547)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
matthewlane authored and protonate committed Aug 22, 2016
1 parent 75ab99f commit 1cd2d64
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/adapters/appnexusAst.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,17 @@ 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;
} else {
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;
Expand Down

0 comments on commit 1cd2d64

Please sign in to comment.