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

Added US Privacy support for TheMediaGrid Bid Adapter #4606

Merged
merged 26 commits into from
Dec 18, 2019
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
57210b5
Added Grid Bid Adapter
TheMediaGrid Oct 16, 2018
2a0bad2
remove priceType from TheMediaGrid Bid Adapter
TheMediaGrid Oct 19, 2018
12b9f52
Merge remote-tracking branch 'upstream/master'
TheMediaGrid Feb 5, 2019
f3a8ffe
Add video support in Grid Bid Adapter
TheMediaGrid Feb 8, 2019
8e2083c
Added test parameter for video slot
TheMediaGrid Feb 12, 2019
bc9d9d4
Merge remote-tracking branch 'upstream/master'
TheMediaGrid Feb 18, 2019
14e9ed7
update Grid Bid Adapter to set size in response bid
TheMediaGrid Feb 18, 2019
5978540
Merge remote-tracking branch 'upstream/master'
TheMediaGrid Mar 13, 2019
0c2702f
Update Grid Bid Adapter to support identical uids in parameters
TheMediaGrid Mar 14, 2019
a7549ef
Merge remote-tracking branch 'upstream/master'
TheMediaGrid Mar 25, 2019
2bb0c05
Fix typo in test file for Grid Bid Adapter
TheMediaGrid Mar 25, 2019
e63ae93
Merge remote-tracking branch 'upstream/master'
TheMediaGrid Jul 5, 2019
906d1a9
Update The Grid Media Bidder Adapter to send refererInfo.referer as '…
TheMediaGrid Jul 5, 2019
01bc84a
Merge remote-tracking branch 'upstream/master'
TheMediaGrid Jul 30, 2019
fb96ea9
Hotfix for referrer in Grid Bid Adapter
TheMediaGrid Jul 30, 2019
31d29fb
Merge remote-tracking branch 'upstream/master'
TheMediaGrid Oct 23, 2019
2f54618
Grid Bid Adapter: added wrapperType and wrappweVersion to the ad request
TheMediaGrid Oct 23, 2019
5855899
Merge remote-tracking branch 'upstream/master'
TheMediaGrid Oct 31, 2019
aef566d
TheMediaGrid Bid Adapter: added sync url
TheMediaGrid Oct 31, 2019
4e3d612
Merge remote-tracking branch 'upstream/master'
TheMediaGrid Nov 6, 2019
f7acabc
TheMediaGrid Bid Adapter: added GDPR params to sync url
TheMediaGrid Nov 6, 2019
9eba827
Merge remote-tracking branch 'upstream/master'
TheMediaGrid Nov 11, 2019
78cd4fd
Merge remote-tracking branch 'upstream/master'
TheMediaGrid Nov 18, 2019
9a4a769
TheMediaGrid Bid Adapter: added tests for getUserSyncs function
TheMediaGrid Nov 18, 2019
7f3e049
Merge remote-tracking branch 'upstream/master'
TheMediaGrid Dec 16, 2019
5433f98
Added CCPA support in TheMediaGrid Bid Adapter
TheMediaGrid Dec 16, 2019
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
8 changes: 7 additions & 1 deletion modules/gridBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ export const spec = {
(typeof bidderRequest.gdprConsent.gdprApplies === 'boolean')
? Number(bidderRequest.gdprConsent.gdprApplies) : 1;
}
if (bidderRequest.uspConsent) {
payload.us_privacy = bidderRequest.uspConsent;
}
}

return {
Expand Down Expand Up @@ -140,7 +143,7 @@ export const spec = {
if (errorMessage) utils.logError(errorMessage);
return bidResponses;
},
getUserSyncs: function (syncOptions, responses, gdprConsent) {
getUserSyncs: function (syncOptions, responses, gdprConsent, uspConsent) {
if (!hasSynced && syncOptions.pixelEnabled) {
let params = '';

Expand All @@ -151,6 +154,9 @@ export const spec = {
params += `&gdpr_consent=${gdprConsent.consentString}`;
}
}
if (uspConsent) {
params += `&us_privacy=${uspConsent}`;
}

hasSynced = true;
return {
Expand Down
14 changes: 14 additions & 0 deletions test/spec/modules/gridBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,14 @@ describe('TheMediaGrid Adapter', function () {
expect(payload).to.have.property('gdpr_consent', 'AAA');
expect(payload).to.have.property('gdpr_applies', '1');
});

it('if usPrivacy is present payload must have us_privacy param', function () {
const bidderRequestWithUSP = Object.assign({uspConsent: '1YNN'}, bidderRequest);
const request = spec.buildRequests(bidRequests, bidderRequestWithUSP);
expect(request.data).to.be.an('string');
const payload = parseRequest(request.data);
expect(payload).to.have.property('us_privacy', '1YNN');
});
});

describe('interpretResponse', function () {
Expand Down Expand Up @@ -663,5 +671,11 @@ describe('TheMediaGrid Adapter', function () {
type: 'image', url: syncUrl
});
});

it('should pass usPrivacy param if it is available', function() {
expect(spec.getUserSyncs({ pixelEnabled: true }, {}, {}, '1YNN')).to.deep.equal({
type: 'image', url: `${syncUrl}&us_privacy=1YNN`
});
});
});
});