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

Rebase off master prebid #24

Merged
merged 33 commits into from
Jun 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
b60a752
update some unit tests to clean-up consentManagement hooks (#2711)
jsnellbaker Jun 20, 2018
b90f12d
fix(AdyoulikeAdapter): set withCredentials option to true (#2661)
Jun 20, 2018
44fb866
update consentManagement error logic/handling (#2723)
jsnellbaker Jun 20, 2018
f60e239
enhance logWarn message (#2724)
jsnellbaker Jun 20, 2018
960ffdd
Debugging (#2687)
snapwich Jun 20, 2018
8873b21
add encodeURIComponent (#2660)
AdmixerTech Jun 20, 2018
4daab3d
Function name was not logical (#2751)
jaiminpanchal27 Jun 20, 2018
050494e
Max origin concurrent auctions (#2743)
snapwich Jun 20, 2018
8036838
allow s2s bidders call pbs without need of a client adapter file (#2704)
jsnellbaker Jun 20, 2018
64f8e01
Prebid 1.15.0 Release
jaiminpanchal27 Jun 20, 2018
0dda32f
Add GDPR support for Quantcast adapter (#2733)
soarez Jun 20, 2018
ae287c3
ixBidAdapter.js: allow siteId param to be number (#2729)
homeyjd Jun 20, 2018
3418665
Audience Network: add debug params to bid requests (#2657)
lovell Jun 20, 2018
9fc7045
Update CONTRIBUTING.md (#2757)
Jun 21, 2018
2507f4b
Increment Pre Release
jaiminpanchal27 Jun 21, 2018
3868077
Temporarily remove ios browsers from browserstack testing (#2759)
jsnellbaker Jun 21, 2018
d30de32
Rubicon adapter: add support for new size (#2760)
bretg Jun 21, 2018
0c25ef6
Update RELEASE_SCHEDULE.md (#2749)
bretg Jun 21, 2018
7e53e83
Added Weborama bid adapter (#2710)
devweborama Jun 21, 2018
4723710
move logic to check if CMP frame is not found (#2715)
jsnellbaker Jun 21, 2018
af9b294
Add crs parameter to eplanning adapter (#2682)
matimar Jun 21, 2018
ead7aa9
extracted bidder from recieved object in timeout event (#2741)
tegner Jun 21, 2018
0c578b0
adding beta-releases to TOC (#2763)
bretg Jun 22, 2018
cdbd9cf
Feature/normalize size (#2738)
mkendall07 Jun 22, 2018
33a502b
Sharethrough - handle iframe bid param, safeframe support (#2762)
jchau87 Jun 22, 2018
7d6504d
Integration of Realvu analytics in Somo adapter (#2728)
SuprPhatAnon Jun 22, 2018
60e84cf
Refactored URL query parameter passthrough for additional values, cha…
mrcrawfo Jun 22, 2018
415926a
Add user sync to Beachfront adapter (#2761)
jsalis Jun 22, 2018
e8f543b
Add gdpr and targeting support for Yieldlab adapter (#2755)
mirkorean Jun 22, 2018
afd974b
sending information about prebid and adapter versions in request (#2753)
nwlosinski Jun 22, 2018
30f7665
add request timestamp and fix casing (#2664)
samuelhorwitz Jun 22, 2018
5c08569
check if bidder exists before making request object (#2695)
jsnellbaker Jun 22, 2018
0c4b815
allow outstream video, remove parsePosition method, simplify code (#2…
moonshells Jun 26, 2018
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
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ When you are adding code to Prebid.js, or modifying code that isn't covered by a
Prebid.js already has many tests. Read them to see how Prebid.js is tested, and for inspiration:

- Look in `test/spec` and its subdirectories
- Tests for bidder adaptors are located in `test/spec/adapters`
- Tests for bidder adaptors are located in `test/spec/modules`

A test module might have the following general structure:

Expand Down
16 changes: 16 additions & 0 deletions RELEASE_SCHEDULE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
**Table of Contents**
- [Release Schedule](#release-schedule)
- [Release Process](#release-process)
- [Beta Releases](#beta-releases)
- [FAQs](#faqs)

## Release Schedule
Expand Down Expand Up @@ -91,6 +92,21 @@ Announcements regarding releases will be made to the #headerbidding-dev channel
git push
```

## Beta Releases

Prebid.js features may be released as Beta or as Generally Available (GA).

Characteristics of a `Beta` release:
- May be a partial implementation (e.g. more work needed to flesh out the feature)
- May not be fully tested with other features
- Limited documentation, focused on technical aspects
- Few users

Characteristics of a `GA` release:
- Complete set of functionality
- Significant user base with no major issues for at least a month
- Decent documentation that includes business need, use cases, and examples


## FAQs

Expand Down
16 changes: 0 additions & 16 deletions browsers.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,21 +62,5 @@
"browser_version": "8.0",
"device": null,
"os": "OS X"
},
"bs_ios_9": {
"base": "BrowserStack",
"os": "ios",
"os_version": "9.1",
"browser": "iphone",
"device": "iPhone 6S",
"browser_version": null
},
"bs_ios_8": {
"base": "BrowserStack",
"os": "ios",
"os_version": "8.3",
"browser": "iphone",
"device": "iPhone 6",
"browser_version": null
}
}
7 changes: 7 additions & 0 deletions integrationExamples/gpt/pbjs_example_gpt.html
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,13 @@
placement_id: 0
}
},
{
bidder: 'weborama',
params: {
placementId: 0,
traffic: 'banner'
}
},
{
bidder: 'pollux',
params: {
Expand Down
2 changes: 1 addition & 1 deletion modules/admixerBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const spec = {
buildRequests: function (bidderRequest) {
const payload = {
imps: [],
referrer: utils.getTopWindowUrl(),
referrer: encodeURIComponent(utils.getTopWindowUrl()),
};
bidderRequest.forEach((bid) => {
if (bid.bidder === BIDDER_CODE) {
Expand Down
2 changes: 1 addition & 1 deletion modules/adyoulikeBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export const spec = {

const data = JSON.stringify(payload);
const options = {
withCredentials: false
withCredentials: true
};

return {
Expand Down
8 changes: 6 additions & 2 deletions modules/audienceNetworkBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ const url = 'https://an.facebook.com/v2/placementbid.json';
const supportedMediaTypes = ['banner', 'video'];
const netRevenue = true;
const hb_bidder = 'fan';
const pbv = '$prebid.version$';
const platver = '$prebid.version$';
const platform = '241394079772386';
const adapterver = '1.0.0';

/**
* Does this bid request contain valid parameters?
Expand Down Expand Up @@ -166,7 +168,9 @@ const buildRequests = bids => {
testmode,
pageurl,
sdk,
pbv
adapterver,
platform,
platver
};
const video = findIndex(adformats, isVideo);
if (video !== -1) {
Expand Down
71 changes: 54 additions & 17 deletions modules/beachfrontBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { VIDEO, BANNER } from 'src/mediaTypes';
import find from 'core-js/library/fn/array/find';
import includes from 'core-js/library/fn/array/includes';

const ADAPTER_VERSION = '1.1';
const ADAPTER_VERSION = '1.2';
const ADAPTER_NAME = 'BFIO_PREBID';
const OUTSTREAM = 'outstream';

Expand All @@ -16,6 +16,8 @@ export const OUTSTREAM_SRC = '//player-cdn.beachfrontmedia.com/playerapi/loader/
export const VIDEO_TARGETING = ['mimes'];
export const DEFAULT_MIMES = ['video/mp4', 'application/javascript'];

let appId = '';

export const spec = {
code: 'beachfront',
supportedMediaTypes: [ VIDEO, BANNER ],
Expand All @@ -29,14 +31,16 @@ export const spec = {
let videoBids = bids.filter(bid => isVideoBidValid(bid));
let bannerBids = bids.filter(bid => isBannerBidValid(bid));
videoBids.forEach(bid => {
appId = getVideoBidParam(bid, 'appId');
requests.push({
method: 'POST',
url: VIDEO_ENDPOINT + getVideoBidParam(bid, 'appId'),
url: VIDEO_ENDPOINT + appId,
data: createVideoRequestData(bid, bidderRequest),
bidRequest: bid
});
});
if (bannerBids.length) {
appId = getBannerBidParam(bannerBids[0], 'appId');
requests.push({
method: 'POST',
url: BANNER_ENDPOINT,
Expand Down Expand Up @@ -77,23 +81,56 @@ export const spec = {
utils.logWarn(`No valid banner bids from ${spec.code} bidder`);
return [];
}
return response.map((bid) => {
let request = find(bidRequest, req => req.adUnitCode === bid.slot);
return {
requestId: request.bidId,
bidderCode: spec.code,
ad: bid.adm,
creativeId: bid.crid,
cpm: bid.price,
width: bid.w,
height: bid.h,
mediaType: BANNER,
currency: 'USD',
netRevenue: true,
ttl: 300
};
return response
.filter(bid => bid.adm)
.map((bid) => {
let request = find(bidRequest, req => req.adUnitCode === bid.slot);
return {
requestId: request.bidId,
bidderCode: spec.code,
ad: bid.adm,
creativeId: bid.crid,
cpm: bid.price,
width: bid.w,
height: bid.h,
mediaType: BANNER,
currency: 'USD',
netRevenue: true,
ttl: 300
};
});
}
},

getUserSyncs(syncOptions, serverResponses = [], gdprConsent = {}) {
let syncs = [];
let { gdprApplies, consentString } = gdprConsent;
let bannerResponse = find(serverResponses, (res) => utils.isArray(res.body));

if (bannerResponse) {
if (syncOptions.iframeEnabled) {
bannerResponse.body
.filter(bid => bid.sync)
.forEach(bid => {
syncs.push({
type: 'iframe',
url: bid.sync
});
});
}
} else if (syncOptions.iframeEnabled) {
syncs.push({
type: 'iframe',
url: `//sync.bfmio.com/sync_iframe?ifg=1&id=${appId}&gdpr=${gdprApplies ? 1 : 0}&gc=${consentString || ''}&gce=1`
});
} else if (syncOptions.pixelEnabled) {
syncs.push({
type: 'image',
url: `//sync.bfmio.com/syncb?pid=144&id=${appId}&gdpr=${gdprApplies ? 1 : 0}&gc=${consentString || ''}&gce=1`
});
}

return syncs;
}
};

Expand Down
2 changes: 1 addition & 1 deletion modules/beachfrontBidAdapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Module that connects to Beachfront's demand sources
code: 'test-video-banner',
mediaTypes: {
video: {
context: 'instream',
context: 'outstream',
playerSize: [ 640, 360 ]
},
banner: {
Expand Down
36 changes: 21 additions & 15 deletions modules/consentManagement.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ function lookupIabConsent(cmpSuccess, cmpError, hookConfig) {
f = f.parent;
}

if (!cmpFrame) {
return cmpError('CMP not found.', hookConfig);
}

callCmpWhileInIframe('getConsentData', cmpFrame, callbackHandler.consentDataCallback);
callCmpWhileInIframe('getVendorConsents', cmpFrame, callbackHandler.vendorConsentsCallback);
}
Expand Down Expand Up @@ -124,12 +128,6 @@ function lookupIabConsent(cmpSuccess, cmpError, hookConfig) {
/* Setup up a __cmp function to do the postMessage and stash the callback.
This function behaves (from the caller's perspective identicially to the in-frame __cmp call */
window.__cmp = function(cmd, arg, callback) {
if (!cmpFrame) {
removePostMessageListener();

let errmsg = 'CMP not found';
return cmpError(errmsg, hookConfig);
}
let callId = Math.random() + '';
let msg = {__cmpCall: {
command: cmd,
Expand Down Expand Up @@ -219,11 +217,17 @@ export function requestBidsHook(reqBidsConfigObj, fn) {
* @param {object} hookConfig contains module related variables (see comment in requestBidsHook function)
*/
function processCmpData(consentObject, hookConfig) {
let gdprApplies = consentObject && consentObject.getConsentData && consentObject.getConsentData.gdprApplies;
if (
!utils.isPlainObject(consentObject) ||
(!utils.isPlainObject(consentObject.getVendorConsents) || Object.keys(consentObject.getVendorConsents).length === 0) ||
(!utils.isPlainObject(consentObject.getConsentData) || Object.keys(consentObject.getConsentData).length === 0)) {
cmpFailed(`CMP returned unexpected value during lookup process; returned value was (${consentObject}).`, hookConfig);
(typeof gdprApplies !== 'boolean') ||
(gdprApplies === true &&
!(utils.isStr(consentObject.getConsentData.consentData) &&
utils.isPlainObject(consentObject.getVendorConsents) &&
Object.keys(consentObject.getVendorConsents).length > 1
)
)
) {
cmpFailed(`CMP returned unexpected value during lookup process.`, hookConfig, consentObject);
} else {
clearTimeout(hookConfig.timer);
storeConsentData(consentObject);
Expand All @@ -243,15 +247,16 @@ function cmpTimedOut(hookConfig) {
* This function contains the controlled steps to perform when there's a problem with CMP.
* @param {string} errMsg required; should be a short descriptive message for why the failure/issue happened.
* @param {object} hookConfig contains module related variables (see comment in requestBidsHook function)
* @param {object} extraArgs contains additional data that's passed along in the error/warning messages for easier debugging
*/
function cmpFailed(errMsg, hookConfig) {
function cmpFailed(errMsg, hookConfig, extraArgs) {
clearTimeout(hookConfig.timer);

// still set the consentData to undefined when there is a problem as per config options
if (allowAuction) {
storeConsentData(undefined);
}
exitModule(errMsg, hookConfig);
exitModule(errMsg, hookConfig, extraArgs);
}

/**
Expand Down Expand Up @@ -282,8 +287,9 @@ function storeConsentData(cmpConsentObject) {
* 3. bad exit with auction canceled (error message is logged).
* @param {string} errMsg optional; only to be used when there was a 'bad' exit. String is a descriptive message for the failure/issue encountered.
* @param {object} hookConfig contains module related variables (see comment in requestBidsHook function)
* @param {object} extraArgs contains additional data that's passed along in the error/warning messages for easier debugging
*/
function exitModule(errMsg, hookConfig) {
function exitModule(errMsg, hookConfig, extraArgs) {
if (hookConfig.haveExited === false) {
hookConfig.haveExited = true;

Expand All @@ -293,10 +299,10 @@ function exitModule(errMsg, hookConfig) {

if (errMsg) {
if (allowAuction) {
utils.logWarn(errMsg + ' Resuming auction without consent data as per consentManagement config.');
utils.logWarn(errMsg + ' Resuming auction without consent data as per consentManagement config.', extraArgs);
nextFn.apply(context, args);
} else {
utils.logError(errMsg + ' Canceling auction as per consentManagement config.');
utils.logError(errMsg + ' Canceling auction as per consentManagement config.', extraArgs);
if (typeof hookConfig.bidsBackHandler === 'function') {
hookConfig.bidsBackHandler();
} else {
Expand Down
16 changes: 16 additions & 0 deletions modules/eplanningBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ export const spec = {
isBidRequestValid: function(bid) {
return Boolean(bid.params.ci) || Boolean(bid.params.t);
},

buildRequests: function(bidRequests) {
const method = 'GET';
const dfpClientId = '1';
const sec = 'ROS';
let url;
let params;
const urlConfig = getUrlConfig(bidRequests);
const pcrs = getCharset();

if (urlConfig.t) {
url = urlConfig.isv + '/layers/t_pbjs_2.json';
Expand All @@ -40,6 +42,11 @@ export const spec = {
pbv: '$prebid.version$',
ncb: '1'
};

if (pcrs) {
params.crs = pcrs;
}

if (referrerUrl) {
params.fr = referrerUrl;
}
Expand Down Expand Up @@ -147,6 +154,15 @@ function getSpacesString(bids) {

return spacesString;
}

function getCharset() {
try {
return window.top.document.charset || window.top.document.characterSet;
} catch (e) {
return document.charset || document.characterSet;
}
}

function getBidIdMap(bidRequests) {
let map = {};
bidRequests.forEach(bid => map[cleanName(bid.adUnitCode)] = bid.bidId);
Expand Down
3 changes: 2 additions & 1 deletion modules/googleAnalyticsAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,8 @@ function sendBidTimeouts(timedOutBidders) {
_analyticsQueue.push(function () {
utils._each(timedOutBidders, function (bidderCode) {
_eventCount++;
window[_gaGlobal](_trackerSend, 'event', _category, 'Timeouts', bidderCode, _disableInteraction);
var bidderName = bidderCode.bidder;
window[_gaGlobal](_trackerSend, 'event', _category, 'Timeouts', bidderName, _disableInteraction);
});
});

Expand Down
2 changes: 1 addition & 1 deletion modules/ixBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export const spec = {
return false;
}

if (typeof bid.params.siteId !== 'string') {
if (typeof bid.params.siteId !== 'string' && typeof bid.params.siteId !== 'number') {
return false;
}

Expand Down
Loading