-
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
Update GetIntent adapter to 1.0 version #1721
Conversation
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.
@dhargo Thanks for the updated adapter, a few changes requested. Also when testing bid responses with the test parameters, I'm receiving a 404
error from your endpoint
http://px.adhigh.net/rtb/direct_banner?pid=12345&tid=9876&known=1&is_video=false&resp_type=JSON&size=300x250& 404 (Not Found)
Please advise so we can validate bid responses, thanks
modules/getintentBidAdapter.js
Outdated
* @param {BidRequest} bidRequest | ||
* @return {Bid[]} An array of bids which were nested inside the server. | ||
*/ | ||
interpretResponse: function(serverResponse, bidRequest) { |
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.
#1748 changed the first argument of interpretResponse
to:
{
body: responseBody,
headers: {
get: function(header) { /* returns a header from the HTTP response */ }
}
}
so doing something like
serverResponse = serverResponse.body
(or however you'd prefer) in this function should give you the expected behavior
modules/getintentBidAdapter.js
Outdated
let size = parseSize(serverResponse.size); | ||
let bid = { | ||
requestId: bidRequest.bidId, | ||
bidderCode: spec.code, |
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.
bidderCode
can be dropped from the bid response object, it'll be set automatically by bidderFactory
. Docs just updated, sorry for the confusion
modules/getintentBidAdapter.js
Outdated
}; | ||
if (bidRequest.sizes) { | ||
// TODO: add support for multiple sizes | ||
giBidRequest.size = bidRequest.sizes[0].join('x'); |
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.
Adunit sizes may be defined as [300, 250]
, in which case sizes[0]
would be 300
and cause a TypeError
. Be sure to check that bidRequest.sizes[0]
is an array before calling join
modules/getintentBidAdapter.js
Outdated
if (bidRequest.creative_id) bid.creativeId = bidRequest.creative_id; | ||
if (bidRequest.mediaType === 'video') { | ||
bid.vastUrl = serverResponse.vast_url; | ||
bid.descriptionUrl = serverResponse.vast_url; |
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.
bid.descriptionUrl
is no longer required, bid.vastUrl
alone will work now
modules/getintentBidAdapter.js
Outdated
const bids = []; | ||
if (serverResponse && serverResponse.no_bid !== 1) { | ||
let size = parseSize(serverResponse.size); | ||
let bid = { |
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.
A few of the required bid response fields are missing: ttl
, netRevenue
, and currency
. See the table in this section http://prebid.org/dev-docs/bidder-adapter-1.html#interpreting-the-response for descriptions and examples of each of these fields
…evenue; fixed creative size selector (prebid#1721)
@matthewlane Thanks for the comments. I've commited fixes. Here is new parameters to use for testing bid response
|
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.
Great, no longer getting the 404 error with those parameters, but still a few issues with requestId
and creativeId
modules/getintentBidAdapter.js
Outdated
height: size[1], | ||
mediaType: bidRequest.mediaType || 'banner' | ||
}; | ||
if (bidRequest.creative_id) bid.creativeId = bidRequest.creative_id; |
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.
Is your endpoint able to always return a creativeId
? That's a required parameter, and if it doesn't get set this won't pass validation. It might also be on responseBody
rather than bidRequest
modules/getintentBidAdapter.js
Outdated
if (responseBody && responseBody.no_bid !== 1) { | ||
let size = parseSize(responseBody.size); | ||
let bid = { | ||
requestId: bidRequest.bidId, |
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.
bidId
didn't appear to be on the bidRequest
object during tests I ran. I was able to get bid responses from your endpoint, but because the requestId
wasn't getting set, it made it appear that the bid from this adapter was empty
return { | ||
method: 'GET', | ||
url: buildUrl(giBidRequest), | ||
data: giBidRequest, |
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.
This should set bidId: bidRequest.bidId
so that the interpretResponse
function has access to it
@matthewlane Thank you for the comments. Fixed missing fields ( Have to notice: method signature |
Sorry for the confusion about that. The second parameter to |
* 'master' of https://github.com/prebid/Prebid.js: (22 commits) Update GetIntent adapter to 1.0 version (prebid#1721) Add `usePaymentRule` param to AN bidders (prebid#1778) New hooks API (replaces monkey-patching for currency) (prebid#1683) Change prebidServer to call client user syncs if they exist (prebid#1734) Fix Centro adapter to allow requests of the same units (prebid#1746) add vastUrl + media type for video bids Prebid Server (prebid#1739) Update adxcg adapter for prebid 1.0 (prebid#1741) Update yieldmoBid adapter request url (prebid#1771) Upgrade Quantcast adapter for Prebid 1.0 (prebid#1753) Fidelity Media Adapter update. Prebid v1.0 (prebid#1719) Kargo Adapter for Prebid 1.0 (prebid#1729) updated for prebid 1.0 api (prebid#1722) Add AdOcean adapter (prebid#1735) Update Conversant adapter to Prebid 1.0 (prebid#1711) Fix test-coverage bug (prebid#1765) Migrating TrustX adapter to 1.0 (prebid#1709) Update Improve Digital adapter for Prebid 1.0 (prebid#1728) Fixed the argument type on getUserSyncs. (prebid#1767) nanointeractive bid adapter (prebid#1627) Validating bid response params (prebid#1738) ...
* AD-2311: Make GetIntent adapter compatible with Prebid.js 1.0 version * AD-2311: remove blank line * Trigger * GetIntent adapter - added bid response fields: currency, ttl and netRevenue; fixed creative size selector (prebid#1721) * GetIntent adapter - added bid response fields: bidId, creativeId (prebid#1721)
* tag '0.32.0' of https://github.com/prebid/Prebid.js: (44 commits) Prebid 0.32.0 Release Commenting out tests that are failing in IE10 (prebid#1710) Update dfp.buildVideoUrl to accept adserver url (prebid#1663) Update rubicon adapter with new properties and 1.0 changes (prebid#1776) Added adUnitCode for compatibility (prebid#1781) Remove 'supported' from analytics adapter info (prebid#1780) Add TTL parameter to bid (prebid#1784) Update GetIntent adapter to 1.0 version (prebid#1721) Add `usePaymentRule` param to AN bidders (prebid#1778) New hooks API (replaces monkey-patching for currency) (prebid#1683) Change prebidServer to call client user syncs if they exist (prebid#1734) Fix Centro adapter to allow requests of the same units (prebid#1746) add vastUrl + media type for video bids Prebid Server (prebid#1739) Update adxcg adapter for prebid 1.0 (prebid#1741) Update yieldmoBid adapter request url (prebid#1771) Upgrade Quantcast adapter for Prebid 1.0 (prebid#1753) Fidelity Media Adapter update. Prebid v1.0 (prebid#1719) Kargo Adapter for Prebid 1.0 (prebid#1729) updated for prebid 1.0 api (prebid#1722) Add AdOcean adapter (prebid#1735) ...
….32.0 to aolgithub-master * commit '7a956351d69ed3a54ec31aaef17a36441be16fbd': (58 commits) Fixed wrong contentType and customHeader options. Fixed aol adapter bad merge (accepted official changes) Fixed issue with invalid webpack module. Added partners ids. Added changelog entry. Refactored interpretResponse tests for Prebid 1.0. Prebid 0.32.0 Release Commenting out tests that are failing in IE10 (prebid#1710) Update dfp.buildVideoUrl to accept adserver url (prebid#1663) Update rubicon adapter with new properties and 1.0 changes (prebid#1776) Added adUnitCode for compatibility (prebid#1781) Remove 'supported' from analytics adapter info (prebid#1780) Add TTL parameter to bid (prebid#1784) Refactored get userSyncs tests for Prebid 1.0. Fixed faining tests for One Mobile endpoint. Refactored One Mobile tests for Prebid 1.0 Refactored Marketplace tests for Prebid 1.0 Implemented AOL user syncs config via setConfig API. Move one mobile post properties to options object. Update GetIntent adapter to 1.0 version (prebid#1721) ...
* AD-2311: Make GetIntent adapter compatible with Prebid.js 1.0 version * AD-2311: remove blank line * Trigger * GetIntent adapter - added bid response fields: currency, ttl and netRevenue; fixed creative size selector (prebid#1721) * GetIntent adapter - added bid response fields: bidId, creativeId (prebid#1721)
Type of change
Description of change
GetIntent adapter for Prebid.js 1.0 version
server-dev@getintent.com
Other information