Skip to content

Commit

Permalink
Merge pull request #19 from prebid/master
Browse files Browse the repository at this point in the history
Update remote repository
  • Loading branch information
wojciech-bialy-wpm authored Nov 16, 2021
2 parents 2a8278b + 35bb363 commit 14ac217
Show file tree
Hide file tree
Showing 104 changed files with 4,549 additions and 799 deletions.
11 changes: 1 addition & 10 deletions .babelrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,7 @@ module.exports = {
[
useLocal('@babel/preset-env'),
{
"targets": {
"browsers": [
"chrome >= 75",
"safari >=10",
"edge >= 70",
"ff >= 70",
"ie >= 11",
"ios >= 11"
]
}
"useBuiltIns": "entry"
}
]
],
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ module.exports = {
loader: 'babel-loader',
// presets and plugins for Prebid.js must be manually specified separate from your other babel rule.
// this can be accomplished by requiring prebid's .babelrc.js file (requires Babel 7 and Node v8.9.0+)
// as of Prebid 6, babelrc.js only targets modern browsers. One can change the targets and build for
// older browsers if they prefer, but integration tests on ie11 were removed in Prebid.js 6.0
options: require('prebid.js/.babelrc.js')
}
}
Expand Down Expand Up @@ -314,7 +316,7 @@ For instructions on writing tests for Prebid.js, see [Testing Prebid.js](http://

### Supported Browsers

Prebid.js is supported on IE11 and modern browsers.
Prebid.js is supported on IE11 and modern browsers until 5.x. 6.x+ transpiles to target >0.25%; not Opera Mini; not IE11.

### Governance
Review our governance model [here](https://github.com/prebid/Prebid.js/tree/master/governance.md).
8 changes: 0 additions & 8 deletions browsers.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,6 @@
"device": null,
"os": "Windows"
},
"bs_ie_11_windows_10": {
"base": "BrowserStack",
"os_version": "10",
"browser": "ie",
"browser_version": "11.0",
"device": null,
"os": "Windows"
},
"bs_chrome_90_windows_10": {
"base": "BrowserStack",
"os_version": "10",
Expand Down
1 change: 1 addition & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ function lint(done) {
'modules/**/*.js',
'test/**/*.js',
'plugins/**/*.js',
'!plugins/**/node_modules/**',
'./*.js'
], { base: './' })
.pipe(gulpif(argv.nolintfix, eslint(), eslint({ fix: true })))
Expand Down
9 changes: 7 additions & 2 deletions modules/adheseBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import { registerBidder } from '../src/adapters/bidderFactory.js';
import { BANNER, VIDEO } from '../src/mediaTypes.js';
import { config } from '../src/config.js';

const BIDDER_CODE = 'adhese';
const GVLID = 553;
Expand All @@ -20,11 +21,15 @@ export const spec = {
if (validBidRequests.length === 0) {
return null;
}

const { gdprConsent, refererInfo } = bidderRequest;

const adheseConfig = config.getConfig('adhese');
const gdprParams = (gdprConsent && gdprConsent.consentString) ? { xt: [gdprConsent.consentString] } : {};
const refererParams = (refererInfo && refererInfo.referer) ? { xf: [base64urlEncode(refererInfo.referer)] } : {};
const commonParams = { ...gdprParams, ...refererParams };
const globalCustomParams = (adheseConfig && adheseConfig.globalTargets) ? cleanTargets(adheseConfig.globalTargets) : {};
const commonParams = { ...globalCustomParams, ...gdprParams, ...refererParams };
const vastContentAsUrl = !(adheseConfig && adheseConfig.vastContentAsUrl == false);

const slots = validBidRequests.map(bid => ({
slotname: bidToSlotName(bid),
Expand All @@ -34,7 +39,7 @@ export const spec = {
const payload = {
slots: slots,
parameters: commonParams,
vastContentAsUrl: true,
vastContentAsUrl: vastContentAsUrl,
user: {
ext: {
eids: getEids(validBidRequests),
Expand Down
1 change: 1 addition & 0 deletions modules/adkernelBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export const spec = {
{code: 'denakop'},
{code: 'rtbanalytica'},
{code: 'unibots'},
{code: 'catapultx'},
{code: 'ergadx'},
{code: 'turktelekom'}
],
Expand Down
61 changes: 61 additions & 0 deletions modules/adlivetechBidAdapter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Overview

Module Name: Adlivetech Bidder Adapter
Module Type: Bidder Adapter
Maintainer: grid-tech@themediagrid.com

# Description

Module that connects to Grid demand source to fetch bids.
The adapter is GDPR compliant and supports banner and video (instream and outstream).

# Test Parameters
```
var adUnits = [
{
code: 'test-div',
sizes: [[300, 250]],
bids: [
{
bidder: "adlivetech",
params: {
uid: '1',
bidFloor: 0.5
}
}
]
},{
code: 'test-div',
sizes: [[728, 90]],
bids: [
{
bidder: "adlivetech",
params: {
uid: 2,
keywords: {
brandsafety: ['disaster'],
topic: ['stress', 'fear']
}
}
}
]
},
{
code: 'test-div',
sizes: [[728, 90]],
mediaTypes: { video: {
context: 'instream',
playerSize: [728, 90],
mimes: ['video/mp4']
},
bids: [
{
bidder: "adlivetech",
params: {
uid: 11
}
}
]
}
];
```
3 changes: 2 additions & 1 deletion modules/adnuntiusBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ const handleMeta = function () {
}

const getUsi = function (meta, ortb2, bidderRequest) {
const usi = (meta !== null) ? meta.usi : false;
let usi = (meta !== null && meta.usi) ? meta.usi : false;
if (ortb2 && ortb2.user && ortb2.user.id) { usi = ortb2.user.id }
return usi
}

Expand Down
14 changes: 10 additions & 4 deletions modules/adomikAnalyticsAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const bidRequested = CONSTANTS.EVENTS.BID_REQUESTED;
const bidResponse = CONSTANTS.EVENTS.BID_RESPONSE;
const bidWon = CONSTANTS.EVENTS.BID_WON;
const bidTimeout = CONSTANTS.EVENTS.BID_TIMEOUT;
const ua = navigator.userAgent;

let adomikAdapter = Object.assign(adapter({}),
{
Expand Down Expand Up @@ -47,7 +48,7 @@ let adomikAdapter = Object.assign(adapter({}),
type: 'request',
event: {
bidder: bid.bidder.toUpperCase(),
placementCode: bid.placementCode
placementCode: bid.adUnitCode
}
});
});
Expand All @@ -67,6 +68,10 @@ adomikAdapter.initializeBucketEvents = function() {
adomikAdapter.bucketEvents = [];
}

adomikAdapter.maxPartLength = function () {
return (ua.includes(' MSIE ')) ? 1600 : 60000;
};

adomikAdapter.sendTypedEvent = function() {
const groupedTypedEvents = adomikAdapter.buildTypedEvents();

Expand Down Expand Up @@ -108,9 +113,10 @@ adomikAdapter.sendTypedEvent = function() {
// Encode object in base64
const encodedBuf = window.btoa(stringBulkEvents);

// Create final url and split it in 1600 characters max (+endpoint length)
// Create final url and split it (+endpoint length)
const encodedUri = encodeURIComponent(encodedBuf);
const splittedUrl = encodedUri.match(/.{1,1600}/g);
const maxLength = adomikAdapter.maxPartLength();
const splittedUrl = encodedUri.match(new RegExp(`.{1,${maxLength}}`, 'g'));

splittedUrl.forEach((split, i) => {
const partUrl = `${split}&id=${adomikAdapter.currentContext.id}&part=${i}&on=${splittedUrl.length - 1}`;
Expand All @@ -121,7 +127,7 @@ adomikAdapter.sendTypedEvent = function() {

adomikAdapter.sendWonEvent = function (wonEvent) {
const stringWonEvent = JSON.stringify(wonEvent)
logInfo('Won event sent to adomik prebid analytic ' + wonEvent);
logInfo('Won event sent to adomik prebid analytic ' + stringWonEvent);

// Encode object in base64
const encodedBuf = window.btoa(stringWonEvent);
Expand Down
2 changes: 1 addition & 1 deletion modules/airgridRtdProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export function attachScriptTagToDOM(rtdConfig) {
edktInitializor.load = function(e) {
var p = e || 'sdk';
var n = document.createElement('script');
n.type = 'text/javascript';
n.type = 'module';
n.async = true;
n.src = 'https://cdn.edkt.io/' + p + '/edgekit.min.js';
document.getElementsByTagName('head')[0].appendChild(n);
Expand Down
12 changes: 9 additions & 3 deletions modules/appnexusBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,10 @@ function newBid(serverBid, rtbBid, bidderRequest) {
bid.meta = Object.assign({}, bid.meta, { advertiserId: rtbBid.advertiser_id });
}

if (rtbBid.brand_id) {
bid.meta = Object.assign({}, bid.meta, { brandId: rtbBid.brand_id });
}

if (rtbBid.rtb.video) {
// shared video properties used for all 3 contexts
Object.assign(bid, {
Expand Down Expand Up @@ -696,9 +700,11 @@ function newBid(serverBid, rtbBid, bidderRequest) {
});
try {
if (rtbBid.rtb.trackers) {
const url = rtbBid.rtb.trackers[0].impression_urls[0];
const tracker = createTrackPixelHtml(url);
bid.ad += tracker;
for (let i = 0; i < rtbBid.rtb.trackers[0].impression_urls.length; i++) {
const url = rtbBid.rtb.trackers[0].impression_urls[i];
const tracker = createTrackPixelHtml(url);
bid.ad += tracker;
}
}
} catch (error) {
logError('Error appending tracking pixel', error);
Expand Down
Loading

0 comments on commit 14ac217

Please sign in to comment.