Skip to content

Commit

Permalink
convert bidders: connecta
Browse files Browse the repository at this point in the history
  • Loading branch information
dgirardi committed May 20, 2022
1 parent e5c71dd commit edf8b41
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
8 changes: 5 additions & 3 deletions modules/connectadBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@ export const spec = {
placements: [],
time: Date.now(),
user: {},
url: (bidderRequest.refererInfo && bidderRequest.refererInfo.referer) ? bidderRequest.refererInfo.referer : window.location.href,
referrer: window.document.referrer,
referrer_info: bidderRequest.refererInfo,
// TODO: does the fallback to window.location make sense?
url: bidderRequest.refererInfo?.page || window.location.href,
referrer: bidderRequest.refererInfo?.ref,
// TODO: please do not send internal data structures over the network
referrer_info: bidderRequest.refererInfo?.legacy,
screensize: getScreenSize(),
dnt: (navigator.doNotTrack == 'yes' || navigator.doNotTrack == '1' || navigator.msDoNotTrack == '1') ? 1 : 0,
language: navigator.language,
Expand Down
19 changes: 11 additions & 8 deletions test/spec/modules/connectadBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,14 +255,17 @@ describe('ConnectAd Adapter', function () {
const bidRequest = Object.assign({}, bidRequests[0])
const bidderRequ = {
refererInfo: {
referer: 'https://connectad.io/page.html',
reachedTop: true,
numIframes: 2,
stack: [
'https://connectad.io/page.html',
'https://connectad.io/iframe1.html',
'https://connectad.io/iframe2.html'
]
page: 'https://connectad.io/page.html',
legacy: {
referer: 'https://connectad.io/page.html',
reachedTop: true,
numIframes: 2,
stack: [
'https://connectad.io/page.html',
'https://connectad.io/iframe1.html',
'https://connectad.io/iframe2.html'
]
}
}
}
const request = spec.buildRequests([bidRequest], bidderRequ);
Expand Down

0 comments on commit edf8b41

Please sign in to comment.