Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added tdid and ad-unit-code #23

Closed
wants to merge 23 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
3f6c9be
added tdid and ad-unit-code
Jun 16, 2020
06ed63b
fixed tdid
Jun 16, 2020
27654f1
merged master
Jun 17, 2020
5ac08c6
PubMatic bid adapter to support price floors module (#5387)
pm-harshad-mane Jun 18, 2020
9b4def5
Triplelift Adaptor: Use Floors Module (#5329)
colbertk Jun 18, 2020
7421370
removed digitrust
Jun 18, 2020
a394bc6
appnexusBidAdapter - fix video params (#5394)
jsnellbaker Jun 19, 2020
aa877b2
PubMatic adds support for bidUserIdAsEids (#5397)
pm-harshad-mane Jun 19, 2020
cab6058
repush
jrosendahl Jun 19, 2020
4e59331
External ids (#5351)
lowendavid Jun 22, 2020
57f8beb
33Across: CCPA Compliance + Schain support (#5365)
curlyblueeagle Jun 22, 2020
ba6d904
added waardex adapter (#5349)
mshuhaliia Jun 22, 2020
cc845b0
Add customParams to yieldlab configuration (#5374)
mirkorean Jun 22, 2020
263c6cc
Vidazoo Adapter: Feature/user-id (#5386)
uditalias Jun 23, 2020
d9d7c0c
LiveIntentId submodule updates (#5407)
jankoulaga Jun 23, 2020
18d1e10
33Across: Adding floors support (#5408)
curlyblueeagle Jun 23, 2020
9c47806
Vidazoo Adapter: Feature/screen-size (#5385)
uditalias Jun 23, 2020
6cfe4cc
Appier: add support for aliases (#5392)
justinkuo-appier Jun 23, 2020
3857643
Add GMOSSP Adapter (#5377)
arasaki-yuki Jun 24, 2020
cf33ada
add package-lock from upstream master
jrosendahl Jun 24, 2020
ca2f896
Delete package-lock.json
jrosendahl Jun 24, 2020
72a4d7a
add package-lock from upstream master
jrosendahl Jun 24, 2020
09a92ba
Merge remote-tracking branch 'upstream/master' into SNEK-320-TDID
jrosendahl Jun 24, 2020
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
10 changes: 10 additions & 0 deletions integrationExamples/gpt/userId_example.html
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,16 @@
name: "sharedid",
expires: 28
}
}, {
name: "liveIntentId",
params: {
publisherId: "9896876"
},
storage: {
type: "cookie",
name: "_li_pbid",
expires: 28
}
}],
syncDelay: 5000,
auctionDelay: 1000
Expand Down
95 changes: 81 additions & 14 deletions modules/33acrossBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@ import * as utils from '../src/utils.js';
const BIDDER_CODE = '33across';
const END_POINT = 'https://ssc.33across.com/api/v1/hb';
const SYNC_ENDPOINT = 'https://ssc-cms.33across.com/ps/?m=xch&rt=html&ru=deb';
const MEDIA_TYPE = 'banner';
const CURRENCY = 'USD';

const adapterState = {};
const adapterState = {
uniqueSiteIds: []
};

const NON_MEASURABLE = 'nm';

Expand Down Expand Up @@ -65,11 +69,27 @@ function _getAdSlotHTMLElement(adUnitCode) {

// Infer the necessary data from valid bid for a minimal ttxRequest and create HTTP request
// NOTE: At this point, TTX only accepts request for a single impression
function _createServerRequest(bidRequest, gdprConsent = {}, pageUrl) {
function _createServerRequest({bidRequest, gdprConsent = {}, uspConsent, pageUrl}) {
const ttxRequest = {};
const params = bidRequest.params;
const element = _getAdSlotHTMLElement(bidRequest.adUnitCode);
const sizes = _transformSizes(bidRequest.sizes);

let format;

// We support size based bidfloors so obtain one if there's a rule associated
if (typeof bidRequest.getFloor === 'function') {
let getFloor = bidRequest.getFloor.bind(bidRequest);

format = sizes.map((size) => {
const formatExt = _getBidFloors(getFloor, size);

return Object.assign({}, size, formatExt);
});
} else {
format = sizes;
}

const minSize = _getMinSize(sizes);

const viewabilityAmount = _isViewabilityMeasurable(element)
Expand All @@ -84,7 +104,7 @@ function _createServerRequest(bidRequest, gdprConsent = {}, pageUrl) {
ttxRequest.imp = [];
ttxRequest.imp[0] = {
banner: {
format: sizes.map(size => Object.assign(size, {ext: {}}))
format
},
ext: {
ttx: {
Expand All @@ -97,6 +117,7 @@ function _createServerRequest(bidRequest, gdprConsent = {}, pageUrl) {
if (pageUrl) {
ttxRequest.site.page = pageUrl;
}

// Go ahead send the bidId in request to 33exchange so it's kept track of in the bid response and
// therefore in ad targetting process
ttxRequest.id = bidRequest.bidId;
Expand All @@ -109,19 +130,28 @@ function _createServerRequest(bidRequest, gdprConsent = {}, pageUrl) {
};
ttxRequest.regs = {
ext: {
gdpr: (gdprConsent.gdprApplies === true) ? 1 : 0
gdpr: (gdprConsent.gdprApplies === true) ? 1 : 0,
us_privacy: uspConsent || null
}
};
ttxRequest.ext = {
ttx: {
prebidStartedAt: Date.now(),
caller: [{
caller: [ {
'name': 'prebidjs',
'version': '$prebid.version$'
}]
} ]
}
};

if (bidRequest.schain) {
ttxRequest.source = {
ext: {
schain: bidRequest.schain
}
}
}

// Finally, set the openRTB 'test' param if this is to be a test bid
if (params.test === 1) {
ttxRequest.test = 1;
Expand All @@ -134,6 +164,7 @@ function _createServerRequest(bidRequest, gdprConsent = {}, pageUrl) {
contentType: 'text/plain',
withCredentials: true
};

// Allow the ability to configure the HB endpoint for testing purposes.
const ttxSettings = config.getConfig('ttxSettings');
const url = (ttxSettings && ttxSettings.url) || END_POINT;
Expand All @@ -148,15 +179,15 @@ function _createServerRequest(bidRequest, gdprConsent = {}, pageUrl) {
}

// Sync object will always be of type iframe for TTX
function _createSync({siteId = 'zzz000000000003zzz', gdprConsent = {}}) {
function _createSync({ siteId = 'zzz000000000003zzz', gdprConsent = {}, uspConsent }) {
const ttxSettings = config.getConfig('ttxSettings');
const syncUrl = (ttxSettings && ttxSettings.syncUrl) || SYNC_ENDPOINT;

const {consentString, gdprApplies} = gdprConsent;
const { consentString, gdprApplies } = gdprConsent;

const sync = {
type: 'iframe',
url: `${syncUrl}&id=${siteId}&gdpr_consent=${encodeURIComponent(consentString)}`
url: `${syncUrl}&id=${siteId}&gdpr_consent=${encodeURIComponent(consentString)}&us_privacy=${encodeURIComponent(uspConsent)}`
};

if (typeof gdprApplies === 'boolean') {
Expand All @@ -166,6 +197,24 @@ function _createSync({siteId = 'zzz000000000003zzz', gdprConsent = {}}) {
return sync;
}

function _getBidFloors(getFloor, size) {
const bidFloors = getFloor({
currency: CURRENCY,
mediaType: MEDIA_TYPE,
size: [ size.w, size.h ]
});

if (!isNaN(bidFloors.floor) && (bidFloors.currency === CURRENCY)) {
return {
ext: {
ttx: {
bidfloors: [ bidFloors.floor ]
}
}
}
}
}

function _getSize(size) {
return {
w: parseInt(size[0], 10),
Expand All @@ -192,7 +241,7 @@ function _getBoundingBox(element, { w, h } = {}) {

function _transformSizes(sizes) {
if (utils.isArray(sizes) && sizes.length === 2 && !utils.isArray(sizes[0])) {
return [_getSize(sizes)];
return [ _getSize(sizes) ];
}

return sizes.map(_getSize);
Expand Down Expand Up @@ -239,7 +288,8 @@ function _getPercentInView(element, topWin, { w, h } = {}) {
bottom: topWin.innerHeight
}, elementBoundingBox ]);

let elementInViewArea, elementTotalArea;
let elementInViewArea,
elementTotalArea;

if (elementInViewBoundingBox !== null) {
// Some or all of the element is in view
Expand Down Expand Up @@ -301,11 +351,19 @@ function buildRequests(bidRequests, bidderRequest) {
gdprApplies: false
}, bidderRequest && bidderRequest.gdprConsent);

const uspConsent = bidderRequest && bidderRequest.uspConsent;
const pageUrl = (bidderRequest && bidderRequest.refererInfo) ? (bidderRequest.refererInfo.referer) : (undefined);

adapterState.uniqueSiteIds = bidRequests.map(req => req.params.siteId).filter(utils.uniques);

return bidRequests.map(req => _createServerRequest(req, gdprConsent, pageUrl));
return bidRequests.map(bidRequest => _createServerRequest(
{
bidRequest,
gdprConsent,
uspConsent,
pageUrl
})
);
}

// NOTE: At this point, the response from 33exchange will only ever contain one bid i.e. the highest bid
Expand All @@ -324,8 +382,17 @@ function interpretResponse(serverResponse, bidRequest) {
// Else no syncs
// For logic on how we handle gdpr data see _createSyncs and module's unit tests
// '33acrossBidAdapter#getUserSyncs'
function getUserSyncs(syncOptions, responses, gdprConsent) {
return (syncOptions.iframeEnabled) ? adapterState.uniqueSiteIds.map((siteId) => _createSync({gdprConsent, siteId})) : ([]);
function getUserSyncs(syncOptions, responses, gdprConsent, uspConsent) {
const syncUrls = (
(syncOptions.iframeEnabled)
? adapterState.uniqueSiteIds.map((siteId) => _createSync({ gdprConsent, uspConsent, siteId }))
: ([])
);

// Clear adapter state of siteID's since we don't need this info anymore.
adapterState.uniqueSiteIds = [];

return syncUrls;
}

export const spec = {
Expand Down
1 change: 1 addition & 0 deletions modules/appierBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const BIDDER_API_ENDPOINT = '/v1/prebid/bid';

export const spec = {
code: 'appier',
aliases: ['appierBR', 'appierExt', 'appierGM'],
supportedMediaTypes: SUPPORTED_AD_TYPES,

/**
Expand Down
35 changes: 32 additions & 3 deletions modules/appnexusBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,29 @@ import { getStorageManager } from '../src/storageManager.js';

const BIDDER_CODE = 'appnexus';
const URL = 'https://ib.adnxs.com/ut/v3/prebid';
const VIDEO_TARGETING = ['id', 'mimes', 'minduration', 'maxduration',
'startdelay', 'skippable', 'playback_method', 'frameworks'];
const VIDEO_TARGETING = ['id', 'minduration', 'maxduration',
'skippable', 'playback_method', 'frameworks', 'context', 'skipoffset'];
const USER_PARAMS = ['age', 'externalUid', 'segments', 'gender', 'dnt', 'language'];
const APP_DEVICE_PARAMS = ['geo', 'device_id']; // appid is collected separately
const DEBUG_PARAMS = ['enabled', 'dongle', 'member_id', 'debug_timeout'];
const VIDEO_MAPPING = {
playback_method: {
'unknown': 0,
'auto_play_sound_on': 1,
'auto_play_sound_off': 2,
'click_to_play': 3,
'mouse_over': 4,
'auto_play_sound_unknown': 5
},
context: {
'unknown': 0,
'pre_roll': 1,
'mid_roll': 2,
'post_roll': 3,
'outstream': 4,
'in-banner': 5
}
};
const NATIVE_MAPPING = {
body: 'description',
body2: 'desc2',
Expand Down Expand Up @@ -711,7 +729,18 @@ function bidToTag(bid) {
// place any valid video params on the tag
Object.keys(bid.params.video)
.filter(param => includes(VIDEO_TARGETING, param))
.forEach(param => tag.video[param] = bid.params.video[param]);
.forEach(param => {
switch (param) {
case 'context':
case 'playback_method':
let type = bid.params.video[param];
type = (utils.isArray(type)) ? type[0] : type;
tag.video[param] = VIDEO_MAPPING[param][type];
break;
default:
tag.video[param] = bid.params.video[param];
}
});
}

if (bid.renderer) {
Expand Down
2 changes: 1 addition & 1 deletion modules/appnexusBidAdapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ var adUnits = [
placementId: 13232385,
video: {
skippable: true,
playback_method: ['auto_play_sound_off']
playback_method: 'auto_play_sound_off'
}
}
}
Expand Down
Loading