Skip to content

Commit

Permalink
Merge branch 'prebid:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
idanbotbol authored Sep 4, 2023
2 parents 5b68908 + 5e8c2f5 commit 11485ab
Show file tree
Hide file tree
Showing 10 changed files with 638 additions and 266 deletions.
45 changes: 42 additions & 3 deletions modules/bliinkBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const META_DESCRIPTION = 'description'

const VIDEO = 'video'
const BANNER = 'banner'

window.bliinkBid = window.bliinkBid || {};
const supportedMediaTypes = [BANNER, VIDEO]
const aliasBidderCode = ['bk']

Expand All @@ -23,6 +23,37 @@ function getCoppa() {
return config.getConfig('coppa') === true ? 1 : 0;
}

/**
* Retrieves the effective connection type from the browser's Navigator API.
* @returns {string} The effective connection type or 'unsupported' if unavailable.
*/
export function getEffectiveConnectionType() {
/**
* The effective connection type obtained from the browser's Navigator API.
* @type {string|undefined}
*/
const navigatorEffectiveType = navigator?.connection?.effectiveType;

if (navigatorEffectiveType) {
return navigatorEffectiveType;
}

return 'unsupported';
}

/**
* Retrieves the user IDs as EIDs from the first valid bid request.
*
* @param {Array} validBidRequests - Array of valid bid requests
* @returns {Array|undefined} - Array of user IDs as EIDs, or undefined if not found
*/
export function getUserIds(validBidRequests) {
/** @type {Object} */
const firstBidRequest = validBidRequests?.[0]
if (firstBidRequest?.userIds) {
return firstBidRequest.userIds
}
}
export function getMetaList(name) {
if (!name || name.length === 0) return []

Expand Down Expand Up @@ -151,13 +182,16 @@ export const buildRequests = (validBidRequests, bidderRequest) => {
if (!validBidRequests || !bidderRequest || !bidderRequest.bids) return null

const tags = bidderRequest.bids.map((bid) => {
const id = bid.params.tagId
return {
sizes: bid.sizes.map((size) => ({ w: size[0], h: size[1] })),
id: bid.params.tagId,
id,
// TODO: bidId is globally unique, is it a good choice for transaction ID (vs ortb2Imp.ext.tid)?
transactionId: bid.bidId,
mediaTypes: Object.keys(bid.mediaTypes),
imageUrl: deepAccess(bid, 'params.imageUrl', ''),
videoUrl: deepAccess(bid, 'params.videoUrl', ''),
refresh: (window.bliinkBid[id] = (window.bliinkBid[id] ?? -1) + 1) || undefined,
};
});

Expand All @@ -167,11 +201,17 @@ export const buildRequests = (validBidRequests, bidderRequest) => {
pageUrl: deepAccess(bidderRequest, 'refererInfo.page'),
pageDescription: getMetaValue(META_DESCRIPTION),
keywords: getKeywords().join(','),
ect: getEffectiveConnectionType(),
};

const schain = deepAccess(validBidRequests[0], 'schain')
const userIds = getUserIds(validBidRequests)
if (schain) {
request.schain = schain
}
if (userIds) {
request.userIds = userIds
}
const gdprConsent = deepAccess(bidderRequest, 'gdprConsent');
if (!!gdprConsent && gdprConsent.gdprApplies) {
request.gdpr = true
Expand All @@ -183,7 +223,6 @@ export const buildRequests = (validBidRequests, bidderRequest) => {
if (bidderRequest.uspConsent) {
deepSetValue(request, 'uspConsent', bidderRequest.uspConsent);
}

return {
method: 'POST',
url: BLIINK_ENDPOINT_ENGINE,
Expand Down
3 changes: 1 addition & 2 deletions modules/hadronIdSystem.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,4 @@ The below parameters apply only to the HadronID User ID Module integration.
| value | Optional | Object | Used only if the page has a separate mechanism for storing the Hadron ID. The value is an object containing the values to be sent to the adapters. In this scenario, no URL is called and nothing is added to local storage | `{"hadronId": "eb33b0cb-8d35-4722-b9c0-1a31d4064888"}` |
| params | Optional | Object | Used to store params for the id system |
| params.partnerId | Required | Number | This is the Audigent Partner ID obtained from Audigent. | `1234` |
| params.url | Optional | String | Set an alternate GET url for HadronId with this parameter |
| params.urlArg | Optional | Object | Optional url parameter for params.url |
|
4 changes: 3 additions & 1 deletion modules/rubiconBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,9 @@ export const spec = {
data['eid_id5-sync.com'] = `${eid.uids[0].id}^${eid.uids[0].atype}^${(eid.uids[0].ext && eid.uids[0].ext.linkType) || ''}`;
} else {
// add anything else with this generic format
data[`eid_${eid.source}`] = `${eid.uids[0].id}^${eid.uids[0].atype || ''}`;
// if rubicon drop ^
const id = eid.source === 'rubiconproject.com' ? eid.uids[0].id : `${eid.uids[0].id}^${eid.uids[0].atype || ''}`
data[`eid_${eid.source}`] = id;
}
// send AE "ppuid" signal if exists, and hasn't already been sent
if (!data['ppuid']) {
Expand Down
3 changes: 3 additions & 0 deletions modules/smilewantedBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ import { config } from '../src/config.js';
import { registerBidder } from '../src/adapters/bidderFactory.js';
import { BANNER, VIDEO } from '../src/mediaTypes.js';

const GVL_ID = 639;

export const spec = {
code: 'smilewanted',
aliases: ['smile', 'sw'],
gvlid: GVL_ID,
supportedMediaTypes: [BANNER, VIDEO],
/**
* Determines whether or not the given bid request is valid.
Expand Down
4 changes: 2 additions & 2 deletions modules/ttdBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { registerBidder } from '../src/adapters/bidderFactory.js';
import { BANNER, VIDEO } from '../src/mediaTypes.js';
import {isNumber} from '../src/utils.js';

const BIDADAPTERVERSION = 'TTD-PREBID-2022.06.28';
const BIDADAPTERVERSION = 'TTD-PREBID-2023.09.05';
const BIDDER_CODE = 'ttd';
const BIDDER_CODE_LONG = 'thetradedesk';
const BIDDER_ENDPOINT = 'https://direct.adsrvr.org/bid/bidder/';
Expand Down Expand Up @@ -406,7 +406,7 @@ export const spec = {
buildRequests: function (validBidRequests, bidderRequest) {
const firstPartyData = bidderRequest.ortb2 || {};
let topLevel = {
id: bidderRequest.auctionId,
id: bidderRequest.bidderRequestId,
imp: validBidRequests.map(bidRequest => getImpression(bidRequest)),
site: getSite(bidderRequest, firstPartyData),
device: getDevice(firstPartyData),
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "prebid.js",
"version": "8.12.0-pre",
"version": "8.13.0-pre",
"description": "Header Bidding Management Library",
"main": "src/prebid.js",
"scripts": {
Expand Down
Loading

0 comments on commit 11485ab

Please sign in to comment.