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

Standard bidCpmAdjustment not working #1628

Closed
dugwood opened this issue Sep 27, 2017 · 5 comments
Closed

Standard bidCpmAdjustment not working #1628

dugwood opened this issue Sep 27, 2017 · 5 comments

Comments

@dugwood
Copy link
Contributor

dugwood commented Sep 27, 2017

Type of issue

bidCpmAdjustment set on standard doesn't work.

Description

In the documentation: http://prebid.org/dev-docs/publisher-api-reference.html#module_pbjs.bidderSettings
=> bidCpmAdjustment is either for standard or adapter-specific

But:
https://github.com/prebid/Prebid.js/blob/master/src/bidmanager.js#L434
=> here we only look for the bidderCode (adapter-specific) function

And:
https://github.com/prebid/Prebid.js/blob/master/src/bidmanager.js#L453
=> here we never set the function if not defined

Steps to reproduce

Set:

pbjs.bidderSettings = {
    standard: {
        bidCpmAdjustment: function (bidCpm, bid) { console.log(bidCpm); return bidCpm; }
    }
};

Expected results

The console should log the bidCpm value

Actual results

No log (so no adjustment)

Platform details

Prebid: 0.29.0

@mkendall07
Copy link
Member

@dugwood thanks for the report. This has always been the case, the documentation is wrong. What's the use case to adjust all the bids?

@dugwood
Copy link
Contributor Author

dugwood commented Sep 27, 2017

Thanks @mkendall07. I should fix the documentation :-)

So far I was using it with a common function, that logs (in a debug mode) and adjust CPMs according to another external setting. For example:

grossToNet: {
  appnexusAst: 0.9, // value isn't the real one, just to illustrate
  rubicon: 0.95,
  indexExchange: 0.85
}

Now that all plaforms are sending the net revenue, it's indeed useless. So far I was looping on all bidders to set the bidCpmAdjustment (for every call, that was not that great), and just found out about the standard property. So I just tried to use it :-)

Although I could use the event, I still need to set the bidCpm to zero if it's under a predefined CPM, which is set on the platform (APN, ...) but also in our code because some platform don't have minimum CPM settings.

So a standard setting would be great. But I can do as before, setting it to the same function for every bidder (once and for all, not for each auction).

@mkendall07
Copy link
Member

I can see how this is more maintainable than setting individual bidder settings. We accept PRs :)

@dugwood
Copy link
Contributor Author

dugwood commented Sep 30, 2017

@mkendall07 it's done :-) Had a difficult time running tests (sooooo long!), but in the end I think it's better that the function is implemented than the documentation changed.

jaiminpanchal27 pushed a commit that referenced this issue Oct 17, 2017
* Added standard bidCpmAdjustment

* Fix missing «typeof»
@jaiminpanchal27
Copy link
Collaborator

Fixed in #1645.

outoftime pushed a commit to Genius/Prebid.js that referenced this issue Oct 18, 2017
* tag '0.31.0' of https://github.com/prebid/Prebid.js: (54 commits)
  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)
  Rubicon feature/s2s test module (prebid#1678)
  Renaming of "huddledmasses" adapter into colossusssp (prebid#1701)
  Don't set non-object configurations (prebid#1704)
  Update JSDoc for `pbjs.enableAnalytics` (prebid#1565)
  Add ad units event (prebid#1702)
  AppnexusAst adapter: logging error message from endpoint (prebid#1697)
  AppnexusAst bidadapter markdown file (prebid#1696)
  Change Default Content-Type for POST Requests to 'application/json' (prebid#1681)
  Code improvement for trustx adapter (prebid#1673)
  PulsePoint Lite adapter - Enabling Sync pixel (prebid#1686)
  Update spotx video adapter to set the spotx_ad_key used in DFP (prebid#1614)
  Fix broken AOL mobile endpoint secure bid requests (prebid#1684)
  Fix adapter tests that hardcoded pbjs. (prebid#1666)
  no longer attaching gpt slots to adUnits, which breaks utils.cloneJson(adUnit) (prebid#1676)
  remove bidmanager from rubicon tests (prebid#1671)
  ...
Millerrok pushed a commit to Vertamedia/Prebid.js that referenced this issue Oct 25, 2017
* '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)
  ...
vzhukovsky added a commit to aol/Prebid.js that referenced this issue Oct 30, 2017
….31.0 to aolgithub-master

* commit 'e7341c948014a789084849495171d08d4b353d07': (21 commits)
  Added changelog entry.
  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)
  Rubicon feature/s2s test module (prebid#1678)
  Renaming of "huddledmasses" adapter into colossusssp (prebid#1701)
  Don't set non-object configurations (prebid#1704)
  Update JSDoc for `pbjs.enableAnalytics` (prebid#1565)
  Add ad units event (prebid#1702)
  AppnexusAst adapter: logging error message from endpoint (prebid#1697)
  AppnexusAst bidadapter markdown file (prebid#1696)
  Change Default Content-Type for POST Requests to 'application/json' (prebid#1681)
  Code improvement for trustx adapter (prebid#1673)
  PulsePoint Lite adapter - Enabling Sync pixel (prebid#1686)
  Update spotx video adapter to set the spotx_ad_key used in DFP (prebid#1614)
  Fix broken AOL mobile endpoint secure bid requests (prebid#1684)
  Fix adapter tests that hardcoded pbjs. (prebid#1666)
  no longer attaching gpt slots to adUnits, which breaks utils.cloneJson(adUnit) (prebid#1676)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants