prebid / Prebid.js

Setup and manage header bidding advertising partners without writing code or confusing line items. Prebid.js is open source and free.
http://prebid.org
Apache License 2.0
1.26k stars 2.03k forks source link

Need help regarding Prebid new adapter #11948

Open soman opened 2 weeks ago

soman commented 2 weeks ago

Type of issue

question

Description

I am trying to implement a new Prebid adapter. I need an IP address, country, and device related information on the API end from the new Prebid adapter. How can I achieve this?

I know I can pass an IP address, country, and device information from the publisher end with various ways of prebid setConfig.

Can I use a third-party API to fetch an IP address such as Maxmind from the Prebid adapter?

Steps to reproduce

Test page

Expected results

Actual results

Platform details

Other information

dgirardi commented 2 weeks ago

By default your adapter gets some information about the device. Geolocation is not part of it, but as you say the publisher can decide to set it up.

Can I use a third-party API to fetch an IP address such as Maxmind from the Prebid adapter?

If you mean from the client, probably not ("Bidder modules must not make requests to endpoints for functionality other than auctions."). You can ask for an exception, I don't think we have a precedent because this is typically easier to do server side (which is out of scope for this forum).

soman commented 2 weeks ago

If I understand your response correctly, I can't do anything with a third-party API from the prebid adapter code.

Have any prebid modules for passing geolocation?

How can I pass the IP address of the publisher from the client side using any prebid module or other way except a third-party API?

dgirardi commented 2 weeks ago

There's a geolocation RTD module: https://docs.prebid.org/dev-docs/modules/geolocationRtdProvider.html You can also contribute RTD modules yourself, which are free to call 3rd party APIs. The difference is that publishers can control it separately from bid modules, and they should be able to benefit any bidder, not just yours.

Your endpoint always gets the IP address of those that call it. (It's actually easier to figure out the IP from the server than it is from the client). However the traffic to your endpoint may be scrambled and in that case you need collaboration from the publisher (see: https://github.com/prebid/Prebid.js/issues/11395)