Skip to content

Commit

Permalink
adpod category support test
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Sturtewagen committed Oct 26, 2020
1 parent fb95850 commit 70a3cf2
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions modules/adheseBidAdapter.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

import { registerBidder } from '../src/adapters/bidderFactory.js';
import { BANNER, VIDEO } from '../src/mediaTypes.js';
import { BANNER, VIDEO, ADPOD } from '../src/mediaTypes.js';

const BIDDER_CODE = 'adhese';
const GVLID = 553;
Expand Down Expand Up @@ -97,16 +97,25 @@ function adResponse(bid, ad) {
adhese: {
originData: adDetails.originData,
origin: adDetails.origin,
originInstance: adDetails.originInstance
originInstance: adDetails.originInstance,
}
});

if (bidResponse.mediaType === VIDEO) {
bidResponse.meta = {
primaryCatId: 'IAB2-10',
adServerCatId: 399
}
bidResponse.vastXml = markup;
bidResponse.video = {
context: ADPOD,
durationSeconds: 30
}
} else {
const counter = ad.impressionCounter ? "<img src='" + ad.impressionCounter + "' style='height:1px; width:1px; margin: -1px -1px; display:none;'/>" : '';
bidResponse.ad = markup + counter;
}
}

return bidResponse;
}

Expand Down Expand Up @@ -193,7 +202,8 @@ function getAdDetails(ad) {
if (isAdheseAd(ad)) {
creativeId = ad.id;
dealId = ad.orderId;
originData = { priority: ad.priority, orderProperty: ad.orderProperty, adFormat: ad.adFormat, adType: ad.adType, libId: ad.libId, adspaceId: ad.adspaceId, viewableImpressionCounter: ad.viewableImpressionCounter, slotId: ad.slotID, slotName: ad.slotName, advertiserId: ad.advertiserId, adId: ad.id };
originData = { priority: ad.priority, orderProperty: ad.orderProperty, adFormat: ad.adFormat, adType: ad.adType, libId: ad.libId, adspaceId: ad.adspaceId, viewableImpressionCounter: ad.viewableImpressionCounter, slotId: ad.slotID, slotName: ad.slotName, advertiserId: ad.advertiserId, adId: ad.id
};
} else {
creativeId = ad.origin + (ad.originInstance ? '-' + ad.originInstance : '');
if (ad.originData) {
Expand Down

0 comments on commit 70a3cf2

Please sign in to comment.