forked from prebid/Prebid.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'prebid:master' into master
- Loading branch information
Showing
41 changed files
with
1,862 additions
and
2,137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
import {registerBidder} from '../src/adapters/bidderFactory.js'; | ||
import {BANNER} from '../src/mediaTypes.js'; | ||
import * as utils from '../src/utils.js'; | ||
import {ortbConverter} from '../libraries/ortbConverter/converter.js' | ||
|
||
const BIDDER_CODE = 'eskimi'; | ||
// const ENDPOINT = 'https://hb.eskimi.com/bids' | ||
const ENDPOINT = 'https://sspback.eskimi.com/bid-request' | ||
|
||
const DEFAULT_BID_TTL = 30; | ||
const DEFAULT_CURRENCY = 'USD'; | ||
const DEFAULT_NET_REVENUE = true; | ||
const GVLID = 814; | ||
|
||
export const spec = { | ||
code: BIDDER_CODE, | ||
gvlid: GVLID, | ||
supportedMediaTypes: [BANNER], | ||
|
||
isBidRequestValid: function (bid) { | ||
return !!bid.params.placementId; | ||
}, | ||
|
||
buildRequests(bidRequests, bidderRequest) { | ||
const data = converter.toORTB({bidRequests, bidderRequest}) | ||
|
||
let bid = bidRequests.find((b) => b.params.placementId) | ||
if (!data.site) data.site = {} | ||
data.site.ext = {placementId: bid.params.placementId} | ||
|
||
if (bidderRequest.gdprConsent) { | ||
if (!data.user) data.user = {}; | ||
if (!data.user.ext) data.user.ext = {}; | ||
if (!data.regs) data.regs = {}; | ||
if (!data.regs.ext) data.regs.ext = {}; | ||
data.user.ext.consent = bidderRequest.gdprConsent.consentString; | ||
data.regs.ext.gdpr = bidderRequest.gdprConsent.gdprApplies ? 1 : 0; | ||
} | ||
|
||
return [{ | ||
method: 'POST', | ||
url: ENDPOINT, | ||
data, | ||
options: {contentType: 'application/json;charset=UTF-8', withCredentials: false} | ||
}] | ||
}, | ||
|
||
interpretResponse(response, request) { | ||
return converter.fromORTB({response: response.body, request: request.data}).bids; | ||
}, | ||
|
||
/** | ||
* Register bidder specific code, which will execute if a bid from this bidder won the auction | ||
* @param {Bid} bid The bid that won the auction | ||
*/ | ||
onBidWon: function (bid) { | ||
if (bid.burl) { | ||
utils.triggerPixel(bid.burl); | ||
} | ||
} | ||
} | ||
|
||
const converter = ortbConverter({ | ||
context: { | ||
netRevenue: DEFAULT_NET_REVENUE, | ||
ttl: DEFAULT_BID_TTL, | ||
currency: DEFAULT_CURRENCY, | ||
mediaType: BANNER // TODO: support more types, we should set mtype on the winning bid | ||
} | ||
}); | ||
|
||
registerBidder(spec); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Overview | ||
|
||
Module Name: ESKIMI Bidder Adapter | ||
Module Type: Bidder Adapter | ||
Maintainer: tech@eskimi.com | ||
|
||
# Description | ||
|
||
An adapter to get a bid from Eskimi DSP. | ||
|
||
# Test Parameters | ||
```javascript | ||
var adUnits = [{ | ||
code: 'div-gpt-ad-1460505748561-0', | ||
mediaTypes: { | ||
banner: { | ||
sizes: [[300, 250], [300, 600]] | ||
} | ||
}, | ||
|
||
bids: [{ | ||
bidder: 'eskimi', | ||
params: { | ||
placementId: 612 | ||
} | ||
}] | ||
|
||
}]; | ||
``` | ||
|
||
Where: | ||
|
||
* placementId - Placement ID of the ad unit (required) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.