Skip to content

Commit

Permalink
AdYouLike Bidder - enable Vast response format (prebid#7229)
Browse files Browse the repository at this point in the history
* add required clickurl in every native adrequest

* allows the native response to be given as is to prebid if possible

* add unit tests on new Native case

* Handle meta object in bid response with default addomains array

* fix icon retrieval in Native case

* Update priorities in case of multiple mediatypes given

* improve robustness and fix associated unit test on picture urls

* add support for params.size parameter

* add unit test on new size format

* Makes sure the playerSize format is consistent

* enable Vast response on bidder adapter

* fix lint errors

* add test on Vast format case
  • Loading branch information
guiann authored and agrandes-tappx committed Sep 29, 2021
1 parent 23dd0f7 commit dea6866
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
2 changes: 1 addition & 1 deletion modules/adyoulikeBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ function getNativeAssets(response, nativeConfig) {

/* Create bid from response */
function createBid(response, bidRequests) {
if (!response || (!response.Ad && !response.Native)) {
if (!response || (!response.Ad && !response.Native && !response.Vast)) {
return
}

Expand Down
41 changes: 41 additions & 0 deletions test/spec/modules/adyoulikeBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,17 @@ describe('Adyoulike Adapter', function () {
}
};

const sentBidVideo = {
'bid_id_0': {
'PlacementID': 'e622af275681965d3095808561a1e510',
'TransactionID': 'e8355240-d976-4cd5-a493-640656fe08e8',
'AvailableSizes': '',
'Video': {
playerSize: [640, 480]
}
}
};

const sentNativeImageType = {
'additional': {
'sent': [
Expand Down Expand Up @@ -382,6 +393,28 @@ describe('Adyoulike Adapter', function () {
meta: testMetaObject
}];

const responseWithSingleVideo = [{
'BidID': 'bid_id_0',
'Placement': 'placement_0',
'Vast': 'PFZBU1Q+RW1wdHkgc2FtcGxlPC92YXN0Pg==',
'Price': 0.5,
'Height': 600,
}];

const videoResult = [{
cpm: 0.5,
creativeId: undefined,
currency: 'USD',
netRevenue: true,
requestId: 'bid_id_0',
ttl: 3600,
mediaType: 'video',
meta: {
advertiserDomains: []
},
vastXml: '<VAST>Empty sample</vast>'
}];

const responseWithMultiplePlacements = [
{
'BidID': 'bid_id_0',
Expand Down Expand Up @@ -689,5 +722,13 @@ describe('Adyoulike Adapter', function () {

expect(result).to.deep.equal(noMeta);
});

it('receive Vast reponse with Video ad', function () {
serverResponse.body = responseWithSingleVideo;
let result = spec.interpretResponse(serverResponse, {data: '{"Bids":' + JSON.stringify(sentBidVideo) + '}'});

expect(result.length).to.equal(1);
expect(result).to.deep.equal(videoResult);
});
});
});

0 comments on commit dea6866

Please sign in to comment.