diff --git a/modules/tappxBidAdapter.js b/modules/tappxBidAdapter.js index 3cd77e7b853..c0c47277a06 100644 --- a/modules/tappxBidAdapter.js +++ b/modules/tappxBidAdapter.js @@ -251,6 +251,7 @@ function buildOneRequest(validBidRequests, bidderRequest) { const BIDEXTRA = deepAccess(validBidRequests, 'params.ext'); const bannerMediaType = deepAccess(validBidRequests, 'mediaTypes.banner'); const videoMediaType = deepAccess(validBidRequests, 'mediaTypes.video'); + const ORTB2 = config.getConfig()?.ortb2; // let requests = []; let payload = {}; @@ -301,12 +302,8 @@ function buildOneRequest(validBidRequests, bidderRequest) { } banner.api = api; - - let format = {}; - format[0] = {}; - format[0].w = w; - format[0].h = h; - banner.format = format; + const formatArr = bannerMediaType.sizes.map(size => ({w: size[0], h: size[1]})) + banner.format = Object.assign({}, formatArr); imp.banner = banner; } @@ -393,6 +390,14 @@ function buildOneRequest(validBidRequests, bidderRequest) { let geo = {}; geo.country = deepAccess(validBidRequests, 'params.geo.country'); // < Device object + let configGeo = {}; + configGeo.country = ORTB2?.device?.geo; + + if(typeof configGeo.country !== 'undefined'){ + device.geo = configGeo; + }else if(typeof geo.country !== 'undefined' ){ + device.geo = geo; + }; // > GDPR let user = {}; diff --git a/modules/tappxBidAdapter.md b/modules/tappxBidAdapter.md index 677718c261c..55f18531f28 100644 --- a/modules/tappxBidAdapter.md +++ b/modules/tappxBidAdapter.md @@ -92,3 +92,20 @@ Ads sizes available: [300,250], [320,50], [320,480], [480,320], [728,90], [768,1 } ]; ``` +### Configuration + +Use `setConfig` to configure this submodule ortb2.device.geo, this will allow geolocation +`Geo` object to bring First Party Information. + +```javascript +var TIMEOUT = 1000; +pbjs.setConfig({ + ortb2:{ + device:{ + geo:{ + country:'US' + } + } + } +}); +```