Skip to content

Commit

Permalink
GDPR support (prebid#2601)
Browse files Browse the repository at this point in the history
* Justpremium adapter and unit tests.

* Fix test suit.

* Performance improvements.

* Changes requested in pull request review.

* Register justpremium adapter in adaptermanager

* pass through bid from request

* fix linting errors

* Load polyfills for older browsers

* Load polyfills if older browser

* Remove package-lock.json

* Copy new Justpremium adapter from feature/1.0 branch

* prebid#1881 Requested changes applied

* prebid#1892 Use `filter` instead `...new Set` to get unique values

* JSD-2248 update for adapter and tests

* JSD-2248 added transactionId in json array

* JSD-2248 adapter changes

* JSD-2248 adapter changes

* Update docs

* Remove unnecessary return statement

* Support for gdpr_consent in bid adapter

* new cookie link and endpoint

* back to old endpoint version

* sending version of prebid and adapter

* sending version of prebid and adapter

* without version

* update for tests

* changes for getUserSyncs method

* return gulpfile changes
  • Loading branch information
nwlosinski authored and dluxemburg committed Jul 17, 2018
1 parent 3e92a87 commit 835a0b3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
20 changes: 16 additions & 4 deletions modules/justpremiumBidAdapter.js
Expand Up @@ -13,7 +13,7 @@ export const spec = {
return !!(bid && bid.params && bid.params.zone)
},

buildRequests: (validBidRequests) => {
buildRequests: (validBidRequests, bidderRequest) => {
const c = preparePubCond(validBidRequests)
const dim = getWebsiteDim()
const payload = {
Expand All @@ -38,6 +38,14 @@ export const spec = {
sizes[zone] = sizes[zone] || []
sizes[zone].push.apply(sizes[zone], b.sizes)
})

if (bidderRequest && bidderRequest.gdprConsent) {
payload.gdpr_consent = {
consent_string: bidderRequest.gdprConsent.consentString,
consent_required: (typeof bidderRequest.gdprConsent.gdprApplies === 'boolean') ? bidderRequest.gdprConsent.gdprApplies : true
};
}

const payloadString = JSON.stringify(payload)

return {
Expand Down Expand Up @@ -73,12 +81,16 @@ export const spec = {
return bidResponses
},

getUserSyncs: (syncOptions) => {
getUserSyncs: function getUserSyncs(syncOptions, responses, gdprConsent) {
let url = '//pre.ads.justpremium.com/v/1.0/t/sync'
if (gdprConsent && (typeof gdprConsent.gdprApplies === 'boolean')) {
url = url + '?consentString=' + encodeURIComponent(gdprConsent.consentString)
}
if (syncOptions.iframeEnabled) {
pixels.push({
type: 'iframe',
src: '//us-u.openx.net/w/1.0/pd?plm=10&ph=26e53f82-d199-49df-9eca-7b350c0f9646'
})
url: url
});
}
return pixels
}
Expand Down
2 changes: 1 addition & 1 deletion modules/justpremiumBidAdapter.md
Expand Up @@ -2,7 +2,7 @@

**Module Name**: Justpremium Bidder Adapter
**Module Type**: Bidder Adapter
**Maintainer**: info@justpremium.com
**Maintainer**: headerbidding-dev@justpremium.com

# Description

Expand Down
2 changes: 1 addition & 1 deletion test/spec/modules/justpremiumBidAdapter_spec.js
Expand Up @@ -121,7 +121,7 @@ describe('justpremium adapter', () => {
const options = spec.getUserSyncs({iframeEnabled: true})
expect(options).to.not.be.undefined
expect(options[0].type).to.equal('iframe')
expect(options[0].src).to.match(/\/\/us-u.openx.net\/w\/1.0/)
expect(options[0].url).to.match(/\/\/pre.ads.justpremium.com\/v\/1.0\/t\/sync/)
})
})
})

0 comments on commit 835a0b3

Please sign in to comment.