forked from prebid/Prebid.js
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #57 from voyagegroup/update-prebid-8.32.0
Update to Prebid.js v8.32.0
- Loading branch information
Showing
240 changed files
with
11,299 additions
and
3,393 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
<html> | ||
|
||
<head> | ||
<script src="http://localhost:9999/build/dev/prebid.js" async></script> | ||
<script async src="https://www.googletagservices.com/tag/js/gpt.js"></script> | ||
<script async> | ||
const FAILSAFE_TIMEOUT = 8000; | ||
const PREBID_TIMEOUT = 5000; | ||
|
||
const bidders = [ | ||
{ | ||
bidder: 'appnexus', | ||
params: { | ||
placementId: 13144370 | ||
} | ||
} | ||
]; | ||
|
||
var adUnits = [ | ||
{ | ||
code: 'div-gpt-ad-1460505748561-0', | ||
mediaTypes: { | ||
banner: { | ||
sizes: [[300, 250], [300, 600]], | ||
} | ||
}, | ||
bids: bidders, | ||
} | ||
]; | ||
|
||
|
||
var pbjs = pbjs || {}; | ||
pbjs.que = pbjs.que || []; | ||
var googletag = googletag || {}; | ||
googletag.cmd = googletag.cmd || []; | ||
googletag.cmd.push(function () { | ||
googletag.pubads().disableInitialLoad(); | ||
googletag.defineSlot('/19968336/header-bid-tag-0', [[300, 250], [300, 600]], 'div-gpt-ad-1460505748561-0').addService(googletag.pubads()); | ||
googletag.pubads().enableSingleRequest(); | ||
googletag.enableServices(); | ||
}); | ||
|
||
pbjs.que.push(function () { | ||
pbjs.setConfig({ | ||
debug: true, | ||
realTimeData: { | ||
auctionDelay: 100, | ||
dataProviders: [ | ||
{ | ||
name: "contxtful", | ||
waitForIt: true, | ||
params: { | ||
version: "Contact contact@contxtful.com for the API version", | ||
customer: "Contact contact@contxtful.com for the customer ID" | ||
} | ||
} | ||
] | ||
} | ||
}); | ||
pbjs.addAdUnits(adUnits); | ||
pbjs.requestBids({ | ||
bidsBackHandler: sendAdserverRequest, | ||
timeout: PREBID_TIMEOUT | ||
}); | ||
}); | ||
|
||
function sendAdserverRequest() { | ||
if (pbjs.adserverRequestSent) return; | ||
pbjs.adserverRequestSent = true; | ||
googletag.cmd.push(function () { | ||
pbjs.que.push(function () { | ||
pbjs.setTargetingForGPTAsync(); | ||
googletag.pubads().refresh(); | ||
}); | ||
}); | ||
} | ||
|
||
setTimeout(function () { | ||
sendAdserverRequest(); | ||
}, FAILSAFE_TIMEOUT); | ||
|
||
</script> | ||
</head> | ||
|
||
<body> | ||
<h2>Contxtful RTD Provider</h2> | ||
<div id='div-gpt-ad-1460505748561-0'></div> | ||
</div> | ||
</body> | ||
|
||
</html> |
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,59 @@ | ||
import { registerBidder } from '../src/adapters/bidderFactory.js'; | ||
import { BANNER } from '../src/mediaTypes.js'; | ||
import { getStorageManager } from '../src/storageManager.js'; | ||
|
||
export const BIDDER_CODE = 'ad2iction'; | ||
export const SUPPORTED_AD_TYPES = [BANNER]; | ||
export const API_ENDPOINT = 'https://ads.ad2iction.com/html/prebid/'; | ||
export const API_VERSION_NUMBER = 3; | ||
export const COOKIE_NAME = 'ad2udid'; | ||
|
||
export const storage = getStorageManager({ bidderCode: BIDDER_CODE }); | ||
|
||
export const spec = { | ||
code: BIDDER_CODE, | ||
aliases: ['ad2'], | ||
supportedMediaTypes: SUPPORTED_AD_TYPES, | ||
isBidRequestValid: (bid) => { | ||
return !!bid.params.id && typeof bid.params.id === 'string'; | ||
}, | ||
buildRequests: (validBidRequests, bidderRequest) => { | ||
const ids = validBidRequests.map((bid) => { | ||
return { bannerId: bid.params.id, bidId: bid.bidId }; | ||
}); | ||
|
||
const options = { | ||
contentType: 'application/json', | ||
withCredentials: false, | ||
}; | ||
|
||
const udid = storage.cookiesAreEnabled() && storage.getCookie(COOKIE_NAME); | ||
|
||
const data = { | ||
ids: JSON.stringify(ids), | ||
ortb2: bidderRequest.ortb2, | ||
refererInfo: bidderRequest.refererInfo, | ||
v: API_VERSION_NUMBER, | ||
udid: udid || '', | ||
_: Math.round(new Date().getTime()), | ||
}; | ||
|
||
return { | ||
method: 'POST', | ||
url: API_ENDPOINT, | ||
data, | ||
options, | ||
}; | ||
}, | ||
interpretResponse: (serverResponse, bidRequest) => { | ||
if (!Array.isArray(serverResponse.body)) { | ||
return []; | ||
} | ||
|
||
const bidResponses = serverResponse.body; | ||
|
||
return bidResponses; | ||
}, | ||
}; | ||
|
||
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,30 @@ | ||
# Overview | ||
|
||
**Module Name**: Ad2iction Bidder Adapter | ||
**Module Type**: Bidder Adapter | ||
**Maintainer**: prebid@ad2iction.com | ||
|
||
# Description | ||
|
||
The Ad2iction Bidding adapter requires setup before beginning. Please contact us on https://www.ad2iction.com. | ||
|
||
# Sample Ad Unit Config | ||
``` | ||
var adUnits = [ | ||
// Banner adUnit | ||
{ | ||
code: 'banner-div', | ||
mediaTypes: { | ||
banner: { | ||
sizes: [[300, 250], [336, 280]] | ||
} | ||
}, | ||
bids: [{ | ||
bidder: 'ad2iction', | ||
params: { | ||
id: 'accepted-uuid' | ||
} | ||
}] | ||
} | ||
]; | ||
``` |
Oops, something went wrong.