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

Read and send the pv param on bid requests #2340

Merged
merged 1 commit into from
Apr 5, 2018
Merged
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
16 changes: 13 additions & 3 deletions modules/gumgumBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ const ALIAS_BIDDER_CODE = ['gg']
const BID_ENDPOINT = `https://g2.gumgum.com/hbid/imp`
const DT_CREDENTIALS = { member: 'YcXr87z2lpbB' }
const TIME_TO_LIVE = 60

let browserParams = {};
let pageViewId = null

// TODO: potential 0 values for browserParams sent to ad server
function _getBrowserParams() {
Expand Down Expand Up @@ -63,7 +65,7 @@ function _getDigiTrustQueryParams() {
return {};
}
return {
'dt': digiTrustId.id
dt: digiTrustId.id
};
}

Expand Down Expand Up @@ -106,7 +108,9 @@ function buildRequests (validBidRequests) {
transactionId
} = bidRequest;
const data = {}

if (pageViewId) {
data.pv = pageViewId
}
if (params.inScreen) {
data.t = params.inScreen;
data.pi = 2;
Expand Down Expand Up @@ -150,11 +154,17 @@ function interpretResponse (serverResponse, bidRequest) {
id: creativeId,
markup
},
cw: wrapper
cw: wrapper,
pag: {
pvid
}
} = serverResponseBody
let isTestUnit = (bidRequest.data && bidRequest.data.pi === 3 && bidRequest.data.si === 9)
let [width, height] = utils.parseSizesInput(bidRequest.sizes)[0].split('x')

// update Page View ID from server response
pageViewId = pvid

if (creativeId) {
bidResponses.push({
// dealId: DEAL_ID,
Expand Down