Skip to content
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

Merged
merged 4 commits into from
Mar 19, 2018
Merged

New Content Ignite adapter #2268

merged 4 commits into from
Mar 19, 2018

Conversation

jdrucey
Copy link
Contributor

@jdrucey jdrucey commented Mar 15, 2018

Type of change

  • Bugfix
  • Feature
  • New bidder adapter
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Does this change affect user-facing APIs or examples documented on http://prebid.org?
  • Other

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

  • test parameters for validating bids
{
  bidder: 'contentignite',
  params: {
    accountID: '168237',
    zoneID: '299680'
  }
}

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

Copy link
Collaborator

@bretg bretg left a 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.

@jdrucey
Copy link
Contributor Author

jdrucey commented Mar 16, 2018

@bretg Reverted those hello world changes! Cheers.

Copy link
Collaborator

@jsnellbaker jsnellbaker left a 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.

@@ -0,0 +1,112 @@
'use strict'
Copy link
Collaborator

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 vars 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.

Copy link
Contributor Author

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!

maxCPM = utils.getBidIdParameter('maxCPM', bidObj.params)
width = parseInt(serverResponse.width)
height = parseInt(serverResponse.height)
console.log(serverResponse.cpm)
Copy link
Collaborator

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?

Copy link
Contributor Author

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

var bidResponse = {}
var isCorrectSize = false
var isCorrectCPM = true
var CPM
Copy link
Collaborator

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)?

Copy link
Contributor Author

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

})
if (isCorrectCPM && isCorrectSize) {
bidResponse.requestId = bidObj.bidId
bidResponse.bidderCode = spec.code
Copy link
Collaborator

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?

Copy link
Contributor Author

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

@jdrucey
Copy link
Contributor Author

jdrucey commented Mar 16, 2018

Hi @jsnellbaker, thanks for taking the time to look over the code, we appreciate it.
All your suggestions are very sensible, and i agree it is good to bring this code up-to-date with regards to ES6 standards, i certainly prefer it myself.
I have pushed the fixes and changes so let me know if all is as expected.

Copy link
Collaborator

@jsnellbaker jsnellbaker left a 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

@matthewlane matthewlane merged commit 28e58ff into prebid:master Mar 19, 2018
mifefr added a commit to mifefr/Prebid.js that referenced this pull request Mar 29, 2018
* '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)
dluxemburg pushed a commit to Genius/Prebid.js that referenced this pull request Jul 17, 2018
* initial Content Ignite adapter

* revert hello world example

* Fixes for latest prebid standards

* reformatting with modern keywords
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants