prebid-server icon indicating copy to clipboard operation
prebid-server copied to clipboard

Feature request: GeoLocation (Ip2Country)

Open josepowera opened this issue 3 years ago • 6 comments

In Prebid-server-java we see https://github.com/prebid/prebid-server-java/blob/c5e7782b15c3bd47267a9268fd25a21a8bf34d98/src/main/java/org/prebid/server/geolocation/MaxMindGeoLocationService.java geolocation services.

In Prebid-server (Go) no reference to any geolocation database (maxmind?) is found.

We see filtering based on Geo.Country as one of the most important filters in the campaign, and having this data already in bidrequest to DSP simplifies filtering. This is even more important in case where enduser ip is masked (x.x.x.0)

Our feature request is that prebid-server fills Geolocation (country, city) in openrtb.geo fields.

josepowera avatar Aug 11 '22 09:08 josepowera

Hi @josepowera. We appreciate the feature request, however the team prefers to lean on community contributions for this. If you or someone else is interested in leading the development of this feature, we are happy to review and provide feedback.

bsardo avatar Aug 16 '22 16:08 bsardo

@josepowera - we would welcome your contribution to the project. I will note that the implementation of the GDPR feature in PBS-Java masks the IP address before doing the geo-lookup. This is because our understanding of the intention of GDPR is better aligned with a policy of location privacy. We debated this aspect and determined that we could not afford to do two IP lookups: one unmasked and one masked... too expensive.

The algorithm is documented in the flowchart at https://docs.google.com/document/d/1g0zAYc_EfqyilKD8N2qQ47uz0hdahY-t8vfb-vxZL5w/edit#heading=h.yjh8s4sv17vv

bretg avatar Sep 01 '22 13:09 bretg

just let you know that I'm working on this feature. please assigns this task to me if possible

aptxx avatar Aug 03 '24 06:08 aptxx

@aptxx - that's good news, thanks! Some notes...

  1. The system needs to architected so it can support different lookup services. You don't have to build them all, but it needs to be possible for others to swap in a different service.

  2. There's been a change in PBS-Java since the comment from 2 years ago - it's doing the IP lookup before masking the address, but in PreciseGeo anonymization scenarios it places only the following fields in the device.geo object: country, region, and utcOffset. Don't place any other fields (metro, city, etc) in privacy scenarios.

  3. Please make sure that the values placed into the OpenRTB match the ORTB spec:

  • country: ISO-3166-1-alpha-3
  • region: ISO-3166-2; 2-letter state code if USA

This is important because some IP lookup services use different values. e.g. if your service uses 2-letter country codes, a map from 2-to-3 is needed.

  1. PBS standard is to prefer values that come in on the request. i.e. if device.geo.country is on the request, don't replace it with the value from the service.

bretg avatar Aug 03 '24 13:08 bretg

@bretg thank you for notes, that's so helpful

aptxx avatar Aug 04 '24 12:08 aptxx

@bretg hi bretg, PR has been submitted, please take a look, thanks

aptxx avatar Aug 27 '24 11:08 aptxx