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

hb_pb: "" with custom price granularity inside pbjs.setBidderConfig #12098

Closed
CMDezz opened this issue Aug 7, 2024 · 2 comments
Closed

hb_pb: "" with custom price granularity inside pbjs.setBidderConfig #12098

CMDezz opened this issue Aug 7, 2024 · 2 comments

Comments

@CMDezz
Copy link
Contributor

CMDezz commented Aug 7, 2024

Type of issue

Bug

Description

priceGranularity worked like a charm with low, medium and high but there is "" with custom granularities when i used it with pbjs.setBidderConfig

Steps to reproduce

  • This is the config
pbjs.setBidderConfig({
    bidders: ['bidder'],
    config: {
        // "priceGranularity": "high", //worked as normal
        priceGranularity: {  // hb_pb become undefined
            buckets: [
                {
                    "precision": 2,
                    "max": 10,
                    "increment": 0.01
                }
            ]
        },
    }
})
  • This is response from bidder adapter:
{
    "ad": "ad_2000038474",
    "adUnitCode": "/19968336/prebid_native_example_1",
    "cpm": 0.7526081296409829,
    "creativeId": "2000038474",
    "currency": "USD",
    "height": 250,
    "impid": "0632a073c745d6c",
    "netRevenue": false,
    "requestId": "3090bf0e713b45",
    "ttl": 300,
    "width": 300
}
  • This is result after targeting:
{
    "hb_bidder": "bidder",
    "hb_adid": "54690138071e21",
    "hb_size": "0x0",
    "hb_source": "client",
    "hb_format": "banner",
    "hb_adomain": "",
    "hb_crid": "2000309476",
    "hb_pb":"",
}
  • What i am expecting:
 "hb_pb": "0.75",
@CMDezz CMDezz changed the title hb_pb: undefined with custom price granularity inside pbjs.setBidderConfig hb_pb: undefined with custom price granularity inside pbjs.setBidderConfig Aug 7, 2024
@dgirardi
Copy link
Collaborator

dgirardi commented Aug 7, 2024

Does this work for you?

pbjs.setBidderConfig({
    bidders: ['bidder'],
    config: {
        priceGranularity: 'custom',
        customPriceBucket: {
            buckets: [
                {
                    "precision": 2,
                    "max": 10,
                    "increment": 0.01
                }
            ]
        },
    }
});

You config should automatically get translated into that and I believe there's a bug where it doesn't when it's set via setBidderConfig. But I get a different result (empty string, hb_pb: "", rather than undefined), so I'm wondering if you're seeing something else.

@CMDezz CMDezz changed the title hb_pb: undefined with custom price granularity inside pbjs.setBidderConfig hb_pb: "" with custom price granularity inside pbjs.setBidderConfig Aug 8, 2024
@CMDezz
Copy link
Contributor Author

CMDezz commented Aug 8, 2024

Does this work for you?

pbjs.setBidderConfig({
    bidders: ['bidder'],
    config: {
        priceGranularity: 'custom',
        customPriceBucket: {
            buckets: [
                {
                    "precision": 2,
                    "max": 10,
                    "increment": 0.01
                }
            ]
        },
    }
});

You config should automatically get translated into that and I believe there's a bug where it doesn't when it's set via setBidderConfig. But I get a different result (empty string, hb_pb: "", rather than undefined), so I'm wondering if you're seeing something else.

Sorry for the mistake. Yes, we saw the same thing, it was an "" with hb_pb.
Thank you for your solution, it worked for me.

@CMDezz CMDezz closed this as completed Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

2 participants