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

Pass Referer to bidding endpoint for Yieldlab Adapter #5530

Merged
merged 1 commit into from
Jul 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 10 additions & 4 deletions modules/yieldlabBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,16 @@ export const spec = {
}
})

if (bidderRequest && bidderRequest.gdprConsent) {
query.gdpr = (typeof bidderRequest.gdprConsent.gdprApplies === 'boolean') ? bidderRequest.gdprConsent.gdprApplies : true
if (query.gdpr) {
query.consent = bidderRequest.gdprConsent.consentString
if (bidderRequest) {
if (bidderRequest.refererInfo && bidderRequest.refererInfo.referer) {
query.pubref = bidderRequest.refererInfo.referer
}

if (bidderRequest.gdprConsent) {
query.gdpr = (typeof bidderRequest.gdprConsent.gdprApplies === 'boolean') ? bidderRequest.gdprConsent.gdprApplies : true
if (query.gdpr) {
query.consent = bidderRequest.gdprConsent.consentString
}
}
}

Expand Down
14 changes: 14 additions & 0 deletions test/spec/modules/yieldlabBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,20 @@ describe('yieldlabBidAdapter', function () {
expect(request.url).to.include('extraParam=true&foo=bar')
})

const refererRequest = spec.buildRequests(bidRequests, {
refererInfo: {
canonicalUrl: undefined,
numIframes: 0,
reachedTop: true,
referer: 'https://www.yieldlab.de/test?with=querystring',
stack: ['https://www.yieldlab.de/test?with=querystring']
}
})

it('passes encoded referer to bid request', function () {
expect(refererRequest.url).to.include('pubref=https%3A%2F%2Fwww.yieldlab.de%2Ftest%3Fwith%3Dquerystring')
})

const gdprRequest = spec.buildRequests(bidRequests, {
gdprConsent: {
consentString: 'BN5lERiOMYEdiAKAWXEND1AAAAE6DABACMA',
Expand Down