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 pull request prebid#3 from prebid/master
merge from prebid master to fork
- Loading branch information
Showing
32 changed files
with
1,709 additions
and
2,089 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
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,89 @@ | ||
import * as utils from 'src/utils'; | ||
import {config} from 'src/config'; | ||
import {registerBidder} from 'src/adapters/bidderFactory'; | ||
|
||
const BIDDER_CODE = 'coinzilla'; | ||
const ENDPOINT_URL = 'https://request.czilladx.com/serve/request.php'; | ||
|
||
export const spec = { | ||
code: BIDDER_CODE, | ||
aliases: ['czlla'], // short code | ||
|
||
/** | ||
* Determines whether or not the given bid request is valid. | ||
* | ||
* @param {BidRequest} bid The bid params to validate. | ||
* @return boolean True if this is a valid bid, and false otherwise. | ||
*/ | ||
isBidRequestValid: function (bid) { | ||
return !!(bid.params.placementId); | ||
}, | ||
|
||
/** | ||
* Make a server request from the list of BidRequests. | ||
* | ||
* @return Array Info describing the request to the server. | ||
* @param validBidRequests | ||
* @param bidderRequest | ||
*/ | ||
buildRequests: function (validBidRequests, bidderRequest) { | ||
if (validBidRequests.length === 0) { | ||
return []; | ||
} | ||
return validBidRequests.map(bidRequest => { | ||
const sizes = utils.parseSizesInput(bidRequest.sizes)[0]; | ||
const width = sizes.split('x')[0]; | ||
const height = sizes.split('x')[1]; | ||
const payload = { | ||
placementId: bidRequest.params.placementId, | ||
width: width, | ||
height: height, | ||
bidId: bidRequest.bidId, | ||
referer: bidderRequest.refererInfo.referer, | ||
}; | ||
return { | ||
method: 'POST', | ||
url: ENDPOINT_URL, | ||
data: payload | ||
}; | ||
}); | ||
}, | ||
|
||
/** | ||
* Unpack the response from the server into a list of bids. | ||
* | ||
* @param {ServerResponse} serverResponse A successful response from the server. | ||
* @param bidRequest | ||
* @return {Bid[]} An array of bids which were nested inside the server. | ||
*/ | ||
interpretResponse: function (serverResponse, bidRequest) { | ||
const bidResponses = []; | ||
const response = serverResponse.body; | ||
const creativeId = response.creativeId || 0; | ||
const width = response.width || 0; | ||
const height = response.height || 0; | ||
const cpm = response.cpm || 0; | ||
if (width !== 0 && height !== 0 && cpm !== 0 && creativeId !== 0) { | ||
const dealId = response.dealid || ''; | ||
const currency = response.currency || 'EUR'; | ||
const netRevenue = (response.netRevenue === undefined) ? true : response.netRevenue; | ||
const referrer = bidRequest.data.referer; | ||
const bidResponse = { | ||
requestId: response.requestId, | ||
cpm: cpm, | ||
width: response.width, | ||
height: response.height, | ||
creativeId: creativeId, | ||
dealId: dealId, | ||
currency: currency, | ||
netRevenue: netRevenue, | ||
ttl: config.getConfig('_bidderTimeout'), | ||
referrer: referrer, | ||
ad: response.ad | ||
}; | ||
bidResponses.push(bidResponse); | ||
} | ||
return bidResponses; | ||
}, | ||
}; | ||
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,24 @@ | ||
# Overview | ||
|
||
``` | ||
Module Name: Coinzilla Bidder Adapter | ||
Module Type: Coinzilla Adapter | ||
Maintainer: technical@sevio.com | ||
``` | ||
|
||
# Description | ||
|
||
Our module helps you have an easier time implementing Coinzilla on your website. All you have to do is replace the ``placementId`` with your zoneID, depending on the required size in your account dashboard. If you need additional information please contact us at ``publishers@coinzilla.com``. | ||
# Test Parameters | ||
``` | ||
var adUnits = [{ | ||
code: 'test-ad-div', | ||
sizes: [[300, 250]], | ||
bids: [{ | ||
bidder: 'coinzilla', | ||
params: { | ||
placementId: 'testPlacementId' | ||
} | ||
}] | ||
}]; | ||
``` |
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.