HuddledMasses header bidding adapter#1806
HuddledMasses header bidding adapter#1806mkendall07 merged 9 commits intoprebid:masterfrom HuddledMasses:master
Conversation
|
@HuddledMasses |
|
@mkendall07 |
|
@HuddledMasses |
|
@mkendall07 |
|
Hi @mkendall07 Any update on this? will appreciate. Thanks! |
modules/huddledmassesBidAdapter.js
Outdated
| */ | ||
| isBidRequestValid: (bid) => { | ||
| return (!isNaN(bid.params.placement_id) && | ||
| ((bid.params.sizes != undefined && bid.params.sizes.length > 0 && bid.params.sizes.some((sizeIndex) => INDEX_SIZE[sizeIndex] != undefined)) || |
There was a problem hiding this comment.
we prefer triple equality (!==).
modules/huddledmassesBidAdapter.js
Outdated
| '800x250': 118, | ||
| '200x600': 119 | ||
| }; | ||
| const INDEX_SIZE = { |
There was a problem hiding this comment.
You don't need to duplicate this data. You can do a reverse lookup by iterating the object properties.
modules/huddledmassesBidAdapter.js
Outdated
| } catch (e) { | ||
| console.log(e); | ||
| }; | ||
| let location = winTop.location; |
There was a problem hiding this comment.
You can use utils.getTopWindowLocation() instead of the code above: https://github.com/prebid/Prebid.js/blob/master/src/utils.js#L157
modules/huddledmassesBidAdapter.js
Outdated
| } | ||
| } | ||
| } catch (e) { | ||
| console.log(e); |
There was a problem hiding this comment.
please use utils.logMessage() instead
modules/huddledmassesBidAdapter.md
Outdated
| ``` | ||
| Module Name: HuddledMasses Bidder Adapter | ||
| Module Type: Bidder Adapter | ||
| Maintainer: prebid@example.com |
| interpretResponse: (serverResponse) => { | ||
| let response = []; | ||
| try { | ||
| serverResponse = serverResponse.body; |
There was a problem hiding this comment.
this line needs to be serverResponse.body.body;. Otherwise no bids are returned.
There was a problem hiding this comment.
Here I do not agree.
Example response:
{
"body": [{
"width": 300,
"height": 250,
"ad": "<img src='http://supply.huddledmasses.com/img/logo.png' style='position: absolute; left: 50%; top:50%; margin-left: -113px; margin-top:-79px;'>",
"requestId": "26042378f97b21",
"cpm": 5,
"ttl": 120,
"creativeId": "123",
"netRevenue": true,
"currency": "USD",
"dealId": "HASH"
}]
}
There was a problem hiding this comment.
it's broke. Run the code
There was a problem hiding this comment.
I cant understand whats wrong.
Why doesn't it work for you.
Here is the test page with the given adapter:
http://hb-test.huddledmassessupply.com/
I do not understand why it does not work for you.
There was a problem hiding this comment.
@HuddledMasses
The API changed. Please rebase to master.
On your test page replace http://hb-test.huddledmassessupply.com/prebid-core.js with the latest code and you will see the issue.
There was a problem hiding this comment.
Here is the code changed: https://github.com/prebid/Prebid.js/blob/master/src/adapters/bidderFactory.js#L285
There was a problem hiding this comment.
I replaced the response at the server level.
Now it should work
[{
"width": 300,
"height": 250,
"ad": "<img src='http://supply.huddledmasses.com/img/logo.png' style='position: absolute; left: 50%; top:50%; margin-left: -113px; margin-top:-79px;'>",
"requestId": "26042378f97b21",
"cpm": 5,
"ttl": 120,
"creativeId": "123",
"netRevenue": true,
"currency": "USD",
"dealId": "HASH"
}]
|
All rights are included. |
* unstream/master: (36 commits) + Add Optimatic Bid Adapter (prebid#1837) Add Bridgewell adapter (prebid#1825) Kumma adapter updated for Prebid 1.0 (prebid#1766) Touchup add bid response (prebid#1822) Fix skipped test (prebid#1836) Added new size in Rubicon pbjs Adapter (prebid#1842) HuddledMasses header bidding adapter (prebid#1806) Increment pre version Prebid 0.33.0 Release Update AOL adapter for v1.0 (prebid#1693) Sovrn 1.0 compliance (prebid#1796) Platform.io Bidder Adapter update (prebid#1817) Drop non-video bidders from video ad units (prebid#1815) Update renderAd to replace ${AUCTION_PRICE} in adUrl (prebid#1795) Pulsepoint adapter: fixing bid rejection due to missing mandatory bid params. (prebid#1823) Remove require.ensure entirely (prebid#1816) Add custom keyword support for pbs bid adapter (prebid#1763) OpenX Video Adapter update to Prebid v1.0 (prebid#1724) Fix test that hard-coded pbjs global. (prebid#1786) Update Pollux Adapter to v1.0 (prebid#1694) ...
Type of change
Description of change
Add adapter and tests for the HuddledMasses header bidding adapter