diff --git a/extra/modules/greenbids-real-time-data/src/main/java/org/prebid/server/hooks/modules/greenbids/real/time/data/core/GreenbidsInferenceDataService.java b/extra/modules/greenbids-real-time-data/src/main/java/org/prebid/server/hooks/modules/greenbids/real/time/data/core/GreenbidsInferenceDataService.java index 3bd3e37b859..b0303f16d69 100644 --- a/extra/modules/greenbids-real-time-data/src/main/java/org/prebid/server/hooks/modules/greenbids/real/time/data/core/GreenbidsInferenceDataService.java +++ b/extra/modules/greenbids-real-time-data/src/main/java/org/prebid/server/hooks/modules/greenbids/real/time/data/core/GreenbidsInferenceDataService.java @@ -6,6 +6,7 @@ import com.fasterxml.jackson.databind.node.ObjectNode; import com.iab.openrtb.request.BidRequest; import com.iab.openrtb.request.Device; +import com.iab.openrtb.request.Geo; import com.iab.openrtb.request.Imp; import com.maxmind.geoip2.DatabaseReader; import com.maxmind.geoip2.exception.GeoIp2Exception; @@ -86,12 +87,16 @@ private List extractMessagesForImp( final String ip = Optional.ofNullable(bidRequest.getDevice()) .map(Device::getIp) .orElse(null); - final String countryFromIp = getCountry(ip); + final String country = Optional.ofNullable(bidRequest.getDevice()) + .map(Device::getGeo) + .map(Geo::getCountry) + .orElse(getCountry(ip)); + return createThrottlingMessages( bidderNode, impId, greenbidsUserAgent, - countryFromIp, + country, hostname, hourBucket, minuteQuadrant);