Skip to content

Commit

Permalink
Merge pull request #409 from PubMatic-OpenWrap/staged_nightly
Browse files Browse the repository at this point in the history
OpenWrap V20.5.0
  • Loading branch information
pm-shashank-jain authored Oct 7, 2020
2 parents 63ef371 + f1aae1a commit b27bbbf
Show file tree
Hide file tree
Showing 159 changed files with 10,891 additions and 1,677 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ aliases:
docker:
# specify the version you desire here
- image: circleci/node:12.16.1
resource_class: xlarge
# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
Expand Down Expand Up @@ -94,4 +94,4 @@ workflows:
- e2etest

experimental:
pipelines: true
pipelines: true
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ master branch.
Pull requests must have 80% code coverage before beign considered for merge.
Additional details about the process can be found [here](./PR_REVIEW.md).

There are more details available if you'd like to contribute a [bid adapter](https://docs.prebid.org/dev-docs/bidder-adaptor.html) or [analytics adapter](https://docs.prebid.org/dev-docs/integrate-with-the-prebid-analytics-api.html).

## Issues
[prebid.org](http://prebid.org/) contains documentation that may help answer questions you have about using Prebid.js.
If you can't find the answer there, try searching for a similar issue on the [issues page](https://github.com/prebid/Prebid.js/issues).
Expand Down
24 changes: 12 additions & 12 deletions PR_REVIEW.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ For modules and core platform updates, the initial reviewer should request an ad
- Review for obvious errors or bad coding practice / use best judgement here.
- If the change is a new feature / change to core prebid.js - review the change with a Tech Lead on the project and make sure they agree with the nature of change.
- If the change results in needing updates to docs (such as public API change, module interface etc), add a label for "needs docs" and inform the submitter they must submit a docs PR to update the appropriate area of Prebid.org **before the PR can merge**. Help them with finding where the docs are located on prebid.org if needed.
- Below are some examples of bidder specific updates that should require docs update (in their dev-docs/bidders/bidder.md file):
- Below are some examples of bidder specific updates that should require docs update (in their dev-docs/bidders/BIDDER.md file):
- If they support the GDPR consentManagement module and TCF1, add `gdpr_supported: true`
- If they support the GDPR consentManagement module and TCF2, add `tcf2_supported: true`
- If they support the US Privacy consentManagementUsp module, add `usp_supported: true`
Expand All @@ -23,7 +23,8 @@ For modules and core platform updates, the initial reviewer should request an ad
- If they support COPPA, add `coppa_supported: true`
- If they support SChain, add `schain_supported: true`
- If their bidder doesn't work well with safeframed creatives, add `safeframes_ok: false`. This will alert publishers to not use safeframed creatives when creating the ad server entries for their bidder.
- If they're a member of Prebid.org, add `prebid_member: true`
- If they're setting a deal ID in some scenarios, add `bidder_supports_deals: true`
- If they have an IAB Global Vendor List ID, add `gvl_id: ID`. There's no default.
- If all above is good, add a `LGTM` comment and request 1 additional core member to review.
- Once there is 2 `LGTM` on the PR, merge to master
- Ask the submitter to add a PR for documentation if applicable.
Expand All @@ -34,18 +35,17 @@ For modules and core platform updates, the initial reviewer should request an ad
- Follow steps above for general review process. In addition, please verify the following:
- Verify that bidder has submitted valid bid params and that bids are being received.
- Verify that bidder is not manipulating the prebid.js auction in any way or doing things that go against the principles of the project. If unsure check with the Tech Lead.
- Verify that the bidder is being as efficient as possible, ideally not loading an external library, however if they do load a library it should be cached.
- Verify that code re-use is being done properly and that changes introduced by a bidder don't impact other bidders.
- If the adapter being submitted is an alias type, check with the bidder contact that is being aliased to make sure it's allowed.
- If the adapter is triggering any user syncs make sure they are using the user sync module in the Prebid.js core.
- Requests to the bidder should support HTTPS
- Responses from the bidder should be compressed (such as gzip, compress, deflate)
- Bid responses may not use JSONP: All requests must be AJAX with JSON responses
- Video openrtb params should be read from the ad unit when available; however bidder config can override the ad unit.
- All user-sync (aka pixel) activity must be registered via the provided functions
- Adapters may not use the $$PREBID_GLOBAL$$ variable
- All adapters must support the creation of multiple concurrent instances. This means, for example, that adapters cannot rely on mutable global variables.
- Adapters may not globally override or default the standard ad server targeting values: hb_adid, hb_bidder, hb_pb, hb_deal, or hb_size, hb_source, hb_format.
- All required global and bidder-adapter rules defined in the [Module Rules](https://docs.prebid.org/dev-docs/module-rules.html) must be followed. Please review these rules often - we depend on reviewers to enforce them.
- All bidder parameter conventions must be followed:
- Video params must be read from AdUnit.mediaTypes.video when available; however bidder config can override the ad unit.
- First party data must be read from [`fpd.context` and `fpd.user`](https://docs.prebid.org/dev-docs/publisher-api-reference.html#setConfig-fpd).
- Adapters that accept a floor parameter must also support the [floors module](https://docs.prebid.org/dev-docs/modules/floors.html) -- look for a call to the `getFloors()` function.
- Adapters cannot accept an schain parameter. Rather, they must look for the schain parameter at bidRequest.schain.
- The bidRequest page referrer must checked in addition to any bidder-specific parameter.
- If they're getting the COPPA flag, it must come from config.getConfig('coppa');

- After a new adapter is approved, let the submitter know they may open a PR in the [headerbid-expert repository](https://github.com/prebid/headerbid-expert) to have their adapter recognized by the [Headerbid Expert extension](https://chrome.google.com/webstore/detail/headerbid-expert/cgfkddgbnfplidghapbbnngaogeldmop). The PR should be to the [bidder patterns file](https://github.com/prebid/headerbid-expert/blob/master/bidderPatterns.js), adding an entry with their adapter's name and the url the adapter uses to send and receive bid responses.

## Ticket Coordinator
Expand Down
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,17 +268,15 @@ As you make code changes, the bundles will be rebuilt and the page reloaded auto

## Contribute

Many SSPs, bidders, and publishers have contributed to this project. [60+ Bidders](https://github.com/prebid/Prebid.js/tree/master/src/adapters) are supported by Prebid.js.
Many SSPs, bidders, and publishers have contributed to this project. [Hundreds of bidders](https://github.com/prebid/Prebid.js/tree/master/src/adapters) are supported by Prebid.js.

For guidelines, see [Contributing](./CONTRIBUTING.md).

Our PR review process can be found [here](https://github.com/prebid/Prebid.js/tree/master/PR_REVIEW.md).

### Add a Bidder Adapter

To add a bidder adapter module, see the instructions in [How to add a bidder adaptor](http://prebid.org/dev-docs/bidder-adaptor.html).

Please **do NOT load Prebid.js inside your adapter**. If you do this, we will reject or remove your adapter as appropriate.
To add a bidder adapter module, see the instructions in [How to add a bidder adapter](https://docs.prebid.org/dev-docs/bidder-adaptor.html).

### Code Quality

Expand Down
1 change: 1 addition & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ function watch(done) {
connect.server({
https: argv.https,
port: port,
host: FAKE_SERVER_HOST,
root: './',
livereload: true
});
Expand Down
43 changes: 37 additions & 6 deletions integrationExamples/gpt/userId_example.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,11 @@
var adUnits = [
{
code: 'test-div',
sizes: [[300,250],[300,600],[728,90]],
mediaTypes: {
banner: {
sizes: [[300,250],[300,600],[728,90]]
}
},
bids: [
{
bidder: 'rubicon',
Expand Down Expand Up @@ -115,7 +119,7 @@
consentManagement: {
cmpApi: 'iab',
timeout: 1000,
allowAuctionWithoutConsent: true
defaultGdprScope: true
},
// consentManagement: {
// cmpApi: 'static',
Expand All @@ -128,7 +132,7 @@
// }
// }
// },
usersync: {
userSync: {
userIds: [{
name: "unifiedId",
params: {
Expand Down Expand Up @@ -164,6 +168,18 @@
},

}, {
name: "merkleId",
params: {
ptk: '12345678-aaaa-bbbb-cccc-123456789abc', //Set your real merkle partner key here
pubid: 'EXAMPLE' //Set your real merkle publisher id here
},
storage: {
type: "html5",
name: "merkleId",
expires: 30
},

},{
name: "parrableId",
params: {
// change to Parrable Partner Client ID(s) you received from the Parrable Partners you are using
Expand Down Expand Up @@ -201,10 +217,10 @@
name: "sharedid",
expires: 28
}
},
},
{
name: 'lotamePanoramaId'
},
},
{
name: "liveIntentId",
params: {
Expand All @@ -215,7 +231,22 @@
name: "_li_pbid",
expires: 28
}
}],
},
{
name: "zeotapIdPlus"
},
{
name: 'haloId',
storage: {
type: "cookie",
name: "haloId",
expires: 28
}
},
{
name: "quantcastId"
}
],
syncDelay: 5000,
auctionDelay: 1000
}
Expand Down
10 changes: 10 additions & 0 deletions karma.conf.maker.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,16 @@ module.exports = function(codeCoverage, browserstack, watchMode, file) {

plugins: plugins
}

// To ensure that, we are able to run single spec file
// here we are adding preprocessors, when file is passed
if (file) {
config.files.forEach((file) => {
config.preprocessors[file] = ['webpack', 'sourcemap'];
});
delete config.preprocessors['test/test_index.js'];
}

setReporters(config, codeCoverage, browserstack);
setBrowsers(config, browserstack);
return config;
Expand Down
2 changes: 1 addition & 1 deletion modules.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
["appnexusBidAdapter","consentManagement","sekindoUMBidAdapter","pulsepointBidAdapter","openxBidAdapter","rubiconBidAdapter","sovrnBidAdapter","pubmaticBidAdapter","adgenerationBidAdapter","pubmaticServerBidAdapter","ixBidAdapter","pubmaticAnalyticsAdapter"]
["appnexusBidAdapter","consentManagement","sekindoUMBidAdapter","pulsepointBidAdapter","openxBidAdapter","rubiconBidAdapter","sovrnBidAdapter","pubmaticBidAdapter","adgenerationBidAdapter","pubmaticServerBidAdapter","ixBidAdapter","criteoBidAdapter"]
7 changes: 6 additions & 1 deletion modules/.submodules.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,23 @@
"britepoolIdSystem",
"liveIntentIdSystem",
"lotamePanoramaId",
"merkleIdSystem",
"criteoIdSystem",
"netIdSystem",
"identityLinkIdSystem",
"sharedIdSystem",
"intentIqIdSystem"
"intentIqIdSystem",
"zeotapIdPlusIdSystem",
"haloIdSystem",
"quantcastIdSystem"
],
"adpod": [
"freeWheelAdserverVideo",
"dfpAdServerVideo"
],
"rtdModule": [
"browsiRtdProvider",
"audigentRtdProvider",
"jwplayerRtdProvider"
]
}
90 changes: 90 additions & 0 deletions modules/a4gBidAdapter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
import {registerBidder} from '../src/adapters/bidderFactory.js';
import * as utils from '../src/utils.js';

const A4G_BIDDER_CODE = 'a4g';
const A4G_CURRENCY = 'USD';
const A4G_DEFAULT_BID_URL = 'https://ads.ad4game.com/v1/bid';
const A4G_TTL = 120;

const LOCATION_PARAM_NAME = 'siteurl';
const ID_PARAM_NAME = 'id';
const IFRAME_PARAM_NAME = 'if';
const ZONE_ID_PARAM_NAME = 'zoneId';
const SIZE_PARAM_NAME = 'size';

const ARRAY_PARAM_SEPARATOR = ';';
const ARRAY_SIZE_SEPARATOR = ',';
const SIZE_SEPARATOR = 'x';

export const spec = {
code: A4G_BIDDER_CODE,
isBidRequestValid: function(bid) {
return bid.params && !!bid.params.zoneId;
},

buildRequests: function(validBidRequests, bidderRequest) {
let deliveryUrl = '';
const idParams = [];
const sizeParams = [];
const zoneIds = [];

utils._each(validBidRequests, function(bid) {
if (!deliveryUrl && typeof bid.params.deliveryUrl === 'string') {
deliveryUrl = bid.params.deliveryUrl;
}
idParams.push(bid.bidId);
let bidSizes = (bid.mediaTypes && bid.mediaTypes.banner && bid.mediaTypes.banner.sizes) || bid.sizes;
sizeParams.push(bidSizes.map(size => size.join(SIZE_SEPARATOR)).join(ARRAY_SIZE_SEPARATOR));
zoneIds.push(bid.params.zoneId);
});

if (!deliveryUrl) {
deliveryUrl = A4G_DEFAULT_BID_URL;
}

let data = {
[IFRAME_PARAM_NAME]: 0,
[LOCATION_PARAM_NAME]: (bidderRequest.refererInfo && bidderRequest.refererInfo.referer) ? bidderRequest.refererInfo.referer : window.location.href,
[SIZE_PARAM_NAME]: sizeParams.join(ARRAY_PARAM_SEPARATOR),
[ID_PARAM_NAME]: idParams.join(ARRAY_PARAM_SEPARATOR),
[ZONE_ID_PARAM_NAME]: zoneIds.join(ARRAY_PARAM_SEPARATOR)
};

if (bidderRequest && bidderRequest.gdprConsent) {
data.gdpr = {
applies: bidderRequest.gdprConsent.gdprApplies,
consent: bidderRequest.gdprConsent.consentString
};
}

return {
method: 'GET',
url: deliveryUrl,
data: data
};
},

interpretResponse: function(serverResponses, request) {
const bidResponses = [];
utils._each(serverResponses.body, function(response) {
if (response.cpm > 0) {
const bidResponse = {
requestId: response.id,
creativeId: response.id,
adId: response.id,
cpm: response.cpm,
width: response.width,
height: response.height,
currency: A4G_CURRENCY,
netRevenue: true,
ttl: A4G_TTL,
ad: response.ad
};
bidResponses.push(bidResponse);
}
});
return bidResponses;
}
};

registerBidder(spec);
18 changes: 13 additions & 5 deletions modules/a4gBidAdapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,40 @@ Maintainer: devops@ad4game.com

# Description

Ad4Game Bidder Adapter for Prebid.js. It should be tested on real domain. `localhost` should be rewritten (ex. example.com).
Ad4Game Bidder Adapter for Prebid.js. It should be tested on real domain. `localhost` should be rewritten (ex. example.com).

# Test Parameters
```
var adUnits = [
{
code: 'test-div',
sizes: [[300, 250]], // a display size
mediaTypes: {
banner: {
sizes: [[300, 250]], // a display size
}
},
bids: [
{
bidder: 'a4g',
params: {
zoneId: 59304,
deliveryUrl: 'http://dev01.ad4game.com/v1/bid'
deliveryUrl: 'https://dev01.ad4game.com/v1/bid'
}
}
]
},{
code: 'test-div',
sizes: [[300, 50]], // a mobile size
mediaTypes: {
banner: {
sizes: [[300, 50]], // a mobile size
}
},
bids: [
{
bidder: 'a4g',
params: {
zoneId: 59354,
deliveryUrl: 'http://dev01.ad4game.com/v1/bid'
deliveryUrl: 'https://dev01.ad4game.com/v1/bid'
}
}
]
Expand Down
Loading

0 comments on commit b27bbbf

Please sign in to comment.