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

FS-9373 yieldmo prebid adapter support for ATS envelope #12

Closed
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
21 changes: 21 additions & 0 deletions modules/yieldmoBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export const spec = {
p: [],
page_url: bidderRequest.refererInfo.referer,
bust: new Date().getTime().toString(),
lr_env: getATSEnvelope(),
pr: (LOCAL_WINDOW.document && LOCAL_WINDOW.document.referrer) || '',
scrd: LOCAL_WINDOW.devicePixelRatio || 0,
dnt: getDNT(),
Expand Down Expand Up @@ -272,6 +273,26 @@ function createNewVideoBid(response, bidRequest) {
return result;
}

/**
* Gets Authenticated Traffic Solution ATS Envelope if available
* @returns ATS Envelope
*/
function getATSEnvelope() {
let ATSEnvelope;
if (window.ats) {
ATSEnvelope = window.ats.retrieveEnvelope()['envelope'];
}

if (ATSEnvelope === undefined) {
let liveRampCookie = document.cookie.match('(^|;) *_lr_env=([^;]*)');
if (liveRampCookie !== null) {
ATSEnvelope = liveRampCookie[2];
}
}

return ATSEnvelope;
}

/**
* Detects whether dnt is true
* @returns true if user enabled dnt
Expand Down
2 changes: 1 addition & 1 deletion modules/yieldmoBidAdapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Note: Our ads will only render in mobile

Connects to Yieldmo Ad Server for bids.

Yieldmo bid adapter supports Banner and Video.
Yieldmo bid adapter supports Banner and Video. Includes support for LiveRamp's Authenticated Traffic Solution ATS.

# Test Parameters

Expand Down
1 change: 1 addition & 0 deletions test/spec/modules/yieldmoBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ describe('YieldmoAdapter', function () {
expect(data.hasOwnProperty('scrd')).to.be.true;
expect(data.dnt).to.be.false;
expect(data.hasOwnProperty('description')).to.be.true;
expect(data.hasOwnProperty('lr_env')).to.be.true;
expect(data.hasOwnProperty('title')).to.be.true;
expect(data.hasOwnProperty('h')).to.be.true;
expect(data.hasOwnProperty('w')).to.be.true;
Expand Down