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

Update remote repository #17

Merged
merged 24 commits into from
Oct 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
630b24e
Cwire bid adapter: initial release (#7421)
kodi Oct 7, 2021
88bbec1
PubMatic Bid Adapter: fix a typo in outstreamAU param name docs (#7547)
pm-harshad-mane Oct 7, 2021
9c35483
Ad Generation: adding new format and adomain support (#7533)
banakemi Oct 7, 2021
6d8a146
Ogury Bid Adapter: adding onTimeout support (#7535)
mbouallagui Oct 8, 2021
2e83adc
Dgkeeword RTD: add content type to request (#7550)
mediaconsortium-develop Oct 8, 2021
f72e63f
VIS.X: iframe sync support & optional video params (#7527)
mk0x9 Oct 9, 2021
a9e1060
Talkads Bid Adapter: add new bid adapter (#7546)
natexo-technical-team Oct 12, 2021
7123eae
Pubmatic Bid Adapter: video.placement param missing message in debug …
kapil-tuptewar Oct 12, 2021
b2fe194
replace Array.from function and use from core-js (#7562)
FilipStamenkovic Oct 12, 2021
b14589b
Adkernel Bid Adapter: add turktelekom alias (#7559)
ckbo3hrk Oct 12, 2021
74cd51a
Yahoo SSP Bid Adapter: Initial Release (#7522)
adam-browning Oct 12, 2021
9d9621d
Support yahoo.com eid source value (#7563)
slimkrazy Oct 12, 2021
e54ec61
Ogury Bid Adapter: Handle TTD as a new source (#7558)
AurelienMozoo Oct 12, 2021
424d9a0
Yieldlab Adapter: add support for iab content (#7413)
rey1128 Oct 12, 2021
a5ffc7f
Proxistore Bid Adapter: export vendor id in gvlid (#7553)
vincentproxistore Oct 12, 2021
e60d065
Yieldlab Bid Adapter: fix for utils root no longer (#7568)
ChrisHuie Oct 12, 2021
60672a5
Livewrapper Analytics Adapter: prioritize reporting Livewrapped floor…
bjorn-lw Oct 12, 2021
cf2395e
BLIINK Bid Adapter : Add new format, outstream, banner (#7529)
Kola-Kola Oct 13, 2021
c514d20
Nativo Bid Adapter : refresh increment logic change (#7569)
jsfledd Oct 13, 2021
719523b
add docReferrer (#7551)
AdmixerTech Oct 13, 2021
b8a7ee4
Yahoo SSP Bid Adapter: fix for adId (#7571)
adam-browning Oct 13, 2021
e20c46f
adding page URL to bid request (#7581)
mbouallagui Oct 14, 2021
8cb2250
Pixfuture Bid Adapter: updated the getUserSyncs method (#7456)
pixfuture-media Oct 14, 2021
7b6aad6
delete rogue yarn.lock (#7572)
ChrisHuie Oct 14, 2021
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
32 changes: 28 additions & 4 deletions modules/adgenerationBidAdapter.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { tryAppendQueryString, getBidIdParameter } from '../src/utils.js';
import {tryAppendQueryString, getBidIdParameter} from '../src/utils.js';
import {registerBidder} from '../src/adapters/bidderFactory.js';
import {BANNER, NATIVE} from '../src/mediaTypes.js';
import {config} from '../src/config.js';
Expand All @@ -25,7 +25,7 @@ export const spec = {
* @return ServerRequest Info describing the request to the server.
*/
buildRequests: function (validBidRequests, bidderRequest) {
const ADGENE_PREBID_VERSION = '1.1.0';
const ADGENE_PREBID_VERSION = '1.2.0';
let serverRequests = [];
for (let i = 0, len = validBidRequests.length; i < len; i++) {
const validReq = validBidRequests[i];
Expand Down Expand Up @@ -118,13 +118,25 @@ export const spec = {
function createAd(body, bidRequest) {
let ad = body.ad;
if (body.vastxml && body.vastxml.length > 0) {
ad = `<body><div id="apvad-${bidRequest.bidId}"></div>${createAPVTag()}${insertVASTMethod(bidRequest.bidId, body.vastxml)}</body>`;
if (isUpperBillboard(body)) {
const marginTop = bidRequest.params.marginTop ? bidRequest.params.marginTop : '0';
ad = `<body>${createADGBrowserMTag()}${insertVASTMethodForADGBrowserM(body.vastxml, marginTop)}</body>`;
} else {
ad = `<body><div id="apvad-${bidRequest.bidId}"></div>${createAPVTag()}${insertVASTMethodForAPV(bidRequest.bidId, body.vastxml)}</body>`;
}
}
ad = appendChildToBody(ad, body.beacon);
if (removeWrapper(ad)) return removeWrapper(ad);
return ad;
}

function isUpperBillboard(body) {
if (body.location_params && body.location_params.option && body.location_params.option.ad_type) {
return body.location_params.option.ad_type === 'upper_billboard';
}
return false;
}

function isNative(body) {
if (!body) return false;
return body.native_ad && body.native_ad.assets.length > 0;
Expand Down Expand Up @@ -190,7 +202,12 @@ function createAPVTag() {
return apvScript.outerHTML;
}

function insertVASTMethod(targetId, vastXml) {
function createADGBrowserMTag() {
const ADGBrowserMURL = 'https://i.socdm.com/sdk/js/adg-browser-m.js';
return `<script type="text/javascript" src="${ADGBrowserMURL}"></script>`;
}

function insertVASTMethodForAPV(targetId, vastXml) {
let apvVideoAdParam = {
s: targetId
};
Expand All @@ -200,6 +217,13 @@ function insertVASTMethod(targetId, vastXml) {
return script.outerHTML;
}

function insertVASTMethodForADGBrowserM(vastXml, marginTop) {
const script = document.createElement(`script`);
script.type = 'text/javascript';
script.innerHTML = `window.ADGBrowserM.init({vastXml: '${vastXml.replace(/\r?\n/g, '')}', marginTop: '${marginTop}'});`;
return script.outerHTML;
}

/**
*
* @param ad
Expand Down
3 changes: 2 additions & 1 deletion modules/adkernelBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ export const spec = {
{code: 'denakop'},
{code: 'rtbanalytica'},
{code: 'unibots'},
{code: 'ergadx'}
{code: 'ergadx'},
{code: 'turktelekom'}
],
supportedMediaTypes: [BANNER, VIDEO, NATIVE],

Expand Down
11 changes: 11 additions & 0 deletions modules/admixerBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,20 @@ export const spec = {
* Make a server request from the list of BidRequests.
*/
buildRequests: function (validRequest, bidderRequest) {
let w;
let docRef;
do {
w = w ? w.parent : window;
try {
docRef = w.document.referrer;
} catch (e) {
break;
}
} while (w !== window.top);
const payload = {
imps: [],
ortb2: config.getConfig('ortb2'),
docReferrer: docRef,
};
let endpointUrl;
if (bidderRequest) {
Expand Down
3 changes: 2 additions & 1 deletion modules/aolBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ const SUPPORTED_USER_ID_SOURCES = [
'liveintent.com',
'quantcast.com',
'verizonmedia.com',
'liveramp.com'
'liveramp.com',
'yahoo.com'
];

const pubapiTemplate = template`${'host'}/pubapi/3.0/${'network'}/${'placement'}/${'pageid'}/${'sizeid'}/ADTECH;v=2;cmd=bid;cors=yes;alias=${'alias'};misc=${'misc'};${'dynamicParams'}`;
Expand Down
90 changes: 58 additions & 32 deletions modules/bliinkBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ export const META_KEYWORDS = 'keywords'
export const META_DESCRIPTION = 'description'

const VIDEO = 'video'
const NATIVE = 'native'
const BANNER = 'banner'

const supportedMediaTypes = [BANNER, VIDEO, NATIVE]
const supportedMediaTypes = [BANNER, VIDEO]
const aliasBidderCode = ['bk']

export function getMetaList(name) {
Expand Down Expand Up @@ -90,7 +89,11 @@ export const parseXML = (content) => {
if (typeof content !== 'string' || content.length === 0) return null

const parser = new DOMParser()
const xml = parser.parseFromString(content, 'text/xml')
let xml;

try {
xml = parser.parseFromString(content, 'text/xml')
} catch (e) {}

if (xml &&
xml.getElementsByTagName('VAST')[0] &&
Expand All @@ -104,19 +107,19 @@ export const parseXML = (content) => {
/**
* @param bidRequest
* @param bliinkCreative
* @return {{cpm, netRevenue: boolean, ad: string, requestId, width: number, currency: string, mediaType: string, vastXml, ttl: number, height: number}|null}
* @return {{cpm, netRevenue: boolean, requestId, width: (*|number), currency, ttl: number, creativeId, height: (*|number)} & {mediaType: string, vastXml}}
*/
export const buildBid = (bidRequest, bliinkCreative) => {
if (!bidRequest && !bliinkCreative) return null

const body = {
requestId: bidRequest.bidId,
currency: bliinkCreative.currency,
cpm: bliinkCreative.price,
creativeId: bliinkCreative.creativeId,
currency: 'EUR',
width: (bidRequest.sizes && bidRequest.sizes[0][0]) || 1,
height: (bidRequest.sizes && bidRequest.sizes[0][1]) || 1,
netRevenue: false,
width: 1,
height: 1,
ttl: 3600,
}

Expand All @@ -131,14 +134,20 @@ export const buildBid = (bidRequest, bliinkCreative) => {

delete bidRequest['bids']

return Object.assign(body, {
currency: bliinkCreative.currency,
width: 1,
height: 1,
mediaType: VIDEO,
ad: '<html lang="en"></html>',
vastXml: bliinkCreative.content,
})
switch (bliinkCreative.media_type) {
case VIDEO:
return Object.assign(body, {
mediaType: VIDEO,
vastXml: bliinkCreative.content,
})
case BANNER:
return Object.assign(body, {
mediaType: BANNER,
ad: (bliinkCreative && bliinkCreative.content && bliinkCreative.content.creative && bliinkCreative.content.creative.adm) || '',
})
default:
break;
}
}

/**
Expand Down Expand Up @@ -209,7 +218,7 @@ export const buildRequests = (_, bidderRequest) => {
* @return
*/
const interpretResponse = (serverResponse, request) => {
if ((serverResponse && serverResponse.mode === 'no-ad') && (!request.params)) {
if ((serverResponse && serverResponse.mode === 'no-ad')) {
return []
}

Expand All @@ -218,23 +227,40 @@ const interpretResponse = (serverResponse, request) => {

const xml = parseXML(body)

if (xml) {
const price = xml.getElementsByTagName('Price') && xml.getElementsByTagName('Price')[0]
const currency = xml.getElementsByTagName('Currency') && xml.getElementsByTagName('Currency')[0]
const creativeId = xml.getElementsByTagName('CreativeId') && xml.getElementsByTagName('CreativeId')[0]

const creative = {
content: body,
price: (price && price.textContent) || 0,
currency: (currency && currency.textContent) || 'EUR',
creativeId: creativeId || 0,
media_type: 'video',
}

return buildBid(serverBody.bids[0], creative);
let creative;

switch (serverBody.bids[0].params.placement) {
case xml && VIDEO:
const price = xml.getElementsByTagName('Price') && xml.getElementsByTagName('Price')[0]
const currency = xml.getElementsByTagName('Currency') && xml.getElementsByTagName('Currency')[0]
const creativeId = xml.getElementsByTagName('CreativeId') && xml.getElementsByTagName('CreativeId')[0]

creative = {
content: body,
price: (price && price.textContent) || 0,
currency: (currency && currency.textContent) || 'EUR',
creativeId: creativeId || 0,
media_type: 'video',
}

return buildBid(serverBody.bids[0], creative)
case BANNER:
if (body) {
creative = {
content: body,
price: body.price,
currency: body.currency,
creativeId: 0,
media_type: 'banner',
}

return buildBid(serverBody.bids[0], creative)
}

break
default:
break
}

return []
}

/**
Expand Down
35 changes: 29 additions & 6 deletions modules/bliinkBidAdapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const adUnits = [
bidder: 'bliink',
params: {
placement: 'banner',
tagId: '14f30eca-85d2-11e8-9eed-0242ac120007'
tagId: '41'
}
}
]
Expand All @@ -50,11 +50,34 @@ const adUnits = [
mediaTypes: {
video: {
context: 'instream',
playerSize: [640, 480],
mimes: ['video/mp4'],
protocols: [1, 2, 3, 4, 5, 6, 7, 8],
playbackmethod: [2],
skip: 1
playerSize: [[640,480]],
}
},
bids: [
{
bidder: 'bliink',
params: {
tagId: '41',
placement: 'video',
}
}
]
}
]
```

## Sample outstream Video Ad Unit

```js
const adUnits = [
{
code: '/19968336/prebid_cache_video_adunit',
sizes: [[640,480]],
mediaType: 'video',
mediaTypes: {
video: {
context: 'outstream',
playerSize: [[640,480]],
}
},
bids: [
Expand Down
Loading