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

PulsePoint Adapter GDPR support #2471

Merged
merged 26 commits into from
May 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
2fba6a2
ET-1691: Pulsepoint Analytics adapter for Prebid. (#1)
anand-venkatraman Oct 14, 2016
ca17acb
Merge remote-tracking branch 'upstream/master'
anand-venkatraman Oct 25, 2016
5da43c3
Adding bidRequest to bidFactory.createBid method as per https://githu…
anand-venkatraman Oct 25, 2016
cf41114
Merge branch 'master' of https://github.com/prebid/Prebid.js
anand-venkatraman Nov 8, 2016
62756a9
ET-1765: Adding support for additional params in PulsePoint adapter (#2)
anand-venkatraman Nov 9, 2016
f8fabb7
Merge branch 'master' of https://github.com/prebid/Prebid.js
anand-venkatraman Dec 8, 2016
b9af15c
ET-1850: Fixing https://github.com/prebid/Prebid.js/issues/866
anand-venkatraman Dec 8, 2016
6523c25
Merge pull request #3 from pulsepointinc/ET-1850
anand-venkatraman Dec 8, 2016
b5eeb7f
Minor fix
anand-venkatraman Dec 8, 2016
0f33ef5
Merge branch 'master' of https://github.com/prebid/Prebid.js
anand-venkatraman Mar 1, 2017
b5dbd34
Merge branch 'master' of https://github.com/prebid/Prebid.js
anand-venkatraman Jun 27, 2017
d6fcd11
Merge branch 'master' of https://github.com/prebid/Prebid.js
anand-venkatraman Jul 17, 2017
fce16ad
Merge branch 'master' of https://github.com/prebid/Prebid.js
anand-venkatraman Aug 15, 2017
9833867
Merge branch 'master' of https://github.com/prebid/Prebid.js
anand-venkatraman Sep 22, 2017
70924c5
Merge branch 'master' of https://github.com/prebid/Prebid.js
anand-venkatraman Oct 12, 2017
41f4aca
Merge branch 'master' of https://github.com/prebid/Prebid.js
anand-venkatraman Nov 13, 2017
aae98a7
Adding mandatory parameters to Bid
anand-venkatraman Nov 13, 2017
6d546ed
Merge from upstream
anand-venkatraman Nov 27, 2017
a04a18f
Merge branch 'master' of https://github.com/prebid/Prebid.js
anand-venkatraman Mar 7, 2018
467e9e3
Merge branch 'master' of https://github.com/prebid/Prebid.js
anand-venkatraman Apr 20, 2018
af1b3db
Merge branch 'master' of https://github.com/prebid/Prebid.js
anand-venkatraman Apr 30, 2018
0661fc7
Pulsepoint Bid Adapter - GDPR support
anand-venkatraman Apr 30, 2018
861eea3
minor update
anand-venkatraman Apr 30, 2018
4588e9d
minor update
anand-venkatraman Apr 30, 2018
9c9d7df
Merge branch 'master' of https://github.com/prebid/Prebid.js into pul…
anand-venkatraman May 1, 2018
6435142
Fixing review comment
anand-venkatraman May 1, 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
13 changes: 12 additions & 1 deletion modules/pulsepointBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,15 @@ export const spec = {
!!(bid && bid.params && bid.params.cp && bid.params.ct)
),

buildRequests: bidRequests => {
buildRequests: (bidRequests, bidderRequest) => {
const request = {
id: bidRequests[0].bidderRequestId,
imp: bidRequests.map(slot => impression(slot)),
site: site(bidRequests),
app: app(bidRequests),
device: device(),
};
applyGdpr(bidderRequest, request);
return {
method: 'POST',
url: '//bid.contextweb.com/header/ortb',
Expand Down Expand Up @@ -304,6 +305,16 @@ function adSize(slot) {
return [1, 1];
}

/**
* Applies GDPR parameters to request.
*/
function applyGdpr(bidderRequest, ortbRequest) {
if (bidderRequest && bidderRequest.gdprConsent) {
ortbRequest.regs = { ext: { gdpr: bidderRequest.gdprConsent.gdprApplies ? 1 : 0 } };
ortbRequest.user = { ext: { consent: bidderRequest.gdprConsent.consentString } };
}
}

/**
* Parses the native response from the Bid given.
*/
Expand Down
21 changes: 21 additions & 0 deletions test/spec/modules/pulsepointBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,4 +273,25 @@ describe('PulsePoint Adapter Tests', () => {
expect(ortbRequest.app.storeurl).to.equal('http://pulsepoint.com/apps');
expect(ortbRequest.app.domain).to.equal('pulsepoint.com');
});

it('Verify GDPR', () => {
const bidderRequest = {
gdprConsent: {
gdprApplies: true,
consentString: 'serialized_gpdr_data'
}
};
const request = spec.buildRequests(slotConfigs, bidderRequest);
expect(request.url).to.equal('//bid.contextweb.com/header/ortb');
expect(request.method).to.equal('POST');
const ortbRequest = JSON.parse(request.data);
// user object
expect(ortbRequest.user).to.not.equal(null);
expect(ortbRequest.user.ext).to.not.equal(null);
expect(ortbRequest.user.ext.consent).to.equal('serialized_gpdr_data');
// regs object
expect(ortbRequest.regs).to.not.equal(null);
expect(ortbRequest.regs.ext).to.not.equal(null);
expect(ortbRequest.regs.ext.gdpr).to.equal(1);
});
});