I'm trying to find the way to set custom geo data to Prebid.js bidders request.
I found that there's a official geolocation module that checks user's permssion on the front to get it.
I found in the code that there's requestBidsObject.ortb2Fragments.global.device.geo
attribute were set to needed value:
deepSetValue(requestBidsObject, 'ortb2Fragments.global.device.geo', {
lat: geolocation.coords.latitude,
lon: geolocation.coords.longitude,
lastfix: Math.round((timestamp() - geolocation.timestamp) / 1000),
type: 1
});
Is there a legal way to set it with some custom data before sendign the bidders requests?
I've created a new module for this issue, just added the new file called
customGeolocationRtdProvider.js
which contents:To build the new
prebid.js
i've just added the new line to mymodules.json
:Now i can provide the geolocation json right to prebid config: