Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prebid 8: IMDS bid adapter - Rename synacormedia adapter #9381

Merged
merged 7 commits into from
May 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions modules/synacormediaBidAdapter.js → modules/imdsBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ const BLOCKED_AD_SIZES = [
];
const DEFAULT_MAX_TTL = 420; // 7 minutes
export const spec = {
code: 'synacormedia',
code: 'imds',
aliases: [
{ code: 'synacormedia' }
],
supportedMediaTypes: [ BANNER, VIDEO ],
sizeMap: {},

Expand Down Expand Up @@ -63,15 +66,15 @@ export const spec = {

validBidReqs.forEach((bid, i) => {
if (seatId && seatId !== bid.params.seatId) {
logWarn(`Synacormedia: there is an inconsistent seatId: ${bid.params.seatId} but only sending bid requests for ${seatId}, you should double check your configuration`);
logWarn(`IMDS: there is an inconsistent seatId: ${bid.params.seatId} but only sending bid requests for ${seatId}, you should double check your configuration`);
return;
} else {
seatId = bid.params.seatId;
}
const tagIdOrPlacementId = bid.params.tagId || bid.params.placementId;
let pos = parseInt(bid.params.pos || deepAccess(bid.mediaTypes, 'video.pos'), 10);
if (isNaN(pos)) {
logWarn(`Synacormedia: there is an invalid POS: ${bid.params.pos}`);
logWarn(`IMDS: there is an invalid POS: ${bid.params.pos}`);
pos = 0;
}
const videoOrBannerKey = this.isVideoBid(bid) ? 'video' : 'banner';
Expand Down Expand Up @@ -149,7 +152,7 @@ export const spec = {
};
const bidFloor = getBidFloor(bid, 'banner', '*');
if (isNaN(bidFloor)) {
logWarn(`Synacormedia: there is an invalid bid floor: ${bid.params.bidfloor}`);
logWarn(`IMDS: there is an invalid bid floor: ${bid.params.bidfloor}`);
}
if (bidFloor !== null && !isNaN(bidFloor)) {
imp.bidfloor = bidFloor;
Expand All @@ -173,7 +176,7 @@ export const spec = {
};
const bidFloor = getBidFloor(bid, 'video', size);
if (isNaN(bidFloor)) {
logWarn(`Synacormedia: there is an invalid bid floor: ${bid.params.bidfloor}`);
logWarn(`IMDS: there is an invalid bid floor: ${bid.params.bidfloor}`);
}

if (bidFloor !== null && !isNaN(bidFloor)) {
Expand Down Expand Up @@ -211,7 +214,7 @@ export const spec = {
};

if (!serverResponse.body || typeof serverResponse.body != 'object') {
logWarn('Synacormedia: server returned empty/non-json response: ' + JSON.stringify(serverResponse.body));
logWarn('IMDS: server returned empty/non-json response: ' + JSON.stringify(serverResponse.body));
return;
}
const {id, seatbid: seatbids} = serverResponse.body;
Expand Down Expand Up @@ -299,7 +302,7 @@ export const spec = {
url: `${USER_SYNC_HOST}/html/usersync.html?src=$$REPO_AND_VERSION$$`
});
} else {
logWarn('Synacormedia: Please enable iframe based user sync.');
logWarn('IMDS: Please enable iframe based user sync.');
}
return syncs;
}
Expand Down
10 changes: 5 additions & 5 deletions modules/synacormediaBidAdapter.md → modules/imdsBidAdapter.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Overview

```
Module Name: Synacor Media Bidder Adapter
Module Name: iMedia Digital Services Bidder Adapter
Module Type: Bidder Adapter
Maintainer: eng-demand@synacor.com
Maintainer: eng-demand@imds.tv
```

# Description

The Synacor Media adapter requires setup and approval from Synacor.
The iMedia Digital Services adapter requires setup and approval from iMedia Digital Services.
Please reach out to your account manager for more information.

### DFP Video Creative
Expand All @@ -30,7 +30,7 @@ https://track.technoratimedia.com/openrtb/tags?ID=%%PATTERN:hb_cache_id_synacorm
}
},
bids: [{
bidder: "synacormedia",
bidder: "imds",
params: {
seatId: "prebid",
tagId: "demo1",
Expand All @@ -49,7 +49,7 @@ https://track.technoratimedia.com/openrtb/tags?ID=%%PATTERN:hb_cache_id_synacorm
}
},
bids: [{
bidder: "synacormedia",
bidder: "imds",
params: {
seatId: "prebid",
tagId: "demo1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { assert, expect } from 'chai';
import { BANNER } from 'src/mediaTypes.js';
import { config } from 'src/config.js';
import { spec } from 'modules/synacormediaBidAdapter.js';
import { spec } from 'modules/imdsBidAdapter.js';

describe('synacormediaBidAdapter ', function () {
describe('imdsBidAdapter ', function () {
describe('isBidRequestValid', function () {
let bid;
beforeEach(function () {
Expand Down Expand Up @@ -115,7 +115,7 @@ describe('synacormediaBidAdapter ', function () {
});
describe('buildRequests', function () {
let validBidRequestVideo = {
bidder: 'synacormedia',
bidder: 'imds',
params: {
seatId: 'prebid',
tagId: '1234',
Expand All @@ -140,7 +140,7 @@ describe('synacormediaBidAdapter ', function () {
};

let bidderRequestVideo = {
bidderCode: 'synacormedia',
bidderCode: 'imds',
auctionId: 'VideoAuctionId124',
bidderRequestId: '117954d20d7c9c',
auctionStart: 1553624929697,
Expand Down Expand Up @@ -543,7 +543,7 @@ describe('synacormediaBidAdapter ', function () {
});
it('should use all the video params in the impression request', function () {
let validBidRequestVideo = {
bidder: 'synacormedia',
bidder: 'imds',
params: {
seatId: 'prebid',
tagId: '1234',
Expand Down Expand Up @@ -601,7 +601,7 @@ describe('synacormediaBidAdapter ', function () {
});
it('should move any video params in the mediaTypes object to params.video object', function () {
let validBidRequestVideo = {
bidder: 'synacormedia',
bidder: 'imds',
params: {
seatId: 'prebid',
tagId: '1234',
Expand Down Expand Up @@ -659,7 +659,7 @@ describe('synacormediaBidAdapter ', function () {
});
it('should create params.video object if not present on bid request and move any video params in the mediaTypes object to it', function () {
let validBidRequestVideo = {
bidder: 'synacormedia',
bidder: 'imds',
params: {
seatId: 'prebid',
tagId: '1234'
Expand Down Expand Up @@ -731,7 +731,7 @@ describe('synacormediaBidAdapter ', function () {

describe('Bid Requests with placementId should be backward compatible ', function () {
let validVideoBidReq = {
bidder: 'synacormedia',
bidder: 'imds',
params: {
seatId: 'prebid',
placementId: 'demo1',
Expand Down Expand Up @@ -772,7 +772,7 @@ describe('synacormediaBidAdapter ', function () {
refererInfo: {
referer: 'http://localhost:9999/'
},
bidderCode: 'synacormedia',
bidderCode: 'imds',
auctionId: 'f8a75621-d672-4cbb-9275-3db7d74fb110'
};

Expand All @@ -793,7 +793,7 @@ describe('synacormediaBidAdapter ', function () {

describe('Bid Requests with schain object ', function () {
let validBidReq = {
bidder: 'synacormedia',
bidder: 'imds',
params: {
seatId: 'prebid',
tagId: 'demo1',
Expand Down Expand Up @@ -835,12 +835,12 @@ describe('synacormediaBidAdapter ', function () {
refererInfo: {
referer: 'http://localhost:9999/'
},
bidderCode: 'synacormedia',
bidderCode: 'imds',
auctionId: 'f8a75621-d672-4cbb-9275-3db7d74fb110',
bidderRequestId: '16d438671bfbec',
bids: [
{
bidder: 'synacormedia',
bidder: 'imds',
params: {
seatId: 'prebid',
tagId: 'demo1',
Expand Down Expand Up @@ -1313,7 +1313,7 @@ describe('synacormediaBidAdapter ', function () {

describe('Bid Requests with price module should use if available', function () {
let validVideoBidRequest = {
bidder: 'synacormedia',
bidder: 'imds',
params: {
bidfloor: '0.50',
seatId: 'prebid',
Expand Down Expand Up @@ -1356,7 +1356,7 @@ describe('synacormediaBidAdapter ', function () {
refererInfo: {
referer: 'http://localhost:9999/'
},
bidderCode: 'synacormedia',
bidderCode: 'imds',
auctionId: 'f8a75621-d672-4cbb-9275-3db7d74fb110'
};

Expand All @@ -1383,7 +1383,7 @@ describe('synacormediaBidAdapter ', function () {

describe('Bid Requests with gpid or anything in bid.ext should use if available', function () {
let validVideoBidRequest = {
bidder: 'synacormedia',
bidder: 'imds',
params: {
seatId: 'prebid',
placementId: 'demo1',
Expand Down Expand Up @@ -1440,7 +1440,7 @@ describe('synacormediaBidAdapter ', function () {
refererInfo: {
referer: 'http://localhost:9999/'
},
bidderCode: 'synacormedia',
bidderCode: 'imds',
auctionId: 'f8a75621-d672-4cbb-9275-3db7d74fb110'
};

Expand Down