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

Price bucket with 0,3$ step - incorrect granularity #2258

Closed
haroldpussat opened this issue Mar 12, 2018 · 2 comments · Fixed by #2305
Closed

Price bucket with 0,3$ step - incorrect granularity #2258

haroldpussat opened this issue Mar 12, 2018 · 2 comments · Fixed by #2305
Assignees
Labels

Comments

@haroldpussat
Copy link

Type of issue

Question

Description

Hi,
We are using prebid 0.34 with a custom price bucket configuration. This price bucket is divided as below

`var customConfigObject = {
"buckets" : [{
"precision": 2,
"min" : 0.1,
"max" : 7,
"increment" : 0.02
},
{
"precision": 2,
"min" : 7,
"max" : 10,
"increment" : 0.1
},
{
"precision": 2,
"min" : 10,
"max" : 22,
"increment" : 0.3
}]
};

var pbjs = pbjs || {};
pbjs.que = pbjs.que || [];

pbjs.que.push(function() {
    pbjs.enableSendAllBids();
    pbjs.setPriceGranularity(customConfigObject);
    pbjs.setBidderSequence('random');
});

`

For bids below 10$ CPM, there is no issue and the price bucket is validated. But for bid > 10$ CPM and < 22$ CPM, we are facing price issue. The bid sent to DFP doesn't correspond to the granularity.

Example :

The pbjs debug info indicates that the granularity is well setup :
Arguments(1)0: buckets: Array(3)0: {precision: 2, min: 0.1, max: 7, increment: 0.02}1: {precision: 2, min: 7, max: 10, increment: 0.1}2: {precision: 2, min: 10.3, max: 22, increment: 0.3}length: 3__proto__: Array(0)__proto__: Objectcallee: (...)length: 1Symbol(Symbol.iterator): ƒ values()get callee: ƒ ()set callee: ƒ ()__proto__: Object
From a test page, I receive from appnexus a bid valued at 12,92$, see the network answer from appnexus

"creative_id": 90355238, "media_type_id": 1, "media_subtype_id": 1, "cpm": 12.92181, "cpm_publisher_currency": 12.92181, "is_bin_price_applied": false, "publisher_currency_code": "$",

My test page send a hb_pb at 12,90$, instead of 13$ or 12,70$. With that difference, my lineItem is not raised because hb_pb doesn't exist at 12,90$.
It seems the issue is linked with the 0,3$ granularity.
There is no error with pbjs_debug=true, only a warning

prebid.js:3 WARNING: pbjs.setPriceGranularity will be removed in Prebid 1.0. Use pbjs.setConfig({ priceGranularity: }) instead.

I also try to change the min of hte last bucket (change from 10 to 10,3, but still have the issue)

Steps to reproduce

As explained, with a custom bucket configuration and a granularity of 0,3$, the issue is raised.

Test page

If needed I can send you a test page

Expected results

The bucket configuration should be respected from 10$ to 22$ (10$ - 10,3$ - 10,6$ - 10,9$...)

Actual results

Platform details

prebid 0.34 with appnexus, criteo, Smart adapter.
I reproduce the issue with Chrome (last stable version - 64)

Other information

@haroldpussat
Copy link
Author

FYI, issue reproduced with prebid 0.34.4

@mkendall07
Copy link
Member

I think the problem is that the step assumption is from 0 instead of the min bucket. Thanks for the report.

@mkendall07 mkendall07 added the bug label Mar 20, 2018
mkendall07 added a commit that referenced this issue Mar 21, 2018
@mkendall07 mkendall07 self-assigned this Mar 21, 2018
mike-chowla pushed a commit that referenced this issue Mar 30, 2018
* Fixes #2258 - cpm bucketing error

* dealing with imprecise decimal/binary conversions in getCpmTarget()

* just added a comment
dluxemburg pushed a commit to Genius/Prebid.js that referenced this issue Jul 17, 2018
* Fixes prebid#2258 - cpm bucketing error

* dealing with imprecise decimal/binary conversions in getCpmTarget()

* just added a comment
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 a pull request may close this issue.

3 participants