Skip to content

Commit

Permalink
oneVideo Adapter: User sync pixel updates (VIDEOPUB-17981) (#5583)
Browse files Browse the repository at this point in the history
* updated DBM sync pixel to ups/57304 + removed yahoo sync pixel

* updated unit tests

* updated GDPR tests

* Update package-lock.json

* Update package-lock.json

* update local branch to origin

* added sync pixel unit tests

* Update package-lock.json
  • Loading branch information
adam-browning authored Aug 18, 2020
1 parent c0850e9 commit b01fe09
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
13 changes: 4 additions & 9 deletions modules/oneVideoBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ import {registerBidder} from '../src/adapters/bidderFactory.js';
const BIDDER_CODE = 'oneVideo';
export const spec = {
code: 'oneVideo',
VERSION: '3.0.3',
VERSION: '3.0.4',
ENDPOINT: 'https://ads.adaptv.advertising.com/rtb/openrtb?ext_id=',
E2ETESTENDPOINT: 'https://ads-wc.v.ssp.yahoo.com/rtb/openrtb?ext_id=',
SYNC_ENDPOINT1: 'https://cm.g.doubleclick.net/pixel?google_nid=adaptv_dbm&google_cm&google_sc',
SYNC_ENDPOINT2: 'https://pr-bh.ybp.yahoo.com/sync/adaptv_ortb/{combo_uid}',
SYNC_ENDPOINT3: 'https://match.adsrvr.org/track/cmf/generic?ttd_pid=adaptv&ttd_tpi=1',
SYNC_ENDPOINT1: 'https://pixel.advertising.com/ups/57304/sync?gdpr=&gdpr_consent=&_origin=0&redir=true',
SYNC_ENDPOINT2: 'https://match.adsrvr.org/track/cmf/generic?ttd_pid=adaptv&ttd_tpi=1',
supportedMediaTypes: ['video', 'banner'],
/**
* Determines whether or not the given bid request is valid.
Expand Down Expand Up @@ -136,17 +135,13 @@ export const spec = {
type: 'image',
url: spec.SYNC_ENDPOINT1
},
{
type: 'image',
url: spec.SYNC_ENDPOINT2
},
{
type: 'image',
url: `https://sync-tm.everesttech.net/upi/pid/m7y5t93k?gdpr=${gdprApplies ? 1 : 0}&gdpr_consent=${consentString}&redir=https%3A%2F%2Fpixel.advertising.com%2Fups%2F55986%2Fsync%3Fuid%3D%24%7BUSER_ID%7D%26_origin%3D0` + encodeURI(`&gdpr=${gdprApplies ? 1 : 0}&gdpr_consent=${consentString}`)
},
{
type: 'image',
url: spec.SYNC_ENDPOINT3
url: spec.SYNC_ENDPOINT2
}];
}
}
Expand Down
19 changes: 15 additions & 4 deletions test/spec/modules/oneVideoBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ describe('OneVideoBidAdapter', function () {
const placement = bidRequest.params.video.placement;
const rewarded = bidRequest.params.video.rewarded;
const inventoryid = bidRequest.params.video.inventoryid;
const VERSION = '3.0.3';
const VERSION = '3.0.4';
expect(data.imp[0].video.w).to.equal(width);
expect(data.imp[0].video.h).to.equal(height);
expect(data.imp[0].bidfloor).to.equal(bidRequest.params.bidfloor);
Expand Down Expand Up @@ -593,14 +593,25 @@ describe('OneVideoBidAdapter', function () {

it('should get correct user sync when iframeEnabled', function () {
let pixel = spec.getUserSyncs({pixelEnabled: true}, {}, {gdprApplies: true, consentString: GDPR_CONSENT_STRING})
expect(pixel[2].type).to.equal('image');
expect(pixel[2].url).to.equal('https://sync-tm.everesttech.net/upi/pid/m7y5t93k?gdpr=1&gdpr_consent=' + GDPR_CONSENT_STRING + '&redir=https%3A%2F%2Fpixel.advertising.com%2Fups%2F55986%2Fsync%3Fuid%3D%24%7BUSER_ID%7D%26_origin%3D0&gdpr=1&gdpr_consent=' + encodeURI(GDPR_CONSENT_STRING));
expect(pixel[1].type).to.equal('image');
expect(pixel[1].url).to.equal('https://sync-tm.everesttech.net/upi/pid/m7y5t93k?gdpr=1&gdpr_consent=' + GDPR_CONSENT_STRING + '&redir=https%3A%2F%2Fpixel.advertising.com%2Fups%2F55986%2Fsync%3Fuid%3D%24%7BUSER_ID%7D%26_origin%3D0&gdpr=1&gdpr_consent=' + encodeURI(GDPR_CONSENT_STRING));
});

it('should default to gdprApplies=0 when consentData is undefined', function () {
let pixel = spec.getUserSyncs({pixelEnabled: true}, {}, undefined);
expect(pixel[2].url).to.equal('https://sync-tm.everesttech.net/upi/pid/m7y5t93k?gdpr=0&gdpr_consent=&redir=https%3A%2F%2Fpixel.advertising.com%2Fups%2F55986%2Fsync%3Fuid%3D%24%7BUSER_ID%7D%26_origin%3D0&gdpr=0&gdpr_consent=');
expect(pixel[1].url).to.equal('https://sync-tm.everesttech.net/upi/pid/m7y5t93k?gdpr=0&gdpr_consent=&redir=https%3A%2F%2Fpixel.advertising.com%2Fups%2F55986%2Fsync%3Fuid%3D%24%7BUSER_ID%7D%26_origin%3D0&gdpr=0&gdpr_consent=');
});
});

describe('verify sync pixels', function () {
let pixel = spec.getUserSyncs({pixelEnabled: true}, {}, undefined);
it('should be UPS sync pixel for DBM', function () {
expect(pixel[0].url).to.equal('https://pixel.advertising.com/ups/57304/sync?gdpr=&gdpr_consent=&_origin=0&redir=true')
});

it('should be TTD sync pixel', function () {
expect(pixel[2].url).to.equal('https://match.adsrvr.org/track/cmf/generic?ttd_pid=adaptv&ttd_tpi=1')
});
})
});
});

0 comments on commit b01fe09

Please sign in to comment.