Skip to content

Invibes Bid Adapter - support for adUnitCode differentiation in multiposition #7652

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

Merged
merged 37 commits into from
Nov 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
3ad6bf0
Invibes Bid Adapter - support for adUnitCode differentiation in multi…
rcheptanariu Nov 2, 2021
e60844e
TheMediaGrid Bid Adapter: added adlivetech as alias (#7649)
TheMediaGrid Nov 2, 2021
c76dc38
move targets to packag.json (#7641)
ChrisHuie Nov 2, 2021
62ea19f
TrustX Bid Adapter: added support of PBAdSlot module (#7653)
PWyrembak Nov 2, 2021
906e8c4
OpenX Bid adapter: Handle new user Ids (#7642)
luigi-sayson Nov 2, 2021
c533fb6
Saamba Bid Adapter: support video params, and the floors module (#7448)
NeerajKrRai Nov 3, 2021
5960369
IX Bid Adapter: capture errors in LS and send errors in request (#7630)
umakajan Nov 3, 2021
832c13e
Deepintent: secure flag set using proper protocol value (#7655)
parthshah51999 Nov 3, 2021
2dbe76f
VIS.X: fix url for timeout pixel (#7657)
mk0x9 Nov 3, 2021
bf48688
appnexus bid adapter - add support for brandId (#7658)
jsnellbaker Nov 3, 2021
afc06fc
Invibes Bid Adapter - redo tests
rcheptanariu Nov 8, 2021
564dcbe
Engageya bid adapter improvements (#7656)
mikomgk Nov 8, 2021
e861406
Eplanning & Adapter Manager: fix testing of innerwidth to fix current…
robertrmartinez Nov 8, 2021
539d1b4
Smaato: Pass through bidRequest.schain (#7675)
el-chuck Nov 8, 2021
6539e76
expose seedtag gvl id for TFC2 support (#7674)
ybootin Nov 8, 2021
5ad61fc
docs only: remove reference to release notes page and some documentat…
smenzer Nov 8, 2021
4253497
Capture target demand provider (#7636)
samueldobbie Nov 9, 2021
22e02f4
Invibes Bid Adapter - added unit tests for adUnitCode logic
rcheptanariu Nov 9, 2021
7775abb
Invibes Bid Adapter - fixed lint
rcheptanariu Nov 9, 2021
3e343ed
Datablocks Bid Adapter: update url (#7680)
jmayor Nov 9, 2021
89f61a7
Datablocks Tests: fix failing tests (#7687)
ChrisHuie Nov 9, 2021
6b027f5
RichAudience Bid Adapter: Update GetFloors (#7664)
richaudience Nov 9, 2021
39b26b3
Adhese Bid Adapter: Configurable vast as url (#7659)
mefjush Nov 9, 2021
1463ed9
add bidderDefaultFunction (#7628)
eknis Nov 9, 2021
fc9caa2
IX Bid Adapter: add support for handling vastXML responses in PBJS (#…
shahinrahbariasl Nov 10, 2021
701eebc
PubMatic Bid Adapter: add Groupm as alias bidder (#7692)
pm-azhar-mulla Nov 10, 2021
bd6f395
GPT Pre Auction: setting GPID (#7671)
robertrmartinez Nov 10, 2021
8163a23
Do not lint node_modules (#7689)
dgirardi Nov 10, 2021
4809a4e
send all custom params to the bidder (#7685)
antoinezaz Nov 10, 2021
b289d73
Revert "RichAudience Bid Adapter: Update GetFloors (#7664)" (#7695)
ChrisHuie Nov 10, 2021
379519b
Prebid 6.1.0 Release
jsnellbaker Nov 10, 2021
2e2fdd8
increment pre version
jsnellbaker Nov 10, 2021
e1e434f
Invibes Bid Adapter - support for adUnitCode differentiation in multi…
rcheptanariu Nov 2, 2021
eb71073
Invibes Bid Adapter - redo tests
rcheptanariu Nov 8, 2021
41e843a
Invibes Bid Adapter - added unit tests for adUnitCode logic
rcheptanariu Nov 9, 2021
35ec312
Invibes Bid Adapter - fixed lint
rcheptanariu Nov 9, 2021
b633982
Merge branch 'master' of github.com:rcheptanariu/Prebid.js
rcheptanariu Nov 11, 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
8 changes: 1 addition & 7 deletions .babelrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,7 @@ module.exports = {
[
useLocal('@babel/preset-env'),
{
"targets": {
"browsers": [
">0.25%",
"not ie 11",
"not op_mini all"
]
}
"useBuiltIns": "entry"
}
]
],
Expand Down
1 change: 1 addition & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ function lint(done) {
'modules/**/*.js',
'test/**/*.js',
'plugins/**/*.js',
'!plugins/**/node_modules/**',
'./*.js'
], { base: './' })
.pipe(gulpif(argv.nolintfix, eslint(), eslint({ fix: true })))
Expand Down
9 changes: 7 additions & 2 deletions modules/adheseBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import { registerBidder } from '../src/adapters/bidderFactory.js';
import { BANNER, VIDEO } from '../src/mediaTypes.js';
import { config } from '../src/config.js';

const BIDDER_CODE = 'adhese';
const GVLID = 553;
Expand All @@ -20,11 +21,15 @@ export const spec = {
if (validBidRequests.length === 0) {
return null;
}

const { gdprConsent, refererInfo } = bidderRequest;

const adheseConfig = config.getConfig('adhese');
const gdprParams = (gdprConsent && gdprConsent.consentString) ? { xt: [gdprConsent.consentString] } : {};
const refererParams = (refererInfo && refererInfo.referer) ? { xf: [base64urlEncode(refererInfo.referer)] } : {};
const commonParams = { ...gdprParams, ...refererParams };
const globalCustomParams = (adheseConfig && adheseConfig.globalTargets) ? cleanTargets(adheseConfig.globalTargets) : {};
const commonParams = { ...globalCustomParams, ...gdprParams, ...refererParams };
const vastContentAsUrl = !(adheseConfig && adheseConfig.vastContentAsUrl == false);

const slots = validBidRequests.map(bid => ({
slotname: bidToSlotName(bid),
Expand All @@ -34,7 +39,7 @@ export const spec = {
const payload = {
slots: slots,
parameters: commonParams,
vastContentAsUrl: true,
vastContentAsUrl: vastContentAsUrl,
user: {
ext: {
eids: getEids(validBidRequests),
Expand Down
61 changes: 61 additions & 0 deletions modules/adlivetechBidAdapter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Overview

Module Name: Adlivetech Bidder Adapter
Module Type: Bidder Adapter
Maintainer: [email protected]

# Description

Module that connects to Grid demand source to fetch bids.
The adapter is GDPR compliant and supports banner and video (instream and outstream).

# Test Parameters
```
var adUnits = [
{
code: 'test-div',
sizes: [[300, 250]],
bids: [
{
bidder: "adlivetech",
params: {
uid: '1',
bidFloor: 0.5
}
}
]
},{
code: 'test-div',
sizes: [[728, 90]],
bids: [
{
bidder: "adlivetech",
params: {
uid: 2,
keywords: {
brandsafety: ['disaster'],
topic: ['stress', 'fear']
}
}
}
]
},
{
code: 'test-div',
sizes: [[728, 90]],
mediaTypes: { video: {
context: 'instream',
playerSize: [728, 90],
mimes: ['video/mp4']
},
bids: [
{
bidder: "adlivetech",
params: {
uid: 11
}
}
]
}
];
```
4 changes: 4 additions & 0 deletions modules/appnexusBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,10 @@ function newBid(serverBid, rtbBid, bidderRequest) {
bid.meta = Object.assign({}, bid.meta, { advertiserId: rtbBid.advertiser_id });
}

if (rtbBid.brand_id) {
bid.meta = Object.assign({}, bid.meta, { brandId: rtbBid.brand_id });
}

if (rtbBid.rtb.video) {
// shared video properties used for all 3 contexts
Object.assign(bid, {
Expand Down
6 changes: 3 additions & 3 deletions modules/datablocksBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export const spec = {
code: 'datablocks',

// DATABLOCKS SCOPED OBJECT
db_obj: {metrics_host: 'prebid.datablocks.net', metrics: [], metrics_timer: null, metrics_queue_time: 1000, vis_optout: false, source_id: 0},
db_obj: {metrics_host: 'prebid.dblks.net', metrics: [], metrics_timer: null, metrics_queue_time: 1000, vis_optout: false, source_id: 0},

// STORE THE DATABLOCKS BUYERID IN STORAGE
store_dbid: function(dbid) {
Expand Down Expand Up @@ -388,12 +388,12 @@ export const spec = {
};

let sourceId = validRequests[0].params.source_id || 0;
let host = validRequests[0].params.host || 'prebid.datablocks.net';
let host = validRequests[0].params.host || 'prebid.dblks.net';

// RETURN WITH THE REQUEST AND PAYLOAD
return {
method: 'POST',
url: `https://${sourceId}.${host}/openrtb/?sid=${sourceId}`,
url: `https://${host}/openrtb/?sid=${sourceId}`,
data: {
id: bidderRequest.auctionId,
imp: imps,
Expand Down
2 changes: 1 addition & 1 deletion modules/deepintentBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ function buildImpression(bid) {
impression = {
id: bid.bidId,
tagid: bid.params.tagId || '',
secure: window.location.protocol === 'https' ? 1 : 0,
secure: window.location.protocol === 'https:' ? 1 : 0,
displaymanager: 'di_prebid',
displaymanagerver: DI_M_V,
ext: buildCustomParams(bid)
Expand Down
122 changes: 68 additions & 54 deletions modules/engageyaBidAdapter.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import {
BANNER,
NATIVE
} from '../src/mediaTypes.js';
import { BANNER, NATIVE } from '../src/mediaTypes.js';
import { createTrackPixelHtml } from '../src/utils.js';

const {
Expand All @@ -10,14 +7,21 @@ const {
const BIDDER_CODE = 'engageya';
const ENDPOINT_URL = 'https://recs.engageya.com/rec-api/getrecs.json';
const ENDPOINT_METHOD = 'GET';
const SUPPORTED_SIZES = [
[100, 75], [236, 202], [100, 100], [130, 130], [200, 200], [250, 250], [300, 272], [300, 250], [300, 230], [300, 214], [300, 187], [300, 166], [300, 150], [300, 133], [300, 120], [400, 200], [300, 200], [250, 377], [620, 410], [207, 311], [310, 166], [310, 333], [190, 106], [228, 132], [300, 174], [80, 60], [600, 500], [600, 600], [1080, 610], [1080, 610], [624, 350], [650, 1168], [1080, 1920], [300, 374]
];

function getPageUrl() {
var pUrl = window.location.href;
if (isInIframe()) {
pUrl = document.referrer ? document.referrer : pUrl;
function getPageUrl(bidRequest, bidderRequest) {
if (bidRequest.params.pageUrl && bidRequest.params.pageUrl != '[PAGE_URL]') {
return bidRequest.params.pageUrl;
}
pUrl = encodeURIComponent(pUrl);
return pUrl;
if (bidderRequest && bidderRequest.refererInfo && bidderRequest.refererInfo.referer) {
return bidderRequest.refererInfo.referer;
}
const pageUrl = (isInIframe() && document.referrer)
? document.referrer
: window.location.href;
return encodeURIComponent(pageUrl);
}

function isInIframe() {
Expand All @@ -33,13 +37,14 @@ function getImageSrc(rec) {
return rec.thumbnail_path.indexOf('http') === -1 ? 'https:' + rec.thumbnail_path : rec.thumbnail_path;
}

function getImpressionTrackers(rec) {
function getImpressionTrackers(rec, response) {
const responseTrackers = [response.viewPxl];
if (!rec.trackers) {
return [];
return responseTrackers;
}
const impressionTrackers = rec.trackers.impressionPixels || [];
const viewTrackers = rec.trackers.viewPixels || [];
return [...impressionTrackers, ...viewTrackers];
return [...impressionTrackers, ...viewTrackers, ...responseTrackers];
}

function parseNativeResponse(rec, response) {
Expand All @@ -56,7 +61,7 @@ function parseNativeResponse(rec, response) {
displayUrl: rec.url,
cta: '',
sponsoredBy: rec.displayName,
impressionTrackers: getImpressionTrackers(rec),
impressionTrackers: getImpressionTrackers(rec, response),
};
}

Expand All @@ -74,56 +79,65 @@ function parseBannerResponse(rec, response) {
}
const title = rec.title && rec.title.trim() ? `<div class="eng_tag_ttl" style="display: none">${rec.title}</div>` : '';
const displayName = rec.displayName && title ? `<div class="eng_tag_brnd" style="display: none">${rec.displayName}</div>` : '';
const trackers = getImpressionTrackers(rec)
const trackers = getImpressionTrackers(rec, response)
.map(createTrackPixelHtml)
.join('');
return `<html><body>${style}<div id="ENG_TAG"><a href="${rec.clickUrl}" target=_blank><img class="eng_tag_img" src="${getImageSrc(rec)}" style="width:${response.imageWidth}px;height:${response.imageHeight}px;" alt="${rec.title}"/>${displayName}${title}</a>${trackers}</div></body></html>`;
}

function getImageSize(bidRequest) {
if (bidRequest.sizes && bidRequest.sizes.length > 0) {
return bidRequest.sizes[0];
} else if (bidRequest.nativeParams && bidRequest.nativeParams.image && bidRequest.nativeParams.image.sizes) {
return bidRequest.nativeParams.image.sizes;
}
return [-1, -1];
}

function isValidSize([width, height]) {
if (!width || !height) {
return false;
}
return SUPPORTED_SIZES.some(([supportedWidth, supportedHeight]) => supportedWidth === width && supportedHeight === height);
}

export const spec = {
code: BIDDER_CODE,
supportedMediaTypes: [BANNER, NATIVE],
isBidRequestValid: function (bid) {
return bid && bid.params && bid.params.hasOwnProperty('widgetId') && bid.params.hasOwnProperty('websiteId') && !isNaN(bid.params.widgetId) && !isNaN(bid.params.websiteId);

isBidRequestValid: function (bidRequest) {
return bidRequest &&
bidRequest.params &&
bidRequest.params.hasOwnProperty('widgetId') &&
bidRequest.params.hasOwnProperty('websiteId') &&
!isNaN(bidRequest.params.widgetId) &&
!isNaN(bidRequest.params.websiteId) &&
isValidSize(getImageSize(bidRequest));
},

buildRequests: function (validBidRequests, bidderRequest) {
var bidRequests = [];
if (validBidRequests && validBidRequests.length > 0) {
validBidRequests.forEach(function (bidRequest) {
if (bidRequest.params) {
var mediaType = bidRequest.hasOwnProperty('nativeParams') ? 1 : 2;
var imageWidth = -1;
var imageHeight = -1;
if (bidRequest.sizes && bidRequest.sizes.length > 0) {
imageWidth = bidRequest.sizes[0][0];
imageHeight = bidRequest.sizes[0][1];
} else if (bidRequest.nativeParams && bidRequest.nativeParams.image && bidRequest.nativeParams.image.sizes) {
imageWidth = bidRequest.nativeParams.image.sizes[0];
imageHeight = bidRequest.nativeParams.image.sizes[1];
}

var widgetId = bidRequest.params.widgetId;
var websiteId = bidRequest.params.websiteId;
var pageUrl = (bidRequest.params.pageUrl && bidRequest.params.pageUrl != '[PAGE_URL]') ? bidRequest.params.pageUrl : '';
if (!pageUrl) {
pageUrl = (bidderRequest && bidderRequest.refererInfo && bidderRequest.refererInfo.referer) ? bidderRequest.refererInfo.referer : getPageUrl();
}
var bidId = bidRequest.bidId;
var finalUrl = ENDPOINT_URL + '?pubid=0&webid=' + websiteId + '&wid=' + widgetId + '&url=' + pageUrl + '&ireqid=' + bidId + '&pbtpid=' + mediaType + '&imw=' + imageWidth + '&imh=' + imageHeight;
if (bidderRequest && bidderRequest.gdprConsent && bidderRequest.gdprApplies && bidderRequest.consentString) {
finalUrl += '&is_gdpr=1&gdpr_consent=' + bidderRequest.consentString;
}
bidRequests.push({
url: finalUrl,
method: ENDPOINT_METHOD,
data: ''
});
}
});
if (!validBidRequests) {
return [];
}

return bidRequests;
return validBidRequests.map(bidRequest => {
if (bidRequest.params) {
const mediaType = bidRequest.hasOwnProperty('nativeParams') ? 1 : 2;
const [imageWidth, imageHeight] = getImageSize(bidRequest);
const widgetId = bidRequest.params.widgetId;
const websiteId = bidRequest.params.websiteId;
const pageUrl = getPageUrl(bidRequest, bidderRequest);
const bidId = bidRequest.bidId;
let finalUrl = ENDPOINT_URL + '?pubid=0&webid=' + websiteId + '&wid=' + widgetId + '&url=' + pageUrl + '&ireqid=' + bidId + '&pbtpid=' + mediaType + '&imw=' + imageWidth + '&imh=' + imageHeight;
if (bidderRequest && bidderRequest.gdprConsent && bidderRequest.gdprApplies && bidderRequest.consentString) {
finalUrl += '&is_gdpr=1&gdpr_consent=' + bidderRequest.consentString;
}
return {
url: finalUrl,
method: ENDPOINT_METHOD,
data: ''
};
}
}).filter(Boolean);
},

interpretResponse: function (serverResponse, bidRequest) {
Expand All @@ -135,12 +149,12 @@ export const spec = {
return response.recs.map(rec => {
let bid = {
requestId: response.ireqId,
cpm: rec.ecpm,
width: response.imageWidth,
height: response.imageHeight,
creativeId: rec.postId,
cpm: rec.pecpm || (rec.ecpm / 100),
currency: 'USD',
netRevenue: false,
netRevenue: !!rec.pecpm,
ttl: 360,
meta: { advertiserDomains: rec.domain ? [rec.domain] : [] },
}
Expand Down
Loading