Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions modules/tappxBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {};
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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 = {};
Expand Down
17 changes: 17 additions & 0 deletions modules/tappxBidAdapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
}
}
});
```