Skip to content

Commit

Permalink
convert bidders: glimpse
Browse files Browse the repository at this point in the history
  • Loading branch information
dgirardi committed May 20, 2022
1 parent 90a3134 commit 9feb6f5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion modules/gjirafaBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const spec = {
if (!propertyId) { propertyId = bidRequest.params.propertyId; }
if (!pageViewGuid && bidRequest.params) { pageViewGuid = bidRequest.params.pageViewGuid || ''; }
if (!bidderRequestId) { bidderRequestId = bidRequest.bidderRequestId; }
if (!url && bidderRequest) { url = bidderRequest.refererInfo.referer; }
if (!url && bidderRequest) { url = bidderRequest.refererInfo.page; }
if (!contents.length && bidRequest.params.contents && bidRequest.params.contents.length) { contents = bidRequest.params.contents; }
if (Object.keys(data).length === 0 && bidRequest.params.data && Object.keys(bidRequest.params.data).length !== 0) { data = bidRequest.params.data; }

Expand Down
3 changes: 2 additions & 1 deletion modules/glimpseBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ function getVaultJwt() {
}

function getReferer(bidderRequest) {
return bidderRequest?.refererInfo?.referer || '';
// TODO: is 'page' the right value here?
return bidderRequest?.refererInfo?.page || '';
}

function buildQuery(bidderRequest) {
Expand Down
4 changes: 2 additions & 2 deletions test/spec/modules/glimpseBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const mock = {
refererInfo: {
numIframes: 0,
reachedTop: true,
referer: 'https://demo.glimpseprotocol.io/prebid/desktop',
page: 'https://demo.glimpseprotocol.io/prebid/desktop',
stack: ['https://demo.glimpseprotocol.io/prebid/desktop'],
},
},
Expand Down Expand Up @@ -167,7 +167,7 @@ describe('GlimpseProtocolAdapter', () => {
it('Has referer information', () => {
const request = spec.buildRequests(bidRequests, bidderRequest);
const payload = JSON.parse(request.data);
const expected = mock.bidderRequest.refererInfo.referer;
const expected = mock.bidderRequest.refererInfo.page;

expect(payload.data.referer).to.equal(expected);
});
Expand Down

0 comments on commit 9feb6f5

Please sign in to comment.