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

Prebid 1.x upgrade gdpr 1.9 #25

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
1a7dac7
Add type conversion for openx parameters (#2408)
haohany Apr 20, 2018
a48df1e
add gdpr support to rubicon video in rubiconBidAdapter (#2426)
moonshells Apr 20, 2018
204daae
Media.net Adapter Improvements (#2344)
vedantseta Apr 20, 2018
372899b
Add New Adapter dgadsBidAdapter (#2429)
r-sato Apr 24, 2018
d94404c
Size Bugfix (#2414)
sami-elasticad Apr 24, 2018
34f34d8
Rubicon adapter GDPR support (#2406)
idettman Apr 24, 2018
28f6795
typo (#2441)
sekindo Apr 24, 2018
bb9bc18
Initial Consumable Bidder Adapter commit (#2381)
naffis Apr 26, 2018
96878ef
Audience Network: Fix bid request validation for fullwidth (#2417)
dlackty Apr 26, 2018
baea840
updated rubicon adapter sync endpoint (#2454)
harpere Apr 26, 2018
5c14e9c
Added new types of traffic Colossus SSP adapter (#2281)
Apr 26, 2018
fae4048
Update ReadPeak adapter (#2369)
kurrestahlberg Apr 27, 2018
e82c58a
Rubicon Adapter GDPR Update for gdprApplies flag (#2456)
idettman Apr 27, 2018
ebf5e61
Update adform adapter's dynamic price type (#2460)
Pupis Apr 27, 2018
e558950
Parse bid sizes on the `mediaTypes` object (#2435)
jsalis Apr 27, 2018
1ed012a
add getUserSyncs function in clickforceBidAdapter (#2383)
MIGOdanis Apr 27, 2018
b1f043d
added missing dfpAdServerVideo.js dfp vast tag generation uri compone…
Slind14 Apr 30, 2018
2d0f6ca
Do client-side user syncs when using the OpenRTB endpoint (#2410)
haohany Apr 30, 2018
9ac6ddd
Sonobi Adapter - Added debugging and analytics query params. (#2463)
JonGoSonobi Apr 30, 2018
12cf662
Add New Adapter admaticBidAdapter (#2390)
hakanarik Apr 30, 2018
b1f8741
Getintent adapter: support multisize bids (#2453)
kprokopchik Apr 30, 2018
59e0042
[FEAT] support mediaTypes.banner.sizes (#2444)
wuleo Apr 30, 2018
3767129
fix sonobi tests for device size so it works in browserstack
snapwich Apr 30, 2018
603f5f0
fix sonobi to use polyfilled find to correct browserstack tests
snapwich Apr 30, 2018
77d0e06
fixing getintent to use utils.isInteger to fix browserstack tests
snapwich Apr 30, 2018
d28c4a8
[1.x] Populate crid with values from demand if present (#2424)
aprakash-sovrn May 1, 2018
a0fee37
PulsePoint Adapter GDPR support (#2471)
anand-venkatraman May 1, 2018
027abc7
getting publisher url fix (#2472)
sekindo May 1, 2018
4a149cf
OpenX Adapter: Support out of order bids. (#2452)
jimee02 May 1, 2018
247ea80
GDPR consentManagement module (#2213)
jsnellbaker May 1, 2018
4dcb046
added whitelist for loading external JS + tests (#2430)
mkendall07 May 1, 2018
64f342a
Add note about headerbid expert (#2367)
matthewlane May 1, 2018
a4913ea
Prebid 1.9.0 Release
jsnellbaker May 1, 2018
0894312
Merge Prebid.js 1.9.0
pm-dattaprasad-mundada May 3, 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
1 change: 1 addition & 0 deletions PR_REVIEW.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ For modules and core platform updates, the initial reviewer should request an ad
- 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.
- 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
19 changes: 12 additions & 7 deletions modules/adformBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,15 @@ export const spec = {
isBidRequestValid: function (bid) {
return !!(bid.params.mid);
},
buildRequests: function (validBidRequests) {
var i, l, j, k, bid, _key, _value, reqParams;
buildRequests: function (validBidRequests, bidderRequest) {
var i, l, j, k, bid, _key, _value, reqParams, netRevenue;
var request = [];
var globalParams = [ [ 'adxDomain', 'adx.adform.net' ], [ 'fd', 1 ], [ 'url', null ], [ 'tid', null ], [ 'pt', null ] ];
var netRevenue = 'gross';
var globalParams = [ [ 'adxDomain', 'adx.adform.net' ], [ 'fd', 1 ], [ 'url', null ], [ 'tid', null ] ];
var bids = JSON.parse(JSON.stringify(validBidRequests));
for (i = 0, l = bids.length; i < l; i++) {
bid = bids[i];
if (bid.params.priceType === 'net') {
bid.params.pt = netRevenue = 'net';
if ((bid.params.priceType === 'net') || (bid.params.pt === 'net')) {
netRevenue = 'net';
}
for (j = 0, k = globalParams.length; j < k; j++) {
_key = globalParams[j][0];
Expand All @@ -35,9 +34,15 @@ export const spec = {
}

request.unshift('//' + globalParams[0][1] + '/adx/?rp=4');

netRevenue = netRevenue || 'gross';
request.push('pt=' + netRevenue);
request.push('stid=' + validBidRequests[0].auctionId);

if (bidderRequest && bidderRequest.gdprConsent) {
request.push('gdpr=' + bidderRequest.gdprConsent.gdprApplies);
request.push('gdpr_consent=' + bidderRequest.gdprConsent.consentString);
}

for (i = 1, l = globalParams.length; i < l; i++) {
_key = globalParams[i][0];
_value = globalParams[i][1];
Expand Down
147 changes: 147 additions & 0 deletions modules/admaticBidAdapter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
import * as utils from 'src/utils';
import { registerBidder } from 'src/adapters/bidderFactory';

const BIDDER_CODE = 'admatic';
const ENDPOINT_URL = '//ads4.admatic.com.tr/prebid/v3/bidrequest';

export const spec = {
code: BIDDER_CODE,
aliases: ['admatic'], // short code
/**
* Determines whether or not the given bid request is valid.
*
* @param {BidRequest} bid The bid params to validate.
* @return boolean True if this is a valid bid, and false otherwise.
*/
isBidRequestValid: function (bid) {
return !!(bid.params.pid && bid.params.wid && bid.params.url);
},
/**
* Make a server request from the list of BidRequests.
*
* @param {validBidRequests[]} - an array of bids
* @return ServerRequest Info describing the request to the server.
*/
buildRequests: function (validBidRequests) {
const payload = {
request: []
};

for (var i = 0; i < validBidRequests.length; i++) {
var validBidRequest = validBidRequests[i];
payload.auctionId = validBidRequest.auctionId;
payload.bidder = validBidRequest.bidder;
payload.bidderRequestId = validBidRequest.bidderRequestId;
payload.pid = validBidRequest.params.pid;
payload.wid = validBidRequest.params.wid;
payload.url = validBidRequest.params.url;

var request = {
adUnitCode: validBidRequest.adUnitCode,
bidId: validBidRequest.bidId,
transactionId: validBidRequest.transactionId,
priceType: validBidRequest.params.priceType,
sizes: transformSizes(validBidRequest.sizes)
}

payload.request.push(request);
}

const payloadString = JSON.stringify(payload);

return {
method: 'POST',
url: ENDPOINT_URL,
data: payloadString,
bidder: 'admatic',
bids: validBidRequests
};
},

/**
* Unpack the response from the server into a list of bids.
*
* @param {ServerResponse} serverResponse A successful response from the server.
* @return {Bid[]} An array of bids which were nested inside the server.
*/
interpretResponse: function (serverResponse, bidRequest) {
const serverBody = serverResponse.body;
const bidResponses = [];

if (serverBody) {
if (serverBody.tags && serverBody.tags.length > 0) {
serverBody.tags.forEach(serverBid => {
if (serverBid != null) {
if (serverBid.cpm !== 0) {
const bidResponse = {
requestId: serverBid.bidId,
cpm: serverBid.cpm,
width: serverBid.width,
height: serverBid.height,
creativeId: serverBid.creativeId,
dealId: serverBid.dealId,
currency: serverBid.currency,
netRevenue: serverBid.netRevenue,
ttl: serverBid.ttl,
referrer: serverBid.referrer,
ad: serverBid.ad
};

bidResponses.push(bidResponse);
}
}
});
}
}

return bidResponses;
},
/**
* Register the user sync pixels which should be dropped after the auction.
*
* @param {SyncOptions} syncOptions Which user syncs are allowed?
* @param {ServerResponse[]} serverResponses List of server's responses.
* @return {UserSync[]} The user syncs which should be dropped.
*/
getUserSyncs: function (syncOptions, serverResponses) {
const syncs = [];
if (syncOptions.iframeEnabled) {
syncs.push({
type: 'iframe',
url: '//ads4.admatic.com.tr/prebid/static/usersync/v3/async_usersync.html'
});
}

if (syncOptions.pixelEnabled && serverResponses.length > 0) {
syncs.push({
type: 'image',
url: 'https://ads5.admatic.com.tr/prebid/v3/bidrequest/usersync'
});
}
return syncs;
}
}

/* Turn bid request sizes into ut-compatible format */
function transformSizes(requestSizes) {
let sizes = [];
let sizeObj = {};

if (utils.isArray(requestSizes) && requestSizes.length === 2 && !utils.isArray(requestSizes[0])) {
sizeObj.width = parseInt(requestSizes[0], 10);
sizeObj.height = parseInt(requestSizes[1], 10);
sizes.push(sizeObj);
} else if (typeof requestSizes === 'object') {
for (let i = 0; i < requestSizes.length; i++) {
let size = requestSizes[i];
sizeObj = {};
sizeObj.width = parseInt(size[0], 10);
sizeObj.height = parseInt(size[1], 10);
sizes.push(sizeObj);
}
}

return sizes;
}

registerBidder(spec);
54 changes: 54 additions & 0 deletions modules/admaticBidAdapter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Overview

```
Module Name: AdMatic Bidder Adapter
Module Type: Bidder Adapter
Maintainer: prebid@admatic.com.tr
```

# Description

Module that connects to AdMatic demand sources

# Test Parameters
```
var adUnits = [
{
code: 'test-div',
mediaTypes: {
banner: {
sizes: [[300, 250]], // a display size
}
},
bids: [
{
bidder: "admatic",
params: {
pid: 193937152158, // publisher id without "adm-pub-" prefix
wid: 104276324971, // website id
priceType: 'gross', // default is net
url: window.location.href || window.top.location.href //page url from js
}
}
]
},{
code: 'test-div',
mediaTypes: {
banner: {
sizes: [[320, 50]], // a mobile size
}
},
bids: [
{
bidder: "admatic",
params: {
pid: 193937152158, // publisher id without "adm-pub-" prefix
wid: 104276324971, // website id
priceType: 'gross', // default is net
url: window.location.href || window.top.location.href //page url from js
}
}
]
}
];
```
Loading