Skip to content

Commit

Permalink
convert bidders: gumgum
Browse files Browse the repository at this point in the history
  • Loading branch information
dgirardi committed May 20, 2022
1 parent 1fcf289 commit 561b10b
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion modules/gridNMBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export const spec = {
const requests = [];
let { bidderRequestId, auctionId, gdprConsent, uspConsent, timeout, refererInfo } = bidderRequest || {};

const referer = refererInfo ? encodeURIComponent(refererInfo.referer) : '';
const referer = refererInfo ? encodeURIComponent(refererInfo.page) : '';

bids.forEach(bid => {
let user;
Expand Down
3 changes: 2 additions & 1 deletion modules/growadvertisingBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ export const spec = {
netRevenue: true,
ttl: response.ttl,
adUnitCode: request.adUnitCode,
referrer: deepAccess(request, 'refererInfo.referer')
// TODO: is 'page' the right value here?
referrer: deepAccess(request, 'refererInfo.page')
};

if (response.hasOwnProperty(NATIVE)) {
Expand Down
2 changes: 1 addition & 1 deletion modules/gumgumBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ function buildRequests(validBidRequests, bidderRequest) {
const gdprConsent = bidderRequest && bidderRequest.gdprConsent;
const uspConsent = bidderRequest && bidderRequest.uspConsent;
const timeout = config.getConfig('bidderTimeout');
const topWindowUrl = bidderRequest && bidderRequest.refererInfo && bidderRequest.refererInfo.referer;
const topWindowUrl = bidderRequest && bidderRequest.refererInfo && bidderRequest.refererInfo.page;
_each(validBidRequests, bidRequest => {
const {
bidId,
Expand Down
4 changes: 2 additions & 2 deletions test/spec/modules/gridNMBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,9 @@ describe('TheMediaGridNM Adapter', function () {
bidderRequestId: '22edbae2733bf6',
auctionId: '1d1a030790a475',
timeout: 3000,
refererInfo: { referer: 'https://example.com' }
refererInfo: { page: 'https://example.com' }
};
const referrer = encodeURIComponent(bidderRequest.refererInfo.referer);
const referrer = encodeURIComponent(bidderRequest.refererInfo.page);
let bidRequests = [
{
'bidder': 'gridNM',
Expand Down
8 changes: 4 additions & 4 deletions test/spec/modules/gumgumBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ describe('gumgumAdapter', function () {
});

it('should handle no gg params', function () {
const bidRequest = spec.buildRequests(bidRequests, { refererInfo: { referer: 'https://www.prebid.org/?param1=foo&param2=bar&param3=baz' } })[0];
const bidRequest = spec.buildRequests(bidRequests, { refererInfo: { page: 'https://www.prebid.org/?param1=foo&param2=bar&param3=baz' } })[0];

// no params are in object
expect(bidRequest.data.hasOwnProperty('eAdBuyId')).to.be.false;
Expand All @@ -555,7 +555,7 @@ describe('gumgumAdapter', function () {
});

it('should handle encrypted ad buy id', function () {
const bidRequest = spec.buildRequests(bidRequests, { refererInfo: { referer: 'https://www.prebid.org/?param1=foo&ggad=bar&param3=baz' } })[0];
const bidRequest = spec.buildRequests(bidRequests, { refererInfo: { page: 'https://www.prebid.org/?param1=foo&ggad=bar&param3=baz' } })[0];

// correct params are in object
expect(bidRequest.data.hasOwnProperty('eAdBuyId')).to.be.true;
Expand All @@ -567,7 +567,7 @@ describe('gumgumAdapter', function () {
});

it('should handle unencrypted ad buy id', function () {
const bidRequest = spec.buildRequests(bidRequests, { refererInfo: { referer: 'https://www.prebid.org/?param1=foo&ggad=123&param3=baz' } })[0];
const bidRequest = spec.buildRequests(bidRequests, { refererInfo: { page: 'https://www.prebid.org/?param1=foo&ggad=123&param3=baz' } })[0];

// correct params are in object
expect(bidRequest.data.hasOwnProperty('eAdBuyId')).to.be.false;
Expand All @@ -579,7 +579,7 @@ describe('gumgumAdapter', function () {
});

it('should handle multiple gg params', function () {
const bidRequest = spec.buildRequests(bidRequests, { refererInfo: { referer: 'https://www.prebid.org/?ggdeal=foo&ggad=bar&param3=baz' } })[0];
const bidRequest = spec.buildRequests(bidRequests, { refererInfo: { page: 'https://www.prebid.org/?ggdeal=foo&ggad=bar&param3=baz' } })[0];

// correct params are in object
expect(bidRequest.data.hasOwnProperty('eAdBuyId')).to.be.true;
Expand Down

0 comments on commit 561b10b

Please sign in to comment.