Conversation
realvuAnalyticsAdapter.js initial merge
matthewlane
left a comment
There was a problem hiding this comment.
Thanks for the PR. I wasn't able to validate bids with the provided test parameters, please advise if those are still the correct params to test with. Also a few comments below for your review
modules/realvuBidAdapter.js
Outdated
| var callbackId = bid_request.bidId; | ||
| // utils.logMessage('realvuBidAdapter boost callback "' + callbackId + '", rez.realvu=' + rez.realvu); | ||
| if (rez.realvu === 'yes') { | ||
| var adap = new AppnexusAdapter(); |
There was a problem hiding this comment.
Importing and using other adapters isn't generally recommended as it may result in unexpected behavior. What is the desired behavior here? Would creating a new alias bid adapter in appnexusBidAdapter fit this case?
There was a problem hiding this comment.
Creating a new alias is not exactly what we need. RealVu adaper define either an ad unit is in view or not. Only if an ad unit is in view realvu adapter calls Appnexus. If the unit is out of view "no bid" is responded without request to server.
There was a problem hiding this comment.
appnexusBidAdapter still shouldn't be imported though, but you can copy the buildJPTCall function and include it (or just the required parts) directly in this module
modules/realvuBidAdapter.js
Outdated
| for (var i = 0; i < pbids.length; i++) { | ||
| var bid_rq = pbids[i]; | ||
| var sizes = utils.parseSizesInput(bid_rq.sizes); | ||
| top.realvu_boost.addUnitById({ |
There was a problem hiding this comment.
References to top should be placed in a try/catch block to prevent possible uncaught TypeErrors
|
try-catch has been added to access top window. |
There was a problem hiding this comment.
A few more comments for review, and please provide testing parameters we can use to verify bid responses. See this file for an example of the pages we test bidder adapters with
modules/realvuBidAdapter.js
Outdated
| var callbackId = bid_request.bidId; | ||
| // utils.logMessage('realvuBidAdapter boost callback "' + callbackId + '", rez.realvu=' + rez.realvu); | ||
| if (rez.realvu === 'yes') { | ||
| var adap = new AppnexusAdapter(); |
There was a problem hiding this comment.
appnexusBidAdapter still shouldn't be imported though, but you can copy the buildJPTCall function and include it (or just the required parts) directly in this module
modules/realvuBidAdapter.js
Outdated
| @@ -0,0 +1,64 @@ | |||
| import adaptermanager from 'src/adaptermanager'; | |||
|
|
|||
| var utils = require('src/utils.js'); | |||
There was a problem hiding this comment.
Prefer const for require statements and anywhere else in the module they can be used in place of var
|
Following recommendations appnexusBidAdapter was included inline. |
|
Can we move forward with this adapter? |
|
We still need test parameters for validating bids with this adapter. The params {
bidder: 'realvu',
params: {
partnerId: '1Y',
placementId: '9339508'
}
}are not returning anything. Please update these or point us to a testing page and we can review |
|
Evidently in your test you have referrer=localhost so an ad server responds with no-bid. |
modules/realvuBidAdapter.js
Outdated
| var baseAdapter = new Adapter('appnexus'); | ||
| var usersync = false; | ||
|
|
||
| baseAdapter.callBids = function (params) { |
There was a problem hiding this comment.
Are you using this callBids anywhere ? I think its not getting used, you can remove it.
modules/realvuBidAdapter.js
Outdated
|
|
||
| // +copy/pasted appnexusBidAdapter, "handleAnCB" replaced with "handleRvAnCB" | ||
| var RvAppNexusAdapter = function RvAppNexusAdapter() { | ||
| var baseAdapter = new Adapter('appnexus'); |
There was a problem hiding this comment.
Why do you need baseAdapter here ?
There was a problem hiding this comment.
Corrected code is committed
modules/realvuBidAdapter.js
Outdated
|
|
||
| // var bidsCount = anArr.length; | ||
|
|
||
| // set expected bids count for callback execution |
There was a problem hiding this comment.
Remove unwanted code
modules/realvuBidAdapter.js
Outdated
| var callbackId = bidRequest.bidId; | ||
| adloader.loadScript(buildJPTCall(bidRequest, callbackId)); | ||
|
|
||
| // store a reference to the bidRequest from the callback id |
There was a problem hiding this comment.
Remove unwanted code
modules/realvuBidAdapter.js
Outdated
| // @endif | ||
| } | ||
| }; | ||
| /* |
There was a problem hiding this comment.
Remove unwanted code
| start: 1504628062271 | ||
| }; | ||
|
|
||
| var bidResponseStub = sinon.stub(bidmanager, 'addBidResponse'); |
There was a problem hiding this comment.
stub needs to be defined and restored in beforeEach and afterEach hooks to avoid errors.
| adapter = new Adapter(); | ||
|
|
||
| describe('load boost', () => { | ||
| adapter.callBids(REQUEST); |
There was a problem hiding this comment.
These test cases are not getting executed.
Your test cases need to be in it. describe is grouping of test cases.
This https://gist.github.com/samwize/8877226 can be helpful.
There was a problem hiding this comment.
The test cases are reorganized.
|
@tchibirev Checks are failing due to linting errors. Also check code coverage using |
|
Could you take a look at last commit? |
* 'master' of https://github.com/prebid/Prebid.js: (414 commits) Make response headers available to the specs (prebid#1748) add option to run tests in a specific file (prebid#1727) Update JCM Adapter to 1.0 (prebid#1715) Finished an unfinished comment. (prebid#1749) Platform.io Bidder Adapter update. Prebid v1.0. (prebid#1705) Fix window.top.host cross origin issue when in nested iframes. (prebid#1730) fix log message not displaying when referencing missing bidder (prebid#1737) Allow more than one placement from one page (prebid#1692) Justpremium Adapter bugfix (prebid#1716) Updating license (prebid#1717) realvuBidAdapter (prebid#1571) Update JSDoc to call the module `pbjs` (prebid#1572) Update Beachfront adapter for v1.0 (prebid#1675) Update AdButler adapter for Prebid v1.0 (prebid#1664) Increment pre version Fix for prebid#1628 (allowing standard bidCpmAdjustment) (prebid#1645) Prebid 0.31.0 Release Support native click tracking (prebid#1691) Initial commit for video support for pbs (prebid#1706) Fixes: Immediate adapter response may end auction (prebid#1690) ...
Type of change
Description of change
New 'realvu' Bid Adapter
Be sure to test the integration with your adserver using the Hello World sample page.
it@realvu.com
Other information