-
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
ehealthcaresolutions Bid Adapter : initial release #12384
Merged
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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 | ||
} | ||
} | ||
] | ||
} | ||
]; | ||
``` |
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 = 'https://rtb-east.tapnative.com/hb'; | ||
// Export const spec | ||
export const spec = { | ||
code: 'tapnative', | ||
supportedMediaTypes: [BANNER, NATIVE], | ||
// Determines whether or not the given bid request is valid | ||
isBidRequestValid: function(bidParam) { | ||
return !!(bidParam.params.placement_id); | ||
}, | ||
// Make a server request from the list of BidRequests | ||
buildRequests: function(bidRequests, serverRequest) { | ||
// Get Requests based on media types | ||
return getBannerRequest(bidRequests, serverRequest, ENDPOINT); | ||
}, | ||
// Unpack the response from the server into a list of bids. | ||
interpretResponse: function(serverResponse, serverRequest) { | ||
let bidderResponse = {}; | ||
const mType = JSON.parse(serverRequest.data)[0].MediaType; | ||
if (mType == BANNER) { | ||
bidderResponse = getBannerResponse(serverResponse, BANNER); | ||
} else if (mType == NATIVE) { | ||
bidderResponse = getNativeResponse(serverResponse, serverRequest, NATIVE); | ||
} | ||
return bidderResponse; | ||
} | ||
} | ||
|
||
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: Tapnative Bidder Adapter | ||
Module Type: Bidder Adapter | ||
Maintainer: [email protected] | ||
``` | ||
|
||
# Description | ||
|
||
Tapnative currently supports the BANNER and NATIVE type ads through prebid js | ||
|
||
Module that connects to tapnative's demand sources. | ||
|
||
# Test Request | ||
``` | ||
var adUnits = [ | ||
{ | ||
code: 'display-ad', | ||
mediaTypes: { | ||
banner: { | ||
sizes: [[300, 250]], | ||
} | ||
} | ||
bids: [ | ||
{ | ||
bidder: 'tapnative', | ||
params: { | ||
placement_id: 111520, // 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: 'tapnative', | ||
params: { | ||
placement_id: 111519, // Required parameter | ||
bid_floor: 1 // Optional parameter | ||
} | ||
} | ||
] | ||
} | ||
]; | ||
``` |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Seems like an opportunity to import this as well?
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.
Hi @patmmccann
we used same repo for both the bidders. Tapnative is already merged, now we want to add same for ehealthcaresolutiosn. and we are alraedy using common library for both.
Thanks