Skip to content

Commit

Permalink
Yahoo SSP Bid Adapter: fix for adId (#7571)
Browse files Browse the repository at this point in the history
* Added ysspBidAdapter

* Renaming to Yahoo SSP

* changing all internal references from yssp to yahoossp

* added alias for aol, onemobile, onedisplay

* Removing aliases from adapter

* Pass EU consent string in the correct location in the payload.

* WIP

* WIP

* pubId support 1st draft

* WIP

* WIP

* WIP pubId unit tests

* WIP

* WIP

* pubid tests stable

* pubId support

* md update

* site id inventory mapping fix

* update to md file

* update to md file

* order userId list

* added user id yahoo.com

* placementId support

* inventoryId & placementId stable unit tests

* maintainer group update

* maintainer group update

* Redirecting to PubGW urls without .ads.

* url switch fix

* fetch specific utils

* lint

* change inventoryId to siteId

* WIP

* custom key-value pair support

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* updated FPD support

* unit tests stable

* unit tests stable

* check includes

* md file update

* code review updates

* WIP

* WIP

* code review comments

* WIP

* review comments implemented

* update to md file

* update to md file

* update to md file

* type fix

* type fix

* typo fix

* readme structure

* typo

* yarn.lock removed

* revert yarn.lock

* SRA Mode adId fix

* SRA adId patch v1.0.1

* SRA adId patch v1.0.1

Co-authored-by: slimkrazy <sam@slimkrazy.com>
Co-authored-by: Samuel Adu <samuel.adu@gmail.com>
  • Loading branch information
3 people authored Oct 13, 2021
1 parent 719523b commit b8a7ee4
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 3 deletions.
4 changes: 2 additions & 2 deletions modules/yahoosspBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Renderer } from '../src/Renderer.js';

const INTEGRATION_METHOD = 'prebid.js';
const BIDDER_CODE = 'yahoossp';
const ADAPTER_VERSION = '1.0.0';
const ADAPTER_VERSION = '1.0.1';
const PREBID_VERSION = '$prebid.version$';
const DEFAULT_BID_TTL = 300;
const TEST_MODE_DCN = '8a969516017a7a396ec539d97f540011';
Expand Down Expand Up @@ -581,7 +581,7 @@ export const spec = {
let cpm = (bid.ext && bid.ext.encp) ? bid.ext.encp : bid.price;

let bidResponse = {
adId: bid.id,
adId: deepAccess(bid, 'adId') ? bid.adId : bid.impid || bid.crid,
adUnitCode: bidderRequest.adUnitCode,
requestId: bid.impid,
bidderCode: spec.code,
Expand Down
29 changes: 28 additions & 1 deletion test/spec/modules/yahoosspBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const DEFAULT_AD_UNIT_CODE = '/19968336/header-bid-tag-1';
const DEFAULT_AD_UNIT_TYPE = 'banner';
const DEFAULT_PARAMS_BID_OVERRIDE = {};
const DEFAULT_VIDEO_CONTEXT = 'instream';
const ADAPTER_VERSION = '1.0.0';
const ADAPTER_VERSION = '1.0.1';
const PREBID_VERSION = '$prebid.version$';
const INTEGRATION_METHOD = 'prebid.js';

Expand Down Expand Up @@ -1252,6 +1252,33 @@ describe('YahooSSP Bid Adapter:', () => {
})
});

describe('bid response Ad ID / Creative ID', () => {
it('should use adId if it exists in the bid-response', () => {
const { serverResponse, bidderRequest } = generateResponseMock('banner');
const adId = 'bid-response-adId';
serverResponse.body.seatbid[0].bid[0].adId = adId;
const response = spec.interpretResponse(serverResponse, {bidderRequest});
expect(response[0].adId).to.equal(adId);
});

it('should use impid if adId does not exist in the bid-response', () => {
const { serverResponse, bidderRequest } = generateResponseMock('banner');
const impid = '25b6c429c1f52f';
serverResponse.body.seatbid[0].bid[0].impid = impid;
const response = spec.interpretResponse(serverResponse, {bidderRequest});
expect(response[0].adId).to.equal(impid);
});

it('should use crid if adId & impid do not exist in the bid-response', () => {
const { serverResponse, bidderRequest } = generateResponseMock('banner');
const crid = 'passback-12579';
serverResponse.body.seatbid[0].bid[0].impid = undefined;
serverResponse.body.seatbid[0].bid[0].crid = crid;
const response = spec.interpretResponse(serverResponse, {bidderRequest});
expect(response[0].adId).to.equal(crid);
});
});

describe('Time To Live (ttl)', () => {
const UNSUPPORTED_TTL_FORMATS = ['string', [1, 2, 3], true, false, null, undefined];
UNSUPPORTED_TTL_FORMATS.forEach(param => {
Expand Down

0 comments on commit b8a7ee4

Please sign in to comment.