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

Audience Network: add debug params to bid requests #2657

Merged
merged 1 commit into from
Jun 20, 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
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