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

Add GDPR parameters in ad request #2522

Merged
merged 66 commits into from
Jun 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
632c8c1
add stickyadsTV bidder adapter
Jan 5, 2017
a91ac2d
init unit test file
Jan 5, 2017
9e2d70e
ad some unit tests
Jan 5, 2017
9c92c3e
fix unit test on ad format with parameters
Jan 5, 2017
7ed68e9
add some unit tests
Jan 6, 2017
88a45ac
add unit tests on getBid method
Jan 6, 2017
7d6bf3c
add some test cases in unit tests
Jan 6, 2017
affdd67
minor fix on component id tag.
Jan 9, 2017
654a473
remove adapters-sticky.json test file
Jan 12, 2017
3b0760e
Merge remote-tracking branch 'Prebid/master'
Jan 12, 2017
8c0f143
use top most accessible window instead of window.top
Jan 26, 2017
fd877dc
Pass in the bid request in the createBid call.
Jan 26, 2017
09f7348
use top most accessible window instead of window.top
Feb 3, 2017
28a36a6
Merge remote-tracking branch 'Prebid/master'
Feb 3, 2017
90264e8
add unit tests
Feb 3, 2017
29453af
update unit tests
Feb 3, 2017
b664ee1
fix unit test.
Feb 3, 2017
57c31a1
fix CI build
Feb 6, 2017
2915576
Merge remote-tracking branch 'Prebid/master'
Feb 9, 2017
c5c41be
Merge remote-tracking branch 'Prebid/master'
Mar 1, 2017
475eee3
add alias freewheel-ssp
Mar 2, 2017
71bfaa1
Merge remote-tracking branch 'Prebid/master'
Mar 10, 2017
410ee00
update unit tests on bidderCode value
Mar 10, 2017
8f7c947
Merge branch 'master' into master
Mar 30, 2017
1d7be59
Merge remote-tracking branch 'Prebid/master'
Jun 7, 2017
b09dfdd
fix component id values and add unit tests
Jun 16, 2017
d5e6d79
Merge remote-tracking branch 'Prebid/master'
Jun 16, 2017
d52df6f
allws to use any outstream format.
Jun 20, 2017
9ad2b7f
fix ASLoader on futur outstream format versions
Jun 20, 2017
427b45c
minor: fix code format.
Jun 20, 2017
c65c62d
update unit tests
Jun 20, 2017
23639ff
minor fix code format
Jun 20, 2017
8c26777
Merge remote-tracking branch 'Prebid/master'
Jun 20, 2017
7b2ff67
minor: add missing new line at eof
Jun 20, 2017
cea7ebd
Merge remote-tracking branch 'Prebid/master'
Jun 30, 2017
025f361
Merge remote-tracking branch 'Prebid/master'
guillaume-sticky Oct 27, 2017
ecaff5e
replace StickyAdsTVAdapter by freewheel ssp bd adapter (for prebid 1.0)
guillaume-sticky Oct 27, 2017
584d8fd
remove old stickyadstv unittest spec.
guillaume-sticky Oct 30, 2017
545876d
fix server response parsing if sent as object with 'body' field
guillaume-sticky Oct 30, 2017
4735b30
Merge remote-tracking branch 'Prebid/master'
guillaume-sticky Oct 30, 2017
c6db605
use the vastXml field for video mediatype
guillaume-sticky Oct 30, 2017
6740fbf
Merge remote-tracking branch 'Prebid/master'
guillaume-sticky Oct 31, 2017
8aae6c6
add user sync pixel in freewheel ssp adapter
guillaume-sticky Oct 31, 2017
6e4d9df
Merge remote-tracking branch 'Prebid/master'
guillaume-sticky Nov 2, 2017
fc3e217
remove all console log calls (replaced using util helper)
guillaume-sticky Nov 23, 2017
8d6360b
remove useless bidderCode (automatically added by the bidderFactory)
guillaume-sticky Nov 23, 2017
4ccb39d
Return the SYNC pixel to be added in the page by Prebid.js
guillaume-sticky Nov 23, 2017
57f7c27
remove instance level properties to enable concurrent bids with the s…
guillaume-sticky Nov 23, 2017
efee22b
Merge remote-tracking branch 'Prebid/master'
guillaume-sticky Nov 23, 2017
91029d9
fix the request apss through and corresponding unit tests
guillaume-sticky Nov 23, 2017
cf55f76
fix 'freeheelssp' typo
guillaume-sticky Dec 7, 2017
10ce504
Merge remote-tracking branch 'Prebid/master'
guillaume-sticky Dec 8, 2017
2af4bad
Merge commit '65c76ef80f68eb41962b98d388dde3259e3c1203'
guillaume-sticky Feb 16, 2018
778c414
Merge remote-tracking branch 'Prebid/master'
guillaume-sticky Feb 16, 2018
ebd8e94
Merge remote-tracking branch 'Prebid/master'
guillaume-sticky Mar 15, 2018
113ad29
Merge remote-tracking branch 'Prebid/master'
guillaume-sticky May 11, 2018
f62aab2
add vast parameters feature and GDPR params in VAST request
guillaume-sticky May 11, 2018
0717715
fix lint issues
guillaume-sticky May 11, 2018
b332946
Merge remote-tracking branch 'Prebid/master'
guillaume-sticky May 22, 2018
d7f57f4
add gdpr parameter support on freewheelSSPBidAdapter
guillaume-sticky May 22, 2018
1ad8abd
use bidderrequest to read gdpr parameters and update unit tests
guillaume-sticky May 22, 2018
447785f
fix lint errors
guillaume-sticky May 22, 2018
37d95fc
fix lint errors
guillaume-sticky May 22, 2018
0238d92
fix typo and bidderRequest reference.
guillaume-sticky Jun 14, 2018
2a18f58
fix bidderRequest reference.
guillaume-sticky Jun 14, 2018
de1de4b
add missing declaration for 'key' variable
guillaume-sticky Jun 18, 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
20 changes: 19 additions & 1 deletion modules/freewheelSSPBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ export const spec = {
* @param {BidRequest[]} bidRequests A non-empty list of bid requests which should be sent to the Server.
* @return ServerRequest Info describing the request to the server.
*/
buildRequests: function(bidRequests) {
buildRequests: function(bidRequests, bidderRequest) {
// var currency = config.getConfig(currency);

var currentBidRequest = bidRequests[0];
Expand All @@ -223,6 +223,24 @@ export const spec = {
componentId: getComponentId(currentBidRequest.params.format)
};

// Add GDPR flag and consent string
if (bidderRequest.gdprConsent) {
requestParams._fw_gdpr_consent = bidderRequest.gdprConsent.consentString;

if (typeof bidderRequest.gdprConsent.gdprApplies === 'boolean') {
requestParams._fw_gdpr = bidderRequest.gdprConsent.gdprApplies;
}
}

var vastParams = currentBidRequest.params.vastUrlParams;
if (typeof vastParams === 'object') {
for (var key in vastParams) {
if (vastParams.hasOwnProperty(key)) {
requestParams[key] = vastParams[key];
}
}
}

var location = utils.getTopWindowUrl();
if (isValidUrl(location)) {
requestParams.loc = location;
Expand Down
16 changes: 11 additions & 5 deletions test/spec/modules/freewheelSSPBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,21 +52,27 @@ describe('freewheelSSP BidAdapter Test', () => {
'bidId': '30b31c1838de1e',
'bidderRequestId': '22edbae2733bf6',
'auctionId': '1d1a030790a475',
'gdprConsent': {
'consentString': 'BOJ/P2HOJ/P2HABABMAAAAAZ+A==',
'gdprApplies': true
}
}
];

it('should add parameters to the tag', () => {
const request = spec.buildRequests(bidRequests);
const request = spec.buildRequests(bidRequests, bidRequests[0]);
const payload = request.data;
expect(payload.reqType).to.equal('AdsSetup');
expect(payload.protocolVersion).to.equal('2.0');
expect(payload.zoneId).to.equal('277225');
expect(payload.componentId).to.equal('mustang');
expect(payload.playerSize).to.equal('300x600');
expect(payload._fw_gdpr).to.equal(true);
expect(payload._fw_gdpr_consent).to.equal('BOJ/P2HOJ/P2HABABMAAAAAZ+A==');
});

it('sends bid request to ENDPOINT via GET', () => {
const request = spec.buildRequests(bidRequests);
const request = spec.buildRequests(bidRequests, bidRequests[0]);
expect(request.url).to.contain(ENDPOINT);
expect(request.method).to.equal('GET');
});
Expand Down Expand Up @@ -139,7 +145,7 @@ describe('freewheelSSP BidAdapter Test', () => {
let formattedAd = '<div id="freewheelssp_prebid_target"></div><script type=\'text/javascript\'>(function() { var st = document.createElement(\'script\'); st.type = \'text/javascript\'; st.async = true; st.src = \'http://cdn.stickyadstv.com/prime-time/floorad.min.js\'; st.onload = function(){ var vastLoader = new window.com.stickyadstv.vast.VastLoader(); var vast = vastLoader.getVast(); var topWindow = (function(){var res=window; try{while(top != res){if(res.parent.location.href.length)res=res.parent;}}catch(e){}return res;})(); vast.setXmlString(topWindow.freeheelssp_cache["adunit-code"]); vastLoader.parseAds(vast, { onSuccess: function() {var config = { preloadedVast:vast, ASLoader:new window.com.stickyadstv.tools.ASLoader(277225, \'floorad\'),domId:"adunit-code"};window.com.stickyadstv.floorad.start(config); } }); }; document.head.appendChild(st);})();</script>';

it('should get correct bid response', () => {
var request = spec.buildRequests(bidRequests);
var request = spec.buildRequests(formattedBidRequests, formattedBidRequests[0]);

let expectedResponse = [
{
Expand All @@ -160,7 +166,7 @@ describe('freewheelSSP BidAdapter Test', () => {
});

it('should get correct bid response with formated ad', () => {
var request = spec.buildRequests(formattedBidRequests);
var request = spec.buildRequests(formattedBidRequests, formattedBidRequests[0]);

let expectedResponse = [
{
Expand All @@ -181,7 +187,7 @@ describe('freewheelSSP BidAdapter Test', () => {
});

it('handles nobid responses', () => {
var reqest = spec.buildRequests(formattedBidRequests);
var reqest = spec.buildRequests(formattedBidRequests, formattedBidRequests[0]);
let response = '<?xml version=\'1.0\' encoding=\'UTF-8\'?><VAST version=\'2.0\'></VAST>';

let result = spec.interpretResponse(response, reqest);
Expand Down