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 #19 from prebid/master
Sync with master
- Loading branch information
Showing
14 changed files
with
1,253 additions
and
218 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { | ||
BANNER, | ||
NATIVE | ||
} from '../src/mediaTypes.js'; | ||
import { | ||
registerBidder | ||
} from '../src/adapters/bidderFactory.js'; | ||
import { | ||
getBannerRequest, | ||
getBannerResponse, | ||
getNativeResponse, | ||
} from '../libraries/audUtils/bidderUtils.js'; | ||
|
||
const ENDPOINT_URL = 'https://rtb.ehealthcaresolutions.com/hb'; | ||
// Export const spec | ||
export const spec = { | ||
code: 'ehealthcaresolutions', | ||
supportedMediaTypes: [BANNER, NATIVE], | ||
// Determines whether or not the given bid request is valid | ||
isBidRequestValid: (bParam) => { | ||
return !!(bParam.params.placement_id); | ||
}, | ||
// Make a server request from the list of BidRequests | ||
buildRequests: (bidRequests, serverRequest) => { | ||
// Get Requests based on media types | ||
return getBannerRequest(bidRequests, serverRequest, ENDPOINT_URL); | ||
}, | ||
// Unpack the response from the server into a list of bids. | ||
interpretResponse: (bResponse, bRequest) => { | ||
let Response = {}; | ||
const mediaType = JSON.parse(bRequest.data)[0].MediaType; | ||
if (mediaType == BANNER) { | ||
Response = getBannerResponse(bResponse, BANNER); | ||
} else if (mediaType == NATIVE) { | ||
Response = getNativeResponse(bResponse, bRequest, NATIVE); | ||
} | ||
return Response; | ||
} | ||
} | ||
|
||
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,61 @@ | ||
# Overview | ||
|
||
``` | ||
Module Name: eHealthcareSolutions Bidder Adapter | ||
Module Type: Bidder Adapter | ||
Maintainer: [email protected] | ||
``` | ||
|
||
# Description | ||
|
||
eHealthcareSolutions currently supports the BANNER and NATIVE type ads through prebid js | ||
|
||
Module that connects to eHealthcareSolutions's demand sources. | ||
|
||
# Test Request | ||
``` | ||
var adUnits = [ | ||
{ | ||
code: 'display-ad', | ||
mediaTypes: { | ||
banner: { | ||
sizes: [[300, 250]], | ||
} | ||
} | ||
bids: [ | ||
{ | ||
bidder: 'ehealthcaresolutions', | ||
params: { | ||
placement_id: 111519, // Required parameter | ||
width: 300, // Optional parameter | ||
height: 250, // Optional parameter | ||
bid_floor: 0.5 // Optional parameter | ||
} | ||
} | ||
] | ||
}, | ||
{ | ||
code: 'native-ad-container', | ||
mediaTypes: { | ||
native: { | ||
title: { required: true, len: 100 }, | ||
image: { required: true, sizes: [300, 250] }, | ||
sponsored: { required: false }, | ||
clickUrl: { required: true }, | ||
desc: { required: true }, | ||
icon: { required: false, sizes: [50, 50] }, | ||
cta: { required: false } | ||
} | ||
}, | ||
bids: [ | ||
{ | ||
bidder: 'eHealthcareSolutions', | ||
params: { | ||
placement_id: 111519, // Required parameter | ||
bid_floor: 1 // Optional parameter | ||
} | ||
} | ||
] | ||
} | ||
]; | ||
``` |
Oops, something went wrong.