Skip to content

Commit

Permalink
Audience Network: add debug params to bid requests
Browse files Browse the repository at this point in the history
Remove deprecated pbv param
  • Loading branch information
lovell committed Jun 9, 2018
1 parent 6be4980 commit b2e8f60
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
8 changes: 6 additions & 2 deletions modules/audienceNetworkBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ const url = 'https://an.facebook.com/v2/placementbid.json';
const supportedMediaTypes = ['banner', 'video'];
const netRevenue = true;
const hb_bidder = 'fan';
const pbv = '$prebid.version$';
const platver = '$prebid.version$';
const platform = '241394079772386';
const adapterver = '1.0.0';

/**
* Does this bid request contain valid parameters?
Expand Down Expand Up @@ -166,7 +168,9 @@ const buildRequests = bids => {
testmode,
pageurl,
sdk,
pbv
adapterver,
platform,
platver
};
const video = findIndex(adformats, isVideo);
if (video !== -1) {
Expand Down
10 changes: 5 additions & 5 deletions test/spec/modules/audienceNetworkBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const placementId = 'test-placement-id';
const playerwidth = 320;
const playerheight = 180;
const requestId = 'test-request-id';
const pbv = '$prebid.version$';
const debug = 'adapterver=1.0.0&platform=241394079772386&platver=$prebid.version$';
const pageUrl = encodeURIComponent(utils.getTopWindowUrl());

describe('AudienceNetwork adapter', () => {
Expand Down Expand Up @@ -140,7 +140,7 @@ describe('AudienceNetwork adapter', () => {
requestIds: [requestId],
sizes: ['300x250'],
url: 'https://an.facebook.com/v2/placementbid.json',
data: `placementids[]=test-placement-id&adformats[]=300x250&testmode=false&pageurl=${pageUrl}&sdk[]=5.5.web&pbv=${pbv}`
data: `placementids[]=test-placement-id&adformats[]=300x250&testmode=false&pageurl=${pageUrl}&sdk[]=5.5.web&${debug}`
}]);
});

Expand All @@ -159,7 +159,7 @@ describe('AudienceNetwork adapter', () => {
requestIds: [requestId],
sizes: ['640x480'],
url: 'https://an.facebook.com/v2/placementbid.json',
data: `placementids[]=test-placement-id&adformats[]=video&testmode=false&pageurl=${pageUrl}&sdk[]=&pbv=${pbv}&playerwidth=640&playerheight=480`
data: `placementids[]=test-placement-id&adformats[]=video&testmode=false&pageurl=${pageUrl}&sdk[]=&${debug}&playerwidth=640&playerheight=480`
}]);
});

Expand All @@ -178,7 +178,7 @@ describe('AudienceNetwork adapter', () => {
requestIds: [requestId],
sizes: ['728x90'],
url: 'https://an.facebook.com/v2/placementbid.json',
data: `placementids[]=test-placement-id&adformats[]=native&testmode=false&pageurl=${pageUrl}&sdk[]=5.5.web&pbv=${pbv}`
data: `placementids[]=test-placement-id&adformats[]=native&testmode=false&pageurl=${pageUrl}&sdk[]=5.5.web&${debug}`
}]);
});

Expand All @@ -197,7 +197,7 @@ describe('AudienceNetwork adapter', () => {
requestIds: [requestId],
sizes: ['300x250'],
url: 'https://an.facebook.com/v2/placementbid.json',
data: `placementids[]=test-placement-id&adformats[]=fullwidth&testmode=false&pageurl=${pageUrl}&sdk[]=5.5.web&pbv=${pbv}`
data: `placementids[]=test-placement-id&adformats[]=fullwidth&testmode=false&pageurl=${pageUrl}&sdk[]=5.5.web&${debug}`
}]);
});

Expand Down

0 comments on commit b2e8f60

Please sign in to comment.