-
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
Trustx adapter #1488
Trustx adapter #1488
Conversation
Hello, |
this hasn't been reviewed yet, but the build is failing. Run |
We run gulp test and it looks like the build failing not really due to adaptor code malfunctioning: HeadlessChrome 0.0.0 (Linux 0.0.0) "before each" hook FAILED Could you please check? |
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.
Thanks for the PR. The Unexpected token <
error can be ignored, that's an unrelated failure and after rerunning your tests they are passing. I was also able to validate bid responses. A few changes requested below
@@ -22,11 +22,29 @@ | |||
|
|||
// Replace this object to test a new Adapter! | |||
bids: [{ | |||
bidder: 'appnexus', | |||
bidder: 'trustx', |
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 page is just for testing, changes to this file aren't required in PRs so the changes here can be dropped
modules/trustxBidAdapter.js
Outdated
} | ||
} | ||
|
||
function tryToSendStat(startTime, timeout, auids, isTimeouted, error) { |
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.
We don't permit bid adapters to collect information about the auction mechanics, this function should be dropped. If you'd like to collect this info please create an analytics adapter
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 makes sense. I would like to note that this function doesn't collect any information on the 'auction mechanics' itself- it sends TrustX header bidder information on the amount of header bids which have timeouted. Do you still think we should remove this function from the adapter code? Would an analytics adapter provide such information to the header bidder?
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 makes sense. I would like to note that this function doesn't collect any information on the 'auction mechanics' itself- it sends TrustX header bidder information on the amount of header bids which have timeouted. Do you still think we should remove this function from the adapter code? Would an analytics adapter provide such information to the header bidder?
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.
Thanks for clarifying. Yes, the function should remain removed as adapters should only make the minimum amount of network calls necessary for the sake of performance. Analytic adapters do have access to the BID_TIMEOUT
event
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.
Thanks for the details. As I can see you have removed the 'trytosend' stat function. Do I understand correct that you don't need us to make any changes to the TrustX adapter code for now?
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.
Correct, no further changes requested from me. Next a second reviewer will be assigned per our PR process and they may have additional feedback for you before merging
modules/trustxBidAdapter.js
Outdated
var active = true; | ||
var handler = function() { | ||
worker.called = true; | ||
$$PREBID_GLOBAL$$.offEvent('bidTimeout', handler); |
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.
$$PREBID_GLOBAL$$.offEvent
and $$PREBID_GLOBAL$$.onEvent
are meant for publisher use and shouldn't be needed within bidder adapters
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.
Could you please let us know what we should replace
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.
Could you please let us know what we should replace
modules/trustxBidAdapter.js
Outdated
@@ -0,0 +1,167 @@ | |||
var utils = require('src/utils.js'); |
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.
prefer const
or let
modules/trustxBidAdapter.js
Outdated
function _forEachPlacement(error, bid, placementCode) { | ||
var bidObject; | ||
if (error) { | ||
bidObject = bidfactory.createBid(2); |
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.
use constant value here (STATUS.GOOD, STATUS. NO_BID)
modules/trustxBidAdapter.js
Outdated
if (error) { | ||
bidObject = bidfactory.createBid(2); | ||
} else { | ||
bidObject = bidfactory.createBid(1); |
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.
pass through the bid request object as a 2nd argument to createBid
. See example here: https://github.com/prebid/Prebid.js/blob/master/modules/appnexusAstBidAdapter.js#L206
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.
thanks for the update. do we need to apply these changes to the code by ourselves?
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.
Yes please make the update so we can merge your adapter. Thanks.
Hello, |
This is merged into master. Please submit a PR to the docs repo to add a file for your adapter to the bidders directory so your adapter's params will appear on the bidders page. Thank you for contributing |
* Add trustx adapter and tests for it * update integration example * Update trustx adapter * Post-review fixes of Trustx adapter
* tag '0.29.0' of https://github.com/prebid/Prebid.js: (29 commits) Prebid 0.29.0 Release Fix for not syncing bidders. (prebid#1598) fix amp example pages (prebid#1597) closes prebid#1298 (prebid#1583) Fixed the broken tests. (prebid#1602) Rubicon Bidder Factory (prebid#1587) Trustx adapter (prebid#1488) Add nurl to markup (prebid#1601) Pass bidRequest to createBid (prebid#1600) Add Kumma adapter (prebid#1512) Serverbid alias (prebid#1560) Add user sync to process for approving adapter PRs (prebid#1457) fix travis build (prebid#1595) Rubicon project improvement/user sync (prebid#1549) Adding Orbitsoft adapter (prebid#1378) Fix renderer test for new validation rule (prebid#1592) Allow SET_TARGETING to be used in AnalyticsAdapter (prebid#1577) Add support for video stream context (prebid#1483) Invalidate bid if matching bid request not found (prebid#1575) allow adapters to set default adserverTargeting for specific bid (prebid#1568) ...
We've submitted the PR to the docs repo: prebid/prebid.github.io#378. |
Hey team, |
* Add trustx adapter and tests for it * update integration example * Update trustx adapter * Post-review fixes of Trustx adapter
Type of change
Description of change
Adding an Trustx adapter.
Added module, test spec and integration example for Trustx Bid Adapter in hello_world.html.
You can setup globalPrebidTrustxPriceType to use net price type:
Be sure to test the integration with your adserver using the Hello World sample page.