Skip to content

Commit

Permalink
GDPR consentManagement module (#2213)
Browse files Browse the repository at this point in the history
* initial commit

* wip update 2

* wip update 3

* example

* clean up

* wip update 3

* hook setup for callBids

* wip update 4

* changed gdpr code to be async-like

* cleaned up the callback chain

* added iab cmp detection logic

* moved hook, reverted unit test changes, and restructed gdpr module

* renaming module from gdpr to consentManagement

* prebidserver adatper update, additional changes in module

* updated unit tests for all areas, updates to module logic and structure of consent data

* adding missing default value

* removing accidentally committed load time testing code

* changes to layout of consentManagement code and other items based on feedback

* moved unit test to different location

* finished incomplete unit test in appnexusBidAdapter_spec file

* altered CMP function call logic

* refactored consentManagement AN lookup function and added gdprDataHandler to help transfer data in auction

* some minor cleanup from previous commit

* change spacing to try to fix travis issue

* added scenario to support consentTimeout=0 skip setTimeout

* updated some comments

* refactored exit logic for module

* added support for consentRequired field in config

* remove internal consentRequired default

* minor comment fixes

* comment fixes that should be have part of last commit

* fix includes issue and added gdprConsent to getUserSyncs function

* renamed default CMP and config field to cmpApi

* wip - using postmessage to call cmp

* postMessage workflow added, removed CMP eventlistener check

* removed if statement

* cleanup; removed variable and unneeded comments

* add gdpr tests pages

* updates for 1.1 CMP spec

* remove rogue debugger in unit test

* restructured 1.1 CMP iframe code, renamed utils function, cleaned up unit tests

* GDPR support in adform adapter (#2396)

* bid response adId same as bidId

* test

* update adform bid adapter

* update unit tests

* Added adform adapter description file

* updated tests

* Another tests update

* Add auctionId

* Update adapter for auctionId

* add auctionId to adformBidAdapter

* Final updates to fit 1.0 version

* update docs and integration example

* Do not mutate original validBidRequests

* use atob and btoa instead of custom made module

* Renaming one query string parameter

* XDomainRequest.send exception fix (#1942)

* Added YIELDONE Bid Adapter for Prebid.js 1.0 (#1900)

* Added YIELDONE Bid Adapter for Prebid.js 1.0

* Update yieldoneBidAdapter.md

change placementId to 44082

* Changed to get size from bid.sizes

* fix sizes array

* Add user-facing docs reminder to PR template (#1956)

* allow non-mappable sizes to be passed and used in rubicon adapter (#1893)

* Typo correction of YIELDONE md file (#1954)

* Added YIELDONE Bid Adapter for Prebid.js 1.0

* Update yieldoneBidAdapter.md

change placementId to 44082

* Changed to get size from bid.sizes

* fix sizes array

* Fix a typo

* Serverbid bid adapter: update alias config (#1963)

* use auctionId instead of requestId (#1968)

* Add freewheel ssp bidder adapter for prebid 1.0 (#1793)

* add stickyadsTV bidder adapter

* init unit test file

* ad some unit tests

* fix unit test on ad format with parameters

* add some unit tests

* add unit tests on getBid method

* add some test cases in unit tests

* minor fix on component id tag.

* remove adapters-sticky.json test file

* use top most accessible window instead of window.top

* Pass in the bid request in the createBid call.

* use top most accessible window instead of window.top

* add unit tests

* update unit tests

* fix unit test.

* fix CI build

* add alias freewheel-ssp

* update unit tests on bidderCode value

* fix component id values and add unit tests

* allws to use any outstream format.

* fix ASLoader on futur outstream format versions

* minor: fix code format.

* update unit tests

* minor fix code format

* minor: add missing new line at eof

* replace StickyAdsTVAdapter by freewheel ssp bd adapter (for prebid 1.0)

* remove old stickyadstv unittest spec.

* fix server response parsing if sent as object with 'body' field

* use the vastXml field for video mediatype

* add user sync pixel in freewheel ssp adapter

* remove all console log calls (replaced using util helper)

* remove useless bidderCode (automatically added by the bidderFactory)

* Return the SYNC pixel to be added in the page by Prebid.js

* remove instance level properties to enable concurrent bids with the same adapter instance.

* fix the request apss through and corresponding unit tests

* fix 'freeheelssp' typo

* + fixed endpoint request data property names - width to w and height to h (#1955)

+ updated unit test for the adapter to comply with the property name changes

* Added iQM Bid Adapter for Prebid.js 1.0 (#1880)

* Added iQM Bid Adapter for Prebid.js 1.0

* Modified URL from http to https

* Removed geo function which was fetching user location.

* Remove stray console.log (#1975)

* Remove duplicate request id and fix empty response from getHighesCpmBids, getAdserverTargeting (#1970)

* Removed requestId and added auctionId

* Updated module fixtures to use auctionId and not requestId

* remove request id from external bid object and fix bug for empty result in public api

* use auctionId instead of requestId

* fixed lint errors

* [Add BidAdapter] rxrtb adapter for Perbid.js 1.0 (#1950)

* Add: rxrtb prebidAdapter

* Update: params for test

* Update: code format

* Update: code format

* Update: code format

* ServerBid Server BidAdapter (#1819)

* ServerBid Server BidAdapter

Allow S2S configuration with ServerBid.

* Updates to meet 1.0 callBids/config changes.

* Fix linting issues.

* added hb_source to default keys (#1969)

* added hb_source

* dropped function to add hb_source since it is now default key

* fixed lint error

* Prebid 1.1.0 Release

* Increment pre version

* S2s defaults fix in serverbidServerBidAdapter (#1986)

* removed s2s defaults

* start timestamp was missing on s2s requests

* remove hardcoded localhost port for tests (#1988)

* Fixes unit tests in browsers other than chrome (#1987)

* Fixes unit tests in browsers other than chrome

* fixed lint errors

* Prebid 1.1.1 Release

* Add note about docs needed before merge (#1959)

* Add note about docs needed before merge

* Update pr_review.md

* Update pr_review.md

* Update pr_review.md

* Adding optional width and height to display parameters  (#1998)

* adding optional size

* no tabs

* TrustX adapter update (#1979)

* Add trustx adapter and tests for it

* update integration example

* Update trustx adapter

* Post-review fixes of Trustx adapter

* Code improvement for trustx adapter: changed default price type from gross to net

* Update TrustX adapter to support the 1.0 version

* Make requested changes for TrustX adapter

* Updated markdown file for TrustX adapter

* Fix TrustX adapter and spec file

* Update TrustX adapter: r parameter was added to ad request as cache buster

* Serverbid Bid Adapter: Add new ad sizes (#1983)

* Added dynamic ttl property for One Display and One Mobile. (#2004)

* pin gulp-connect at non-broken version (#2008)

* pin gulp-connect at non-broken version

* updated yarn.lock to specify pinned gulp-connect

* Gjirafa Bidder Adapter (#1944)

* Added Gjirafa adapter

* Add gjirafa adapter unit test

* adapter update

* New line

* Requested changes

* change hello_world.html to one bid

* change hello_world.html to one bid

* Dropping changes in gitignore and hello_world example

* hello_world changes

* Drop hello_world and gitignore

* multiformat size validation checks (#1964)

* initial commit for multiformat size validation checks

* adding unit tests and changes to checkBidRequestSizes function

* updates to appnexusBidAdapter

* Upgrade Admixer adapter for Prebid 1.0 (#1755)

* Migrating to Prebid 1.0

* Migrating to Prebid 1.0

* Fix spec

* Add NasmediaAdmixer adapter for Perbid.js 1.0 (#1937)

* add NasmediaAdmixer adapter for Perbid.js 1.0

* add NasmediaAdmixer adapter for Perbid.js 1.0

* add NasmediaAdmixer adapter for Perbid.js 1.0

* add NasmediaAdmixer adapter for Perbid.js 1.0

* add NasmediaAdmixer adapter for Perbid.js 1.0

* add NasmediaAdmixer adapter for Perbid.js 1.0

* Added gdpr to adform adapter

* Added unit tests

* Updated spacing

* Update gdprConsent object due to changes in spec

* Add gdpr support for PubMaticBidAdapter (#2469)

* GDPR support for AOL adapter (#2443)

* Added GDPR support for AOL adapter.

* Added unit tests for AOL GDPR changes.

* Added utils for resolving object type and undefined.

* Fixed issues caused by merge.

* Made changes in AOL adapter to support gdprApplies flag.

* Removed bid floor value from test bid config.

* removing iframe example pages

* comment updates
  • Loading branch information
jsnellbaker authored and mkendall07 committed May 1, 2018
1 parent 4a149cf commit 247ea80
Show file tree
Hide file tree
Showing 20 changed files with 1,390 additions and 287 deletions.
103 changes: 103 additions & 0 deletions integrationExamples/gpt/gdpr_hello_world.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
<html>
<head>
<script>window.__cmp = {config: {logging: 'debug'}}</script>
<script src="//acdn.adnxs.com/cmp/cmp.complete.bundle.js" async></script>

<script>
var PREBID_TIMEOUT = 700;

var adUnits = [{
code: 'div-gpt-ad-1460505748561-0',
sizes: [[300, 250], [300,600]],

// Replace this object to test a new Adapter!
bids: [{
bidder: 'appnexusAst',
params: {
placementId: '10433394'
}
}]

}];

var pbjs = pbjs || {};
pbjs.que = pbjs.que || [];

</script>

<script type="text/javascript" src="../../build/dev/prebid.js" async></script>
<script>
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
googletag.cmd.push(function() {
googletag.pubads().disableInitialLoad();
});

pbjs.que.push(function() {
pbjs.addAdUnits(adUnits);
pbjs.setConfig({
consentManagement: {
cmpApi: 'iab',
timeout: 5000,
allowAuctionWithoutConsent: true
},
pubcid: {
enable: false
}
});
pbjs.requestBids({
bidsBackHandler: sendAdserverRequest
});
});

function sendAdserverRequest() {
if (pbjs.adserverRequestSent) return;
pbjs.adserverRequestSent = true;
googletag.cmd.push(function() {
pbjs.que.push(function() {
pbjs.setTargetingForGPTAsync();
googletag.pubads().refresh();
});
});
}

// setTimeout(function() {
// sendAdserverRequest();
// console.log('timeout in main pbjs fired');
// }, PREBID_TIMEOUT);

</script>

<script>
(function () {
var gads = document.createElement('script');
gads.async = true;
gads.type = 'text/javascript';
var useSSL = 'https:' == document.location.protocol;
gads.src = (useSSL ? 'https:' : 'http:') +
'//www.googletagservices.com/tag/js/gpt.js';
var node = document.getElementsByTagName('script')[0];
node.parentNode.insertBefore(gads, node);
})();
</script>

<script>
googletag.cmd.push(function () {
googletag.defineSlot('/19968336/header-bid-tag-0', [[300, 250], [300, 600]], 'div-gpt-ad-1460505748561-0').addService(googletag.pubads());

googletag.pubads().enableSingleRequest();
googletag.enableServices();
});
</script>
</head>

<body>
<h2>Prebid.js Test</h2>
<h5>Div-1</h5>
<div id='div-gpt-ad-1460505748561-0'>
<script type='text/javascript'>
googletag.cmd.push(function() { googletag.display('div-gpt-ad-1460505748561-0'); });
</script>
</div>
</body>
</html>
7 changes: 6 additions & 1 deletion modules/adformBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const spec = {
isBidRequestValid: function (bid) {
return !!(bid.params.mid);
},
buildRequests: function (validBidRequests) {
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 ] ];
Expand Down Expand Up @@ -38,6 +38,11 @@ export const spec = {
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
Loading

0 comments on commit 247ea80

Please sign in to comment.