-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into upgrade-webpack
- Loading branch information
Showing
15 changed files
with
622 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import {registerBidder} from '../src/adapters/bidderFactory.js'; | ||
import {triggerPixel} from '../src/utils.js'; | ||
import {NATIVE} from '../src/mediaTypes.js'; | ||
|
||
const BIDDER_CODE = 'adrino'; | ||
const REQUEST_METHOD = 'POST'; | ||
const BIDDER_HOST = 'https://prd-prebid-bidder.adrino.io'; | ||
const GVLID = 1072; | ||
|
||
export const spec = { | ||
code: BIDDER_CODE, | ||
gvlid: GVLID, | ||
supportedMediaTypes: [NATIVE], | ||
|
||
isBidRequestValid: function (bid) { | ||
return !!(bid.bidId) && | ||
!!(bid.params) && | ||
!!(bid.params.hash) && | ||
(typeof bid.params.hash === 'string') && | ||
!!(bid.mediaTypes) && | ||
Object.keys(bid.mediaTypes).includes(NATIVE) && | ||
(bid.bidder === BIDDER_CODE); | ||
}, | ||
|
||
buildRequests: function (validBidRequests, bidderRequest) { | ||
const bidRequests = []; | ||
|
||
for (let i = 0; i < validBidRequests.length; i++) { | ||
let requestData = { | ||
bidId: validBidRequests[i].bidId, | ||
nativeParams: validBidRequests[i].nativeParams, | ||
placementHash: validBidRequests[i].params.hash, | ||
referer: bidderRequest.refererInfo.referer, | ||
userAgent: navigator.userAgent, | ||
} | ||
|
||
if (bidderRequest && bidderRequest.gdprConsent) { | ||
requestData.gdprConsent = { | ||
consentString: bidderRequest.gdprConsent.consentString, | ||
consentRequired: bidderRequest.gdprConsent.gdprApplies | ||
} | ||
} | ||
|
||
bidRequests.push({ | ||
method: REQUEST_METHOD, | ||
url: BIDDER_HOST + '/bidder/bid/', | ||
data: requestData, | ||
options: { | ||
contentType: 'application/json', | ||
withCredentials: false, | ||
} | ||
}); | ||
} | ||
|
||
return bidRequests; | ||
}, | ||
|
||
interpretResponse: function (serverResponse, bidRequest) { | ||
const response = serverResponse.body; | ||
const bidResponses = []; | ||
if (!response.noAd) { | ||
bidResponses.push(response); | ||
} | ||
return bidResponses; | ||
}, | ||
|
||
onBidWon: function (bid) { | ||
if (bid['requestId']) { | ||
triggerPixel(BIDDER_HOST + '/bidder/won/' + bid['requestId']); | ||
} | ||
} | ||
}; | ||
|
||
registerBidder(spec); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Overview | ||
|
||
``` | ||
Module Name: Adrino Bidder Adapter | ||
Module Type: Bidder Adapter | ||
Maintainer: dev@adrino.pl | ||
``` | ||
|
||
# Description | ||
|
||
Module connects to Adrino bidder to fetch bids. Only native format is supported. | ||
|
||
# Test Parameters | ||
|
||
``` | ||
var adUnits = [ | ||
code: '/12345678/prebid_native_example_1', | ||
mediaTypes: { | ||
native: { | ||
image: { | ||
required: true, | ||
sizes: [[300, 210],[300,150],[140,100]] | ||
}, | ||
title: { | ||
required: true | ||
}, | ||
sponsoredBy: { | ||
required: false | ||
}, | ||
body: { | ||
required: false | ||
}, | ||
icon: { | ||
required: false | ||
} | ||
} | ||
}, | ||
bids: [{ | ||
bidder: 'adrino', | ||
params: { | ||
hash: 'abcdef123456' | ||
} | ||
}] | ||
]; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.