Skip to content

Commit

Permalink
TrustX Bid Adapter: fix for segments format (#7629)
Browse files Browse the repository at this point in the history
* Add trustx adapter and tests for it

* update integration example

* Update trustx adapter

* Post-review fixes of Trustx adapter

* Code improvement for trustx adapter: changed default price type from gross to net

* Update TrustX adapter to support the 1.0 version

* Make requested changes for TrustX adapter

* Updated markdown file for TrustX adapter

* Fix TrustX adapter and spec file

* Update TrustX adapter: r parameter was added to ad request as cache buster

* Add support of gdpr to Trustx Bid Adapter

* Add wtimeout to ad request params for TrustX Bid Adapter

* TrustX Bid Adapter: remove last ampersand in the ad request

* Update TrustX Bid Adapter to support identical uids in parameters

* Update TrustX Bid Adapter to ignore bids that sizes do not match the size of the request

* Update TrustX Bid Adapter to support instream and outstream video

* Added wrapperType and wrapperVersion parameters in ad request for TrustX Bid Adapter

* Update TrustX Bid Adapter to use refererInfo instead depricated function utils.getTopWindowUrl

* HOTFIX for referrer encodind in TrustX Bid Adapter

* Fix test for TrustX Bid Adapter

* TrustX Bid Adapter: added keywords passing support

* TrustX Bid Adapter: added us_privacy parameter in bid request

* TrustX Bid Adapter: fix us_privacy parameter in bid request

* Fix alias error for TrustX Bid Adapter

* TrustX Bid Adapter: added new request format

* TrustX Bid adapter: fix new format endpoint

* TrustX Bid Adapter: update md file to support useNewFormat parameter

* TrustX Bid Adapter: added additional sync url

* TrustX Bid Adapter: added check for enabled syncs number + added gdpr data to sync urls

* TrustX Bid Adapter: added support of meta.advertiserDomains

* TrustX Bid Adapter: added support rtd permutive and jwplayer for new and old request format

* TrustX Bid Adapter: Use new format by default + new keywords logic

* TrustX Bid Adapter: fix md file

* TrustX: Convert all id-like request fields to a string

* TrustX: added vastUrl support

* TrustX: fix segments format
  • Loading branch information
PWyrembak authored Oct 26, 2021
1 parent 6c14892 commit 523a16c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
14 changes: 8 additions & 6 deletions modules/trustxBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -429,9 +429,10 @@ function addSegments(name, segName, segments, data, bidConfigName) {
if (segments && segments.length) {
data.push({
name: name,
segment: segments.map((seg) => {
return {name: segName, value: seg};
})
segment: segments
.map((seg) => seg && (seg.id || seg))
.filter((seg) => seg && (typeof seg === 'string' || typeof seg === 'number'))
.map((seg) => ({ name: segName, value: seg.toString() }))
});
} else if (bidConfigName) {
const configData = config.getConfig('ortb2.user.data');
Expand All @@ -445,9 +446,10 @@ function addSegments(name, segName, segments, data, bidConfigName) {
if (segData && segData.length) {
data.push({
name: name,
segment: segData.map((seg) => {
return {name: segName, value: seg};
})
segment: segData
.map((seg) => seg && (seg.id || seg))
.filter((seg) => seg && (typeof seg === 'string' || typeof seg === 'number'))
.map((seg) => ({ name: segName, value: seg.toString() }))
});
}
}
Expand Down
6 changes: 3 additions & 3 deletions test/spec/modules/trustxBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ describe('TrustXAdapter', function () {
});

it('if segment is present in permutive targeting, payload must have right params', function () {
const permSegments = ['test_perm_1', 'test_perm_2'];
const permSegments = [{id: 'test_perm_1'}, {id: 'test_perm_2'}];
const bidRequestsWithPermutiveTargeting = bidRequests.map((bid) => {
return Object.assign({
rtd: {
Expand All @@ -421,8 +421,8 @@ describe('TrustXAdapter', function () {
expect(payload.user.data).to.deep.equal([{
name: 'permutive',
segment: [
{name: 'p_standard', value: permSegments[0]},
{name: 'p_standard', value: permSegments[1]}
{name: 'p_standard', value: permSegments[0].id},
{name: 'p_standard', value: permSegments[1].id}
]
}]);
});
Expand Down

0 comments on commit 523a16c

Please sign in to comment.