prebid.js 5.18.0 → 5.20.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browsers.json +1 -0
- package/integrationExamples/gpt/akamaidap_segments_example.html +132 -0
- package/modules/.submodules.json +1 -0
- package/modules/adfBidAdapter.js +21 -16
- package/modules/adtelligentBidAdapter.js +2 -1
- package/modules/adxcgBidAdapter.js +311 -359
- package/modules/airgridRtdProvider.js +1 -1
- package/modules/akamaiDapRtdProvider.js +474 -0
- package/modules/akamaiDapRtdProvider.md +47 -0
- package/modules/appnexusBidAdapter.js +9 -3
- package/modules/atsAnalyticsAdapter.js +67 -46
- package/modules/atsAnalyticsAdapter.md +1 -0
- package/modules/betweenBidAdapter.js +20 -3
- package/modules/browsiRtdProvider.js +106 -18
- package/modules/cleanioRtdProvider.js +192 -0
- package/modules/cleanioRtdProvider.md +59 -0
- package/modules/codefuelBidAdapter.js +183 -0
- package/modules/codefuelBidAdapter.md +111 -0
- package/modules/connectIdSystem.js +104 -0
- package/modules/connectIdSystem.md +33 -0
- package/modules/deepintentBidAdapter.js +106 -9
- package/modules/deepintentBidAdapter.md +36 -1
- package/modules/deltaprojectsBidAdapter.js +252 -0
- package/modules/deltaprojectsBidAdapter.md +32 -0
- package/modules/engageyaBidAdapter.js +157 -0
- package/modules/gridBidAdapter.js +1 -0
- package/modules/gumgumBidAdapter.js +8 -0
- package/modules/inskinBidAdapter.js +7 -3
- package/modules/ipromBidAdapter.js +79 -0
- package/modules/ixBidAdapter.js +8 -1
- package/modules/jixieBidAdapter.js +8 -2
- package/modules/justpremiumBidAdapter.js +6 -1
- package/modules/kinessoIdSystem.js +1 -1
- package/modules/limelightDigitalBidAdapter.js +22 -2
- package/modules/livewrappedAnalyticsAdapter.js +49 -1
- package/modules/multibid/index.js +3 -3
- package/modules/nativoBidAdapter.js +5 -1
- package/modules/nextMillenniumBidAdapter.js +12 -3
- package/modules/oguryBidAdapter.js +14 -1
- package/modules/openxBidAdapter.js +34 -22
- package/modules/operaadsBidAdapter.js +21 -1
- package/modules/otmBidAdapter.js +146 -0
- package/modules/otmBidAdapter.md +27 -26
- package/modules/outbrainBidAdapter.js +5 -0
- package/modules/playwireBidAdapter.md +61 -0
- package/modules/publinkIdSystem.js +11 -6
- package/modules/rtdModule/index.js +2 -2
- package/modules/sonobiBidAdapter.js +7 -0
- package/modules/sortableBidAdapter.js +1 -0
- package/modules/teadsBidAdapter.js +3 -0
- package/modules/tripleliftBidAdapter.js +22 -5
- package/modules/trustxBidAdapter.js +8 -6
- package/modules/undertoneBidAdapter.js +9 -5
- package/modules/undertoneBidAdapter.md +5 -1
- package/modules/userId/eids.js +18 -0
- package/modules/userId/eids.md +7 -0
- package/modules/userId/userId.md +12 -0
- package/modules/ventesBidAdapter.js +370 -0
- package/modules/ventesBidAdapter.md +94 -0
- package/modules/videobyteBidAdapter.js +13 -6
- package/modules/videobyteBidAdapter.md +49 -0
- package/modules/yahoosspBidAdapter.js +6 -6
- package/modules/yieldmoSyntheticInventoryModule.js +46 -0
- package/modules/yieldmoSyntheticInventoryModule.md +68 -0
- package/package.json +1 -1
- package/src/adapterManager.js +5 -0
- package/src/adapters/bidderFactory.js +4 -3
- package/src/auction.js +11 -11
- package/src/constants.json +1 -0
- package/src/secureCreatives.js +6 -7
- package/src/targeting.js +11 -9
- package/test/spec/modules/adfBidAdapter_spec.js +83 -29
- package/test/spec/modules/adtelligentBidAdapter_spec.js +1 -0
- package/test/spec/modules/adxcgBidAdapter_spec.js +827 -571
- package/test/spec/modules/akamaiDapRtdProvider_spec.js +246 -0
- package/test/spec/modules/appnexusBidAdapter_spec.js +16 -1
- package/test/spec/modules/atsAnalyticsAdapter_spec.js +42 -9
- package/test/spec/modules/betweenBidAdapter_spec.js +41 -0
- package/test/spec/modules/browsiRtdProvider_spec.js +62 -7
- package/test/spec/modules/cleanioRtdProvider_spec.js +188 -0
- package/test/spec/modules/codefuelBidAdapter_spec.js +316 -0
- package/test/spec/modules/connectIdSystem_spec.js +189 -0
- package/test/spec/modules/deepintentBidAdapter_spec.js +153 -3
- package/test/spec/modules/deltaprojectsBidAdapter_spec.js +399 -0
- package/test/spec/modules/engageyaBidAdapter_spec.js +286 -0
- package/test/spec/modules/eplanningBidAdapter_spec.js +8 -8
- package/test/spec/modules/gumgumBidAdapter_spec.js +5 -1
- package/test/spec/modules/ipromBidAdapter_spec.js +195 -0
- package/test/spec/modules/ixBidAdapter_spec.js +13 -3
- package/test/spec/modules/jixieBidAdapter_spec.js +13 -11
- package/test/spec/modules/justpremiumBidAdapter_spec.js +9 -2
- package/test/spec/modules/limelightDigitalBidAdapter_spec.js +155 -1
- package/test/spec/modules/livewrappedAnalyticsAdapter_spec.js +52 -7
- package/test/spec/modules/multibid_spec.js +31 -31
- package/test/spec/modules/nextMillenniumBidAdapter_spec.js +13 -1
- package/test/spec/modules/oguryBidAdapter_spec.js +53 -12
- package/test/spec/modules/openxBidAdapter_spec.js +85 -13
- package/test/spec/modules/operaadsBidAdapter_spec.js +38 -6
- package/test/spec/modules/otmBidAdapter_spec.js +67 -0
- package/test/spec/modules/outbrainBidAdapter_spec.js +18 -0
- package/test/spec/modules/publinkIdSystem_spec.js +6 -6
- package/test/spec/modules/sonobiBidAdapter_spec.js +34 -1
- package/test/spec/modules/sortableBidAdapter_spec.js +11 -0
- package/test/spec/modules/teadsBidAdapter_spec.js +132 -0
- package/test/spec/modules/tripleliftBidAdapter_spec.js +128 -0
- package/test/spec/modules/trustxBidAdapter_spec.js +3 -3
- package/test/spec/modules/undertoneBidAdapter_spec.js +52 -0
- package/test/spec/modules/ventesBidAdapter_spec.js +845 -0
- package/test/spec/modules/videobyteBidAdapter_spec.js +2 -2
- package/test/spec/modules/yieldmoSyntheticInventoryModule_spec.js +89 -0
- package/test/spec/unit/core/adapterManager_spec.js +37 -2
- package/test/spec/unit/core/bidderFactory_spec.js +61 -1
- package/test/spec/unit/pbjs_api_spec.js +37 -2
- package/test/spec/unit/secureCreatives_spec.js +54 -25
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
---
|
|
2
|
+
layout: bidder
|
|
3
|
+
title: ventes
|
|
4
|
+
description: Prebid ventes Bidder Adapter
|
|
5
|
+
pbjs: false
|
|
6
|
+
biddercode: ventes
|
|
7
|
+
gdpr_supported: false
|
|
8
|
+
usp_supported: false
|
|
9
|
+
media_types: banner
|
|
10
|
+
coppa_supported: false
|
|
11
|
+
schain_supported: false
|
|
12
|
+
dchain_supported: false
|
|
13
|
+
prebid_member: false
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
### BidParams
|
|
17
|
+
{: .table .table-bordered .table-striped }
|
|
18
|
+
| Name | Scope | Description | Example | Type |
|
|
19
|
+
|-----------------|----------|-----------------------------------------------------------|----------------------------------------------|---------------|
|
|
20
|
+
| `placementId` | required | Placement ID from Ventes Avenues | `'VA-062-0013-0183'` | `string` |
|
|
21
|
+
| `publisherId` | required | Publisher ID from Ventes Avenues | `'VA-062'` | `string` |
|
|
22
|
+
| `user` | optional | Object that specifies information about an external user. | `user: { age: 25, gender: 0, dnt: true}` | `object` |
|
|
23
|
+
| `app` | required | Object containing mobile app parameters. | `app : { id: 'app-id'}` | `object` |
|
|
24
|
+
| `device` | required | Object containing device info mandatory for mobile devices| `device : { ifa: 'device-id'}` | `object` |
|
|
25
|
+
|
|
26
|
+
#### User Object
|
|
27
|
+
|
|
28
|
+
{: .table .table-bordered .table-striped }
|
|
29
|
+
| Name | Description | Example | Type |
|
|
30
|
+
|-------------------|-------------------------------------------------------------------------------------------|-----------------------|-----------------------|
|
|
31
|
+
| `age` | The age of the user. | `35` | `integer` |
|
|
32
|
+
| `externalUid` | Specifies a string that corresponds to an external user ID for this user. | `'1234567890abcdefg'` | `string` |
|
|
33
|
+
| `segments` | Specifies the segments to which the user belongs. | `[1, 2]` | `Array<integer>` |
|
|
34
|
+
| `gender` | Specifies the gender of the user. Allowed values: Unknown: `0`; Male: `1`; Female: `2` | `1` | `integer` |
|
|
35
|
+
| `dnt` | Do not track flag. Indicates if tracking cookies should be disabled for this auction | `true` | `boolean` |
|
|
36
|
+
| `language` | Two-letter ANSI code for this user's language. | `EN` | `string` |
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
### Ad Unit Setup for Banner through mobile devices
|
|
40
|
+
```javascript
|
|
41
|
+
var adUnits = [
|
|
42
|
+
{
|
|
43
|
+
code: 'test-hb-ad-11111-1',
|
|
44
|
+
mediaTypes: {
|
|
45
|
+
banner: {
|
|
46
|
+
sizes: [
|
|
47
|
+
[300, 250]
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
bids: [{
|
|
52
|
+
bidder: 'ventes',
|
|
53
|
+
params: {
|
|
54
|
+
placementId: 'VA-062-0013-0183',
|
|
55
|
+
publisherId: '5cebea3c9eea646c7b623d5e',
|
|
56
|
+
IABCategories: "['IAB1', 'IAB5']",
|
|
57
|
+
device:{
|
|
58
|
+
ip: '123.145.167.189',
|
|
59
|
+
ifa:"AEBE52E7-03EE-455A-B3C4-E57283966239",
|
|
60
|
+
},
|
|
61
|
+
app: {
|
|
62
|
+
id: "agltb3B1Yi1pbmNyDAsSA0FwcBiJkfIUDA",
|
|
63
|
+
name: "Yahoo Weather",
|
|
64
|
+
bundle: 'com.kiloo.subwaysurf',
|
|
65
|
+
storeurl: 'https://play.google.com/store/apps/details?id=com.kiloo.subwaysurf&hl=en',
|
|
66
|
+
domain: 'somoaudience.com',
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}]
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Ad Unit Setup for Banner through Websites
|
|
75
|
+
```javascript
|
|
76
|
+
var adUnits = [
|
|
77
|
+
{
|
|
78
|
+
code: 'test-hb-ad-11111-1',
|
|
79
|
+
mediaTypes: {
|
|
80
|
+
banner: {
|
|
81
|
+
sizes: [
|
|
82
|
+
[300, 250]
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
bids: [{
|
|
87
|
+
bidder: 'ventes',
|
|
88
|
+
params: {
|
|
89
|
+
placementId: 'VA-002-0007-0799',
|
|
90
|
+
publisherId: '5cebea3c9eea646c7b623d5e',
|
|
91
|
+
}
|
|
92
|
+
}]
|
|
93
|
+
}
|
|
94
|
+
]
|
|
@@ -27,7 +27,7 @@ export const spec = {
|
|
|
27
27
|
code: BIDDER_CODE,
|
|
28
28
|
supportedMediaTypes: [VIDEO],
|
|
29
29
|
VERSION: '1.0.0',
|
|
30
|
-
ENDPOINT: 'https://x.videobyte.com/
|
|
30
|
+
ENDPOINT: 'https://x.videobyte.com/ortbhb',
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
33
|
* Determines whether or not the given bid request is valid.
|
|
@@ -53,13 +53,22 @@ export const spec = {
|
|
|
53
53
|
return bidRequests.map(bidRequest => {
|
|
54
54
|
const {params} = bidRequest;
|
|
55
55
|
let pubId = params.pubId;
|
|
56
|
+
const placementId = params.placementId;
|
|
57
|
+
const nId = params.nid;
|
|
56
58
|
if (bidRequest.params.video && bidRequest.params.video.e2etest) {
|
|
57
59
|
logMessage('E2E test mode enabled');
|
|
58
60
|
pubId = 'e2etest'
|
|
59
61
|
}
|
|
62
|
+
let baseEndpoint = spec.ENDPOINT + '?pid=' + pubId;
|
|
63
|
+
if (placementId) {
|
|
64
|
+
baseEndpoint += '&placementId=' + placementId
|
|
65
|
+
}
|
|
66
|
+
if (nId) {
|
|
67
|
+
baseEndpoint += '&nid=' + nId
|
|
68
|
+
}
|
|
60
69
|
return {
|
|
61
70
|
method: 'POST',
|
|
62
|
-
url:
|
|
71
|
+
url: baseEndpoint,
|
|
63
72
|
data: JSON.stringify(buildRequestData(bidRequest, bidderRequest)),
|
|
64
73
|
}
|
|
65
74
|
});
|
|
@@ -97,8 +106,6 @@ export const spec = {
|
|
|
97
106
|
};
|
|
98
107
|
bidResponses.push(bidResponse)
|
|
99
108
|
}
|
|
100
|
-
} else {
|
|
101
|
-
logError('invalid server response received');
|
|
102
109
|
}
|
|
103
110
|
return bidResponses;
|
|
104
111
|
},
|
|
@@ -228,7 +235,7 @@ function buildRequestData(bidRequest, bidderRequest) {
|
|
|
228
235
|
// content
|
|
229
236
|
if (videoParams.content && isPlainObject(videoParams.content)) {
|
|
230
237
|
openrtbRequest.site.content = {};
|
|
231
|
-
const contentStringKeys = ['id', 'title', 'series', 'season', 'genre', 'contentrating', 'language'];
|
|
238
|
+
const contentStringKeys = ['id', 'title', 'series', 'season', 'genre', 'contentrating', 'language', 'url'];
|
|
232
239
|
const contentNumberkeys = ['episode', 'prodq', 'context', 'livestream', 'len'];
|
|
233
240
|
const contentArrayKeys = ['cat'];
|
|
234
241
|
const contentObjectKeys = ['ext'];
|
|
@@ -271,7 +278,7 @@ function validateVideo(bidRequest) {
|
|
|
271
278
|
}
|
|
272
279
|
|
|
273
280
|
if (!bidRequest.params.pubId) {
|
|
274
|
-
logError('failed validation:
|
|
281
|
+
logError('failed validation: pubId not declared');
|
|
275
282
|
return false;
|
|
276
283
|
}
|
|
277
284
|
|
|
@@ -49,6 +49,55 @@ Module that connects to VideoByte's demand sources
|
|
|
49
49
|
]
|
|
50
50
|
```
|
|
51
51
|
|
|
52
|
+
## Instream Video adUnit with placement, nid and content params
|
|
53
|
+
```
|
|
54
|
+
var adUnits = [
|
|
55
|
+
{
|
|
56
|
+
code: 'video1',
|
|
57
|
+
mediaTypes: {
|
|
58
|
+
video: {
|
|
59
|
+
context: 'instream',
|
|
60
|
+
playerSize: [640, 480],
|
|
61
|
+
mimes: ['video/mp4', 'application/javascript'],
|
|
62
|
+
protocols: [2,5],
|
|
63
|
+
api: [2],
|
|
64
|
+
position: 1,
|
|
65
|
+
delivery: [2],
|
|
66
|
+
minduration: 10,
|
|
67
|
+
maxduration: 30,
|
|
68
|
+
placement: 1,
|
|
69
|
+
playbackmethod: [1,5],
|
|
70
|
+
protocols: [2,5],
|
|
71
|
+
api: [2],
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
bids: [
|
|
75
|
+
{
|
|
76
|
+
bidder: 'videobyte',
|
|
77
|
+
params: {
|
|
78
|
+
bidfloor: 0.5,
|
|
79
|
+
pubId: 'e2etest',
|
|
80
|
+
placementId: '1234567',
|
|
81
|
+
nid: '1234',
|
|
82
|
+
video: {
|
|
83
|
+
content:{
|
|
84
|
+
id: "uuid",
|
|
85
|
+
url: "https://videobyte.com/awesome-video.mp4",
|
|
86
|
+
title: "Awesome video",
|
|
87
|
+
genre: "Comedy",
|
|
88
|
+
language: "en",
|
|
89
|
+
season: "1",
|
|
90
|
+
series: "1",
|
|
91
|
+
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
]
|
|
99
|
+
```
|
|
100
|
+
|
|
52
101
|
# End To End testing mode
|
|
53
102
|
By passing bid.params.video.e2etest = true you will be able to receive a test creative
|
|
54
103
|
|
|
@@ -144,9 +144,9 @@ function getAdapterMode() {
|
|
|
144
144
|
|
|
145
145
|
function getResponseFormat(bid) {
|
|
146
146
|
const adm = bid.adm;
|
|
147
|
-
if (adm.
|
|
147
|
+
if (adm.indexOf('o2playerSettings') !== -1 || adm.indexOf('YAHOO.VideoPlatform.VideoPlayer') !== -1 || adm.indexOf('AdPlacement') !== -1) {
|
|
148
148
|
return BANNER;
|
|
149
|
-
} else if (adm.
|
|
149
|
+
} else if (adm.indexOf('VAST') !== -1) {
|
|
150
150
|
return VIDEO;
|
|
151
151
|
}
|
|
152
152
|
};
|
|
@@ -188,23 +188,23 @@ function validateAppendObject(validationType, allowedKeys, inputObject, appendTo
|
|
|
188
188
|
for (const objectKey in inputObject) {
|
|
189
189
|
switch (validationType) {
|
|
190
190
|
case 'string':
|
|
191
|
-
if (allowedKeys.
|
|
191
|
+
if (allowedKeys.indexOf(objectKey) !== -1 && isStr(inputObject[objectKey])) {
|
|
192
192
|
outputObject[objectKey] = inputObject[objectKey];
|
|
193
193
|
};
|
|
194
194
|
break;
|
|
195
195
|
case 'number':
|
|
196
|
-
if (allowedKeys.
|
|
196
|
+
if (allowedKeys.indexOf(objectKey) !== -1 && isNumber(inputObject[objectKey])) {
|
|
197
197
|
outputObject[objectKey] = inputObject[objectKey];
|
|
198
198
|
};
|
|
199
199
|
break;
|
|
200
200
|
|
|
201
201
|
case 'array':
|
|
202
|
-
if (allowedKeys.
|
|
202
|
+
if (allowedKeys.indexOf(objectKey) !== -1 && isArray(inputObject[objectKey])) {
|
|
203
203
|
outputObject[objectKey] = inputObject[objectKey];
|
|
204
204
|
};
|
|
205
205
|
break;
|
|
206
206
|
case 'object':
|
|
207
|
-
if (allowedKeys.
|
|
207
|
+
if (allowedKeys.indexOf(objectKey) !== -1 && isPlainObject(inputObject[objectKey])) {
|
|
208
208
|
outputObject[objectKey] = inputObject[objectKey];
|
|
209
209
|
};
|
|
210
210
|
break;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { config } from '../src/config.js';
|
|
2
|
+
import { isGptPubadsDefined } from '../src/utils.js';
|
|
3
|
+
|
|
4
|
+
export const MODULE_NAME = 'Yieldmo Synthetic Inventory Module';
|
|
5
|
+
|
|
6
|
+
export function init(config) {
|
|
7
|
+
validateConfig(config);
|
|
8
|
+
|
|
9
|
+
if (!isGptPubadsDefined()) {
|
|
10
|
+
window.googletag = window.googletag || {};
|
|
11
|
+
window.googletag.cmd = window.googletag.cmd || [];
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const googletag = window.googletag;
|
|
15
|
+
const containerName = 'ym_sim_container_' + config.placementId;
|
|
16
|
+
|
|
17
|
+
googletag.cmd.push(() => {
|
|
18
|
+
if (window.document.body) {
|
|
19
|
+
googletagCmd(config, containerName, googletag);
|
|
20
|
+
} else {
|
|
21
|
+
window.document.addEventListener('DOMContentLoaded', () => googletagCmd(config, containerName, googletag));
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function validateConfig(config) {
|
|
27
|
+
if (!('placementId' in config)) {
|
|
28
|
+
throw new Error(`${MODULE_NAME}: placementId required`);
|
|
29
|
+
}
|
|
30
|
+
if (!('adUnitPath' in config)) {
|
|
31
|
+
throw new Error(`${MODULE_NAME}: adUnitPath required`);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function googletagCmd(config, containerName, googletag) {
|
|
36
|
+
const gamContainer = window.document.createElement('div');
|
|
37
|
+
gamContainer.id = containerName;
|
|
38
|
+
window.document.body.appendChild(gamContainer);
|
|
39
|
+
googletag.defineSlot(config.adUnitPath, [1, 1], containerName)
|
|
40
|
+
.addService(googletag.pubads())
|
|
41
|
+
.setTargeting('ym_sim_p_id', config.placementId);
|
|
42
|
+
googletag.enableServices();
|
|
43
|
+
googletag.display(containerName);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
config.getConfig('yieldmo_synthetic_inventory', config => init(config.yieldmo_synthetic_inventory));
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Yieldmo Synthetic Inventory Module
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
This module enables publishers to set up Yieldmo Synthetic Outstream ads on their pages.
|
|
6
|
+
|
|
7
|
+
If publishers will enable this module and provide placementId and Google Ad Manager ad unit path, this module will create a placement on the page and inject Yieldmo SDK into this placement. Publisher will then need to get a placement id from their Yieldmo account manager (accounts email) and setup corresponding ad units on the GAM ad server.
|
|
8
|
+
|
|
9
|
+
## Integration
|
|
10
|
+
|
|
11
|
+
Build the Yieldmo Synthetic Inventory Module into the Prebid.js package with:
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
gulp build --modules=yieldmoSyntheticInventoryModule,...
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Module Configuration
|
|
18
|
+
|
|
19
|
+
```js
|
|
20
|
+
pbjs.que.push(function() {
|
|
21
|
+
pbjs.setConfig({
|
|
22
|
+
yieldmo_synthetic_inventory: {
|
|
23
|
+
placementId: '1234567890',
|
|
24
|
+
adUnitPath: '/1234567/ad_unit_name_used_in_gam'
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Configuration Parameters
|
|
31
|
+
|
|
32
|
+
|Name |Scope |Description | Example| Type
|
|
33
|
+
| :------------ | :------------ | :------------ | :------------ | :------------ |
|
|
34
|
+
|placementId | required | Yieldmo placement ID | '1234567890' | string
|
|
35
|
+
|adUnitPath | required | Google Ad Manager ad unit path | '/6355419/ad_unit_name_used_in_gam' | string
|
|
36
|
+
|
|
37
|
+
### How to get ad unit path
|
|
38
|
+
|
|
39
|
+
Ad unit path follows the format /network-code/[parent-ad-unit-code/.../]ad-unit-code, where:
|
|
40
|
+
|
|
41
|
+
- network-code is a unique identifier for the Ad Manager network the ad unit belongs to
|
|
42
|
+
- parent-ad-unit-code are the codes of all parent ad units (only applies to non-top level ad units)
|
|
43
|
+
- ad-unit-code is the code for the ad unit to be displayed
|
|
44
|
+
|
|
45
|
+
Note that all ad unit codes included in the ad unit path must adhere to the [formatting rules](https://support.google.com/admanager/answer/1628457#ad-unit-codes) specified by Ad Manager.
|
|
46
|
+
|
|
47
|
+
Another and probably the easiest way to get an ad unit path is to get it from the google ad manager ad unit document header generated tag:
|
|
48
|
+
|
|
49
|
+
```js
|
|
50
|
+
googletag.defineSlot('/1234567/ad_unit_name_used_in_gam', [1, 1], 'ad-container-id').addService(googletag.pubads());
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### How to get Yieldmo placement id
|
|
54
|
+
|
|
55
|
+
Please reach out to your Yieldmo account's person or email to support@yieldmo.com
|
|
56
|
+
|
|
57
|
+
### Google Ad Manager setup
|
|
58
|
+
|
|
59
|
+
Yieldmo Synthetic Inventory Module is designed to be used along with Google Ad Manager. GAM should be set as usual, but there are a few requirements:
|
|
60
|
+
|
|
61
|
+
- Ad unit size should be 1x1
|
|
62
|
+
- Creative should NOT be served into a SafeFrame and also should have 1x1 size
|
|
63
|
+
- Synthetic Inventory Universal Tag should be used as 3rd party creative code
|
|
64
|
+
### Synthetic Inventory Universal Tag
|
|
65
|
+
|
|
66
|
+
```js
|
|
67
|
+
<div id="ym_%%PATTERN:ym_sim_p_id%%" class="ym"></div><script type="text/javascript">(function(e,t){if(t._ym===void 0){t._ym="";var m=e.createElement("script");m.type="text/javascript",m.async=!0,m.src="//static.yieldmo.com/ym."+Math.round(5*Math.random()/3)+".js",(e.getElementsByTagName("head")[0]||e.getElementsByTagName("body")[0]).appendChild(m)}else t._ym instanceof String||void 0===t._ym.chkPls||t._ym.chkPls()})(document,window);</script>
|
|
68
|
+
```
|
package/package.json
CHANGED
package/src/adapterManager.js
CHANGED
|
@@ -621,4 +621,9 @@ adapterManager.callBidViewableBidder = function(bidder, bid) {
|
|
|
621
621
|
tryCallBidderMethod(bidder, 'onBidViewable', bid);
|
|
622
622
|
};
|
|
623
623
|
|
|
624
|
+
adapterManager.callBidderError = function(bidder, error, bidderRequest) {
|
|
625
|
+
const param = { error, bidderRequest };
|
|
626
|
+
tryCallBidderMethod(bidder, 'onBidderError', param);
|
|
627
|
+
};
|
|
628
|
+
|
|
624
629
|
export default adapterManager;
|
|
@@ -335,10 +335,11 @@ export function newBidder(spec) {
|
|
|
335
335
|
|
|
336
336
|
// If the server responds with an error, there's not much we can do. Log it, and make sure to
|
|
337
337
|
// call onResponse() so that we're one step closer to calling done().
|
|
338
|
-
function onFailure(
|
|
338
|
+
function onFailure(errorMessage, error) {
|
|
339
339
|
onTimelyResponse(spec.code);
|
|
340
|
-
|
|
341
|
-
|
|
340
|
+
adapterManager.callBidderError(spec.code, error, bidderRequest)
|
|
341
|
+
events.emit(CONSTANTS.EVENTS.BIDDER_ERROR, { error, bidderRequest });
|
|
342
|
+
logError(`Server call for ${spec.code} failed: ${errorMessage} ${error.status}. Continuing without bids.`);
|
|
342
343
|
onResponse();
|
|
343
344
|
}
|
|
344
345
|
}
|
package/src/auction.js
CHANGED
|
@@ -613,7 +613,8 @@ export const getPriceGranularity = (mediaType, bidReq) => {
|
|
|
613
613
|
* @returns {function}
|
|
614
614
|
*/
|
|
615
615
|
export const getPriceByGranularity = (granularity) => {
|
|
616
|
-
return (bid) => {
|
|
616
|
+
return (bid, bidReq) => {
|
|
617
|
+
granularity = granularity || getPriceGranularity(bid.mediaType, bidReq);
|
|
617
618
|
if (granularity === CONSTANTS.GRANULARITY_OPTIONS.AUTO) {
|
|
618
619
|
return bid.pbAg;
|
|
619
620
|
} else if (granularity === CONSTANTS.GRANULARITY_OPTIONS.DENSE) {
|
|
@@ -646,14 +647,14 @@ export const getAdvertiserDomain = () => {
|
|
|
646
647
|
* @param {BidRequest} bidReq
|
|
647
648
|
* @returns {*}
|
|
648
649
|
*/
|
|
649
|
-
export function getStandardBidderSettings(mediaType, bidderCode
|
|
650
|
+
export function getStandardBidderSettings(mediaType, bidderCode) {
|
|
650
651
|
// factory for key value objs
|
|
651
652
|
function createKeyVal(key, value) {
|
|
652
653
|
return {
|
|
653
654
|
key,
|
|
654
655
|
val: (typeof value === 'function')
|
|
655
|
-
? function (bidResponse) {
|
|
656
|
-
return value(bidResponse);
|
|
656
|
+
? function (bidResponse, bidReq) {
|
|
657
|
+
return value(bidResponse, bidReq);
|
|
657
658
|
}
|
|
658
659
|
: function (bidResponse) {
|
|
659
660
|
return getValue(bidResponse, value);
|
|
@@ -661,7 +662,6 @@ export function getStandardBidderSettings(mediaType, bidderCode, bidReq) {
|
|
|
661
662
|
};
|
|
662
663
|
}
|
|
663
664
|
const TARGETING_KEYS = CONSTANTS.TARGETING_KEYS;
|
|
664
|
-
const granularity = getPriceGranularity(mediaType, bidReq);
|
|
665
665
|
|
|
666
666
|
let bidderSettings = $$PREBID_GLOBAL$$.bidderSettings;
|
|
667
667
|
if (!bidderSettings[CONSTANTS.JSON_MAPPING.BD_SETTING_STANDARD]) {
|
|
@@ -671,7 +671,7 @@ export function getStandardBidderSettings(mediaType, bidderCode, bidReq) {
|
|
|
671
671
|
bidderSettings[CONSTANTS.JSON_MAPPING.BD_SETTING_STANDARD][CONSTANTS.JSON_MAPPING.ADSERVER_TARGETING] = [
|
|
672
672
|
createKeyVal(TARGETING_KEYS.BIDDER, 'bidderCode'),
|
|
673
673
|
createKeyVal(TARGETING_KEYS.AD_ID, 'adId'),
|
|
674
|
-
createKeyVal(TARGETING_KEYS.PRICE_BUCKET, getPriceByGranularity(
|
|
674
|
+
createKeyVal(TARGETING_KEYS.PRICE_BUCKET, getPriceByGranularity()),
|
|
675
675
|
createKeyVal(TARGETING_KEYS.SIZE, 'size'),
|
|
676
676
|
createKeyVal(TARGETING_KEYS.DEAL, 'dealId'),
|
|
677
677
|
createKeyVal(TARGETING_KEYS.SOURCE, 'source'),
|
|
@@ -716,12 +716,12 @@ export function getKeyValueTargetingPairs(bidderCode, custBidObj, bidReq) {
|
|
|
716
716
|
// 1) set the keys from "standard" setting or from prebid defaults
|
|
717
717
|
if (bidderSettings) {
|
|
718
718
|
// initialize default if not set
|
|
719
|
-
const standardSettings = getStandardBidderSettings(custBidObj.mediaType, bidderCode
|
|
720
|
-
setKeys(keyValues, standardSettings, custBidObj);
|
|
719
|
+
const standardSettings = getStandardBidderSettings(custBidObj.mediaType, bidderCode);
|
|
720
|
+
setKeys(keyValues, standardSettings, custBidObj, bidReq);
|
|
721
721
|
|
|
722
722
|
// 2) set keys from specific bidder setting override if they exist
|
|
723
723
|
if (bidderCode && bidderSettings[bidderCode] && bidderSettings[bidderCode][CONSTANTS.JSON_MAPPING.ADSERVER_TARGETING]) {
|
|
724
|
-
setKeys(keyValues, bidderSettings[bidderCode], custBidObj);
|
|
724
|
+
setKeys(keyValues, bidderSettings[bidderCode], custBidObj, bidReq);
|
|
725
725
|
custBidObj.sendStandardTargeting = bidderSettings[bidderCode].sendStandardTargeting;
|
|
726
726
|
}
|
|
727
727
|
}
|
|
@@ -734,7 +734,7 @@ export function getKeyValueTargetingPairs(bidderCode, custBidObj, bidReq) {
|
|
|
734
734
|
return keyValues;
|
|
735
735
|
}
|
|
736
736
|
|
|
737
|
-
function setKeys(keyValues, bidderSettings, custBidObj) {
|
|
737
|
+
function setKeys(keyValues, bidderSettings, custBidObj, bidReq) {
|
|
738
738
|
var targeting = bidderSettings[CONSTANTS.JSON_MAPPING.ADSERVER_TARGETING];
|
|
739
739
|
custBidObj.size = custBidObj.getSize();
|
|
740
740
|
|
|
@@ -748,7 +748,7 @@ function setKeys(keyValues, bidderSettings, custBidObj) {
|
|
|
748
748
|
|
|
749
749
|
if (isFn(value)) {
|
|
750
750
|
try {
|
|
751
|
-
value = value(custBidObj);
|
|
751
|
+
value = value(custBidObj, bidReq);
|
|
752
752
|
} catch (e) {
|
|
753
753
|
logError('bidmanager', 'ERROR', e);
|
|
754
754
|
}
|
package/src/constants.json
CHANGED
package/src/secureCreatives.js
CHANGED
|
@@ -60,7 +60,6 @@ export function receiveMessage(ev) {
|
|
|
60
60
|
if (data.action === 'assetRequest') {
|
|
61
61
|
const message = getAssetMessage(data, adObject);
|
|
62
62
|
ev.source.postMessage(JSON.stringify(message), ev.origin);
|
|
63
|
-
return;
|
|
64
63
|
} else if (data.action === 'allAssetRequest') {
|
|
65
64
|
const message = getAllAssetsMessage(data, adObject);
|
|
66
65
|
ev.source.postMessage(JSON.stringify(message), ev.origin);
|
|
@@ -68,13 +67,13 @@ export function receiveMessage(ev) {
|
|
|
68
67
|
adObject.height = data.height;
|
|
69
68
|
adObject.width = data.width;
|
|
70
69
|
resizeRemoteCreative(adObject);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
if (trackerType === 'click') { return; }
|
|
70
|
+
} else {
|
|
71
|
+
const trackerType = fireNativeTrackers(data, adObject);
|
|
72
|
+
if (trackerType === 'click') { return; }
|
|
75
73
|
|
|
76
|
-
|
|
77
|
-
|
|
74
|
+
auctionManager.addWinningBid(adObject);
|
|
75
|
+
events.emit(BID_WON, adObject);
|
|
76
|
+
}
|
|
78
77
|
}
|
|
79
78
|
}
|
|
80
79
|
}
|
package/src/targeting.js
CHANGED
|
@@ -123,17 +123,19 @@ export function newTargeting(auctionManager) {
|
|
|
123
123
|
if (isGptPubadsDefined()) {
|
|
124
124
|
const adUnitCodes = getAdUnitCodes(adUnitCode);
|
|
125
125
|
const adUnits = auctionManager.getAdUnits().filter(adUnit => includes(adUnitCodes, adUnit.code));
|
|
126
|
+
let unsetKeys = pbTargetingKeys.reduce((reducer, key) => {
|
|
127
|
+
reducer[key] = null;
|
|
128
|
+
return reducer;
|
|
129
|
+
}, {});
|
|
126
130
|
window.googletag.pubads().getSlots().forEach(slot => {
|
|
127
131
|
let customSlotMatchingFunc = isFn(customSlotMatching) && customSlotMatching(slot);
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
}
|
|
136
|
-
});
|
|
132
|
+
// reset only registered adunits
|
|
133
|
+
adUnits.forEach(unit => {
|
|
134
|
+
if (unit.code === slot.getAdUnitPath() ||
|
|
135
|
+
unit.code === slot.getSlotElementId() ||
|
|
136
|
+
(isFn(customSlotMatchingFunc) && customSlotMatchingFunc(unit.code))) {
|
|
137
|
+
slot.updateTargetingFromMap(unsetKeys);
|
|
138
|
+
}
|
|
137
139
|
});
|
|
138
140
|
});
|
|
139
141
|
}
|