-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Add Inmar bidder adapter #5674
Add Inmar bidder adapter #5674
Changes from 4 commits
ced7cb7
36726b9
bd58f8e
51c3b2d
7436a90
014c39b
4d07cd0
3527576
43573fd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
import * as utils from '../src/utils.js'; | ||
import { config } from '../src/config.js'; | ||
import { registerBidder } from '../src/adapters/bidderFactory.js'; | ||
import { BANNER, VIDEO } from '../src/mediaTypes.js'; | ||
|
||
const BIDDER_CODE = 'inmar'; | ||
|
||
export const spec = { | ||
code: BIDDER_CODE, | ||
aliases: ['inm'], | ||
supportedMediaTypes: [BANNER, VIDEO], | ||
|
||
/** | ||
* Determines whether or not the given bid request is valid | ||
* | ||
* @param {bidRequest} bid The bid params to validate. | ||
* @returns {boolean} True if this is a valid bid, and false otherwise | ||
*/ | ||
isBidRequestValid: function(bid) { | ||
return !!(bid.params && bid.params.partnerId && bid.params.adnetId); | ||
}, | ||
|
||
/** | ||
* Build a server request from the list of valid BidRequests | ||
* @param {validBidRequests} is an array of the valid bids | ||
* @param {bidderRequest} bidder request object | ||
* @returns {ServerRequest} Info describing the request to the server | ||
*/ | ||
buildRequests: function(validBidRequests, bidderRequest) { | ||
var payload = { | ||
bidderCode: bidderRequest.bidderCode, | ||
auctionId: bidderRequest.auctionId, | ||
bidderRequestId: bidderRequest.bidderRequestId, | ||
bidRequests: validBidRequests, | ||
auctionStart: bidderRequest.auctionStart, | ||
timeout: bidderRequest.timeout, | ||
refererInfo: bidderRequest.refererInfo, | ||
start: bidderRequest.start, | ||
gdprConsent: bidderRequest.gdprConsent, | ||
uspConsent: bidderRequest.uspConsent, | ||
currencyCode: config.getConfig('currency.adServerCurrency'), | ||
domain: config.getConfig('publisherDomain'), | ||
coppa: config.getConfig('coppa'), | ||
firstPartyData: config.getConfig('fpd'), | ||
prebidVersion: '$prebid.version$' | ||
}; | ||
|
||
var payloadString = JSON.stringify(payload); | ||
|
||
return { | ||
method: 'POST', | ||
url: 'https://prebid.owneriq.net:8443/bidder/pb/bid', | ||
options: { | ||
withCredentials: false | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Confused as to why you are sending withCredentials as false since that makes user sync pointless since you wont get your cookie back on the bid request |
||
}, | ||
data: payloadString, | ||
}; | ||
}, | ||
|
||
/** | ||
* Read the response from the server and build a list of bids | ||
* @param {serverResponse} Response from the server. | ||
* @param {bidRequest} Bid request object | ||
* @returns {bidResponses} Array of bids which were nested inside the server | ||
*/ | ||
interpretResponse: function(serverResponse, bidRequest) { | ||
const bidResponses = []; | ||
var response = serverResponse.body; | ||
|
||
try { | ||
if (response) { | ||
var bidResponse = { | ||
requestId: response.requestId, | ||
cpm: response.cpm, | ||
currency: response.currency, | ||
width: response.width, | ||
height: response.height, | ||
ad: response.ad, | ||
ttl: response.ttl, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please consider adding meta fields as per #3115 |
||
creativeId: response.creativeId, | ||
netRevenue: response.netRevenue, | ||
vastUrl: response.vastUrl, | ||
vastXml: response.vastXml, | ||
dealId: response.dealId, | ||
mediaType: response.mediaType | ||
}; | ||
|
||
bidResponses.push(bidResponse); | ||
} | ||
} catch (error) { | ||
utils.logError('Error while parsing inmar response', error); | ||
} | ||
return bidResponses; | ||
}, | ||
|
||
/** | ||
* User Syncs | ||
* | ||
* @param {syncOptions} Publisher prebid configuration | ||
* @param {serverResponses} Response from the server | ||
* @returns {Array} | ||
*/ | ||
getUserSyncs: function(syncOptions, serverResponses) { | ||
const syncs = []; | ||
if (syncOptions.pixelEnabled) { | ||
syncs.push({ | ||
type: 'image', | ||
url: 'https://px.owneriq.net/eucm/p/pb' | ||
}); | ||
} | ||
return syncs; | ||
} | ||
}; | ||
|
||
registerBidder(spec); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Overview | ||
|
||
``` | ||
Module Name: Inmar Bidder Adapter | ||
Module Type: Bidder Adapter | ||
Maintainer: [email protected] | ||
``` | ||
|
||
# Description | ||
|
||
Connects to Inmar for bids. This adapter supports Display and Video. | ||
|
||
The Inmar adapter requires setup and approval from the Inmar team. | ||
Please reach out to your account manager for more information. | ||
|
||
# Test Parameters | ||
|
||
## Web | ||
``` | ||
var adUnits = [ | ||
{ | ||
code: 'test-div1', | ||
sizes: [[300, 250],[300, 600]], | ||
bids: [{ | ||
bidder: 'inmar', | ||
params: { | ||
partnerId: 12345, | ||
adnetId: 'ADb1f40rmi', | ||
bidFloor: 0.70, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you must use add support for the floors module if you are reading floors |
||
position: 1 | ||
} | ||
}] | ||
}, | ||
{ | ||
code: 'test-div2', | ||
sizes: [[728, 90],[970, 250]], | ||
bids: [{ | ||
bidder: 'inmar', | ||
params: { | ||
partnerId: 12345, | ||
adnetId: 'ADb1f40rmo', | ||
bidFloor: 0.40, | ||
position: 0 | ||
} | ||
}] | ||
} | ||
]; | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getting deprecated https://github.com/prebid/Prebid.js/pull/5674/files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#5637 rather