-
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
New Content Ignite adapter #2268
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.
@jdrucey - please back out the changes to integrationExamples/gpt/hello_world.html.
@bretg Reverted those hello world changes! Cheers. |
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 @jdrucey Thanks for submitting this new adapter. While overall things seem to be good, there are a few items that should be reviewed/updated. Can you please review and make the recommended changes?
On a separate note - while I was testing the adapter using the hello_world page, I initially wasn't seeing the bid render on the page even though there was a response coming back from your system. When I looked further, I noticed the issue was due differences in the requested/received sizes of the ad unit. I had the hello_world page configured for 300x250
or 300x600
ads, where the test params were configured for 728x90
. I realized the bid wasn't accepted due to the internal check you perform in the interpretResponse
, so it was silently rejected (ie nothing in the console statements like a warning/info message).
While it's not explicitly required, it may be helpful to send out a message (using utils.logWarn
or utils.logInfo
) when something doesn't pass a check so it's easier to debug later.
modules/contentigniteBidAdapter.js
Outdated
@@ -0,0 +1,112 @@ | |||
'use strict' |
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.
I'm guessing this was copied over from the AdButler adapter, but this isn't really needed. This is actually automatically applied onto the adapter files when pbjs is built and the file's are converted to comply with the setting.
As a general note, the file should ideally be written with ES6 standards (eg replacing var
s with let
and const
where appropriate, ending statements with ;
). I realize there's a bit to change in this regard, but it's a recommendation we've been asking for all 1.0 adapters to keep the code updated and consistent.
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.
Ive now introduced arrow functions, const/let usage and reformatted with semi-colons. Would be really neat if there could be a Prettier config file added to the Prebid.js project. It is something we use a lot our end to auto-format js, and while it is very opinionated (by design) there are some settings for project based preference, like the semi-colons in this case. Not sure if this has been considered before, but just an idea!
modules/contentigniteBidAdapter.js
Outdated
maxCPM = utils.getBidIdParameter('maxCPM', bidObj.params) | ||
width = parseInt(serverResponse.width) | ||
height = parseInt(serverResponse.height) | ||
console.log(serverResponse.cpm) |
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 remove this console.log
statement?
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.
Sorry about that! i could have sworn i removed it! ha
modules/contentigniteBidAdapter.js
Outdated
var bidResponse = {} | ||
var isCorrectSize = false | ||
var isCorrectCPM = true | ||
var CPM |
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.
Does CPM
need to be in all caps? Can you make it consistent with the other variables syntax (camelCase)?
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.
Have reverted to lowercase cpm
modules/contentigniteBidAdapter.js
Outdated
}) | ||
if (isCorrectCPM && isCorrectSize) { | ||
bidResponse.requestId = bidObj.bidId | ||
bidResponse.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.
The bidderCode
does not need to be populated here; it's actually managed by the prebid code in our bidderFactory
's code. Can you please remove this line?
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 has now been removed
Hi @jsnellbaker, thanks for taking the time to look over the code, we appreciate it. |
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.
@jdrucey Thanks for making the changes.
LGTM
* 'master' of https://github.com/prebid/Prebid.js: EngageBDR New Bid Adapter (prebid#2309) [FEAT] adunit sizes support (prebid#2320) Support aliases in prebidServer (prebid#2257) Changing default currency file to https (prebid#2306) Update stalebot labels (prebid#2319) Enhance location detection within utils (prebid#2167) if cache markup is not enabled, set it to the default value 0 (prebid#2302) Serverbid Bid Adapter: Added archon alias (prebid#2293) Smart Ad Server: Fix bug when multi bids (prebid#2170) NEW adapter AdtelligentBidAdapter (prebid#2137) add optional param to bridgewellBidAdapter (prebid#2289) Increment Pre Version Prebid 1.6.0 Release Unit test fixes (prebid#2301) PBS videoCacheKey and vastUrl (prebid#2101) Add Oneplanetonly Bid Adapter (prebid#2269) firing new adRenderFailed event when renderAd() fails (prebid#2210) Add Content Ignite adapter (prebid#2268) add hb_cache_id, hb_uuid should be deprecated and replaced by hb_cache_id (prebid#2273) Update Yieldlab adapter and add official maintainer (prebid#2231) Update for Media.net adapter (prebid#2232) Update to Rubicon Adapter for mediaTypes support (prebid#2272) message formatting (prebid#2285) Yieldbot impression image creation fix (prebid#2277) Updated Bid params (prebid#2275) Audience Network: Add 'pbv' and 'cb' query params (prebid#2252) Add e-planning analytics adapter (prebid#2211) Add vastUrl for Gamma Adapter Video (prebid#2261) update params for test bid (prebid#2267) Updated adUnitCode (prebid#2262)
* initial Content Ignite adapter * revert hello world example * Fixes for latest prebid standards * reformatting with modern keywords
Type of change
Description of change
Adding a new adapter for Content Ignite
Initially based on AdButler as used by our backend, but soon to introduce video and native
Be sure to test the integration with your adserver using the Hello World sample page.
For any changes that affect user-facing APIs or example code documented on http://prebid.org, please provide:
Other information