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

send 'iv' param if present and full url in site.page #1

Merged
merged 2 commits into from
Feb 14, 2018
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
6 changes: 5 additions & 1 deletion modules/sovrnBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ export const spec = {
*/
buildRequests: function(bidReqs) {
let sovrnImps = [];
let iv;
utils._each(bidReqs, function (bid) {
iv = iv || utils.getBidIdParameter('iv', bid.params);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So.. can we have multiple iv params sent into the adapter for each tag, but we only attach one to the request?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right. so the conversation i had with the onetag guys was that if there is an iv param on a tag, it will be on all the tags and will have the same value, and that it will be up to them to ensure that is true

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright

sovrnImps.push({
id: bid.bidId,
banner: { w: 1, h: 1 },
Expand All @@ -36,9 +38,11 @@ export const spec = {
imp: sovrnImps,
site: {
domain: window.location.host,
page: window.location.pathname + location.search + location.hash
page: window.location.host + window.location.pathname + location.search + location.hash
}
};
if (iv) sovrnBidReq.iv = iv;

return {
method: 'POST',
url: `//ap.lijit.com/rtb/bid?src=${REPO_AND_VERSION}`,
Expand Down
22 changes: 21 additions & 1 deletion test/spec/modules/sovrnBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe('sovrnBidAdapter', function() {
});

describe('buildRequests', () => {
let bidRequests = [{
const bidRequests = [{
'bidder': 'sovrn',
'params': {
'tagid': '403370'
Expand All @@ -63,6 +63,26 @@ describe('sovrnBidAdapter', function() {
it('attaches source and version to endpoint URL as query params', () => {
expect(request.url).to.equal(ENDPOINT)
});

it('sends \'iv\' as query param if present', () => {
const ivBidRequests = [{
'bidder': 'sovrn',
'params': {
'tagid': '403370',
'iv': 'vet'
},
'adUnitCode': 'adunit-code',
'sizes': [
[300, 250]
],
'bidId': '30b31c1838de1e',
'bidderRequestId': '22edbae2733bf6',
'auctionId': '1d1a030790a475'
}];
const request = spec.buildRequests(ivBidRequests);

expect(request.data).to.contain('"iv":"vet"')
})
});

describe('interpretResponse', () => {
Expand Down