Skip to content

Commit

Permalink
Merge pull request #29 from prebid/master
Browse files Browse the repository at this point in the history
update remote repo
  • Loading branch information
wojciech-bialy-wpm authored Jul 12, 2023
2 parents 99801d1 + f606397 commit 7bb7efa
Show file tree
Hide file tree
Showing 50 changed files with 1,913 additions and 1,820 deletions.
100 changes: 0 additions & 100 deletions integrationExamples/gpt/inskin_example.html

This file was deleted.

4 changes: 2 additions & 2 deletions modules/adagioBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -1133,7 +1133,6 @@ export const spec = {
method: 'POST',
url: ENDPOINT,
data: {
id: generateUUID(),
organizationId: organizationId,
secure: secure,
device: device,
Expand All @@ -1152,7 +1151,8 @@ export const spec = {
},
prebidVersion: '$prebid.version$',
featuresVersion: FEATURES_VERSION,
usIfr: usIfr
usIfr: usIfr,
adgjs: storage.localStorageIsEnabled()
},
options: {
contentType: 'text/plain'
Expand Down
4 changes: 4 additions & 0 deletions modules/admanBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export const spec = {
buildRequests: (validBidRequests = [], bidderRequest) => {
// convert Native ORTB definition to old-style prebid native definition
validBidRequests = convertOrtbRequestToProprietaryNative(validBidRequests);
const content = deepAccess(bidderRequest, 'ortb2.site.content', config.getAnyConfig('ortb2.site.content'));

let winTop = window;
let location;
Expand Down Expand Up @@ -95,6 +96,9 @@ export const spec = {
if (bidderRequest.gdprConsent) {
request.gdpr = bidderRequest.gdprConsent
}
if (content) {
request.content = content;
}
}
const len = validBidRequests.length;

Expand Down
8 changes: 8 additions & 0 deletions modules/adtelligentBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,14 @@ function bidToTag(bidRequests, adapterRequest) {
tag.DMPId = window.adtDmp.getUID();
}

if (adapterRequest.gppConsent) {
tag.GPP = adapterRequest.gppConsent.gppString;
tag.GPPSid = adapterRequest.gppConsent.applicableSections?.toString();
} else if (adapterRequest.ortb2?.regs?.gpp) {
tag.GPP = adapterRequest.ortb2.regs.gpp;
tag.GPPSid = adapterRequest.ortb2.regs.gpp_sid;
}

// end publisher env
const bids = [];

Expand Down
38 changes: 36 additions & 2 deletions modules/brandmetricsRtdProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,26 @@
* @requires module:modules/realTimeData
*/
import {submodule} from '../src/hook.js';
import {deepAccess, deepSetValue, logError, mergeDeep} from '../src/utils.js';
import {deepAccess, deepSetValue, logError, mergeDeep, generateUUID} from '../src/utils.js';
import {loadExternalScript} from '../src/adloader.js';
import * as events from '../src/events.js';
import CONSTANTS from '../src/constants.json';

const MODULE_NAME = 'brandmetrics'
const MODULE_CODE = MODULE_NAME
const RECEIVED_EVENTS = []
const GVL_ID = 422
const TCF_PURPOSES = [1, 7]

let billableEventsInitialized = false

function init (config, userConsent) {
const hasConsent = checkConsent(userConsent)

if (hasConsent) {
const moduleConfig = getMergedConfig(config)
initializeBrandmetrics(moduleConfig.params.scriptId)
initializeBillableEvents()
}
return hasConsent
}
Expand Down Expand Up @@ -82,7 +87,6 @@ function processBrandmetricsEvents (reqBidsConfigObj, moduleConfig, callback) {
if (RECEIVED_EVENTS.length > 0) {
callBidTargeting(RECEIVED_EVENTS[RECEIVED_EVENTS.length - 1])
} else {
window._brandmetrics = window._brandmetrics || []
window._brandmetrics.push({
cmd: '_addeventlistener',
val: {
Expand Down Expand Up @@ -120,6 +124,8 @@ function setBidderTargeting (reqBidsConfigObj, moduleConfig, key, val) {
* @param {string} scriptId - The script- id provided by brandmetrics or brandmetrics partner
*/
function initializeBrandmetrics(scriptId) {
window._brandmetrics = window._brandmetrics || []

if (scriptId) {
const path = 'https://cdn.brandmetrics.com/survey/script/'
const file = scriptId + '.js'
Expand All @@ -129,6 +135,34 @@ function initializeBrandmetrics(scriptId) {
}
}

/**
* Hook in to brandmetrics creative_in_view- event and emit billable- event for creatives measured by brandmetrics.
*/
function initializeBillableEvents() {
if (!billableEventsInitialized) {
window._brandmetrics.push({
cmd: '_addeventlistener',
val: {
event: 'creative_in_view',
handler: (ev) => {
if (ev.source && ev.source.type === 'pbj') {
const bid = ev.source.data;
events.emit(CONSTANTS.EVENTS.BILLABLE_EVENT, {
vendor: 'brandmetrics',
type: 'creative_in_view',
measurementId: ev.mid,
billingId: generateUUID(),
auctionId: bid.auctionId,
transactionId: bid.transactionId,
});
}
},
}
})
billableEventsInitialized = true
}
}

/**
* Merges a provided config with default values
* @param {Object} customConfig
Expand Down
19 changes: 17 additions & 2 deletions modules/brandmetricsRtdProvider.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ Enable the Brandmetrics RTD in your Prebid configuration, using the below format
pbjs.setConfig({
...,
realTimeData: {
auctionDelay: 500, // auction delay
auctionDelay: 500,
dataProviders: [{
name: 'brandmetrics',
waitForIt: true // should be true if there's an `auctionDelay`,
waitForIt: true,
params: {
scriptId: '00000000-0000-0000-0000-000000000000',
bidders: ['ozone']
Expand All @@ -29,6 +29,7 @@ pbjs.setConfig({
...
})
```
The scriptId- parameter is provided by brandmetrics or a brandmetrics partner.

## Parameters
| Name | Type | Description | Default |
Expand All @@ -38,3 +39,17 @@ pbjs.setConfig({
| params | Object | | - |
| params.bidders | String[] | An array of bidders which should receive targeting keys. | `[]` |
| params.scriptId | String | A script- id GUID if the brandmetrics- script should be initialized. | `undefined` |

## Billable events
The module emits a billable event for creatives that are measured by brandmetrics and are considered in- view.

```javascript
{
vendor: 'brandmetrics',
type: 'creative_in_view',
measurementId: string, // UUID, brandmetrics measurement id
billingId: string, // UUID, unique billing id
auctionId: string, // Prebid auction id
transactionId: string, //Prebid transaction id
}
```
4 changes: 2 additions & 2 deletions modules/cadentApertureMXBidAdapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
```
Module Name: Cadent Aperture MX Adapter
Module Type: Bidder Adapter
Maintainer: git@emxdigital.com
Maintainer: contactaperturemx@cadent.tv
```

# Description

The Cadent Aperture MX adapter provides publishers with access to the Cadent Aperture MX SSP. The adapter is GDPR compliant. Please note that the adapter supports Banner and Video (Instream & Outstream) media types.

Note: The Cadent Aperture MX adapter requires approval and implementation guidelines from the Cadent team, including existing publishers that work with Cadent. Please reach out to your account manager or prebid@emxdigital.com for more information.
Note: The Cadent Aperture MX adapter requires approval and implementation guidelines from the Cadent team, including existing publishers that work with Cadent. Please reach out to your account manager or contactaperturemx@cadent.tv for more information.

The bidder code should be ```cadent_aperture_mx```
The params used by the bidder are :
Expand Down
2 changes: 1 addition & 1 deletion modules/discoveryBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ function getItems(validBidRequests, bidderRequest) {
format: sizes,
},
ext: {},
tagid: globals['tagid'],
tagid: req.params && req.params.tagid
};
}
itemMaps[id] = {
Expand Down
Loading

0 comments on commit 7bb7efa

Please sign in to comment.