prebid.js 7.51.0 → 7.53.0
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/dist/1plusXRtdProvider.js +1 -1
- package/dist/33acrossBidAdapter.js +1 -1
- package/dist/33acrossIdSystem.js +1 -1
- package/dist/adagioBidAdapter.js +1 -1
- package/dist/adbookpspBidAdapter.js +1 -1
- package/dist/adgenerationBidAdapter.js +1 -1
- package/dist/adkernelBidAdapter.js +1 -1
- package/dist/adqueryBidAdapter.js +1 -1
- package/dist/adrelevantisBidAdapter.js +1 -1
- package/dist/adriverIdSystem.js +1 -1
- package/dist/adtrgtmeBidAdapter.js +1 -1
- package/dist/adxcgBidAdapter.js +1 -1
- package/dist/adyoulikeBidAdapter.js +1 -1
- package/dist/airgridRtdProvider.js +1 -1
- package/dist/ajaBidAdapter.js +1 -1
- package/dist/allowActivities.js +1 -0
- package/dist/amxBidAdapter.js +1 -1
- package/dist/amxIdSystem.js +1 -1
- package/dist/appierAnalyticsAdapter.js +1 -1
- package/dist/appnexusBidAdapter.js +1 -1
- package/dist/asoBidAdapter.js +1 -1
- package/dist/axonixBidAdapter.js +1 -1
- package/dist/beopBidAdapter.js +1 -1
- package/dist/bidglassBidAdapter.js +1 -1
- package/dist/big-richmediaBidAdapter.js +1 -1
- package/dist/bridgewellBidAdapter.js +1 -1
- package/dist/brightMountainMediaBidAdapter.js +1 -1
- package/dist/carodaBidAdapter.js +1 -1
- package/dist/chtnwBidAdapter.js +1 -1
- package/dist/conceptxBidAdapter.js +1 -0
- package/dist/concertBidAdapter.js +1 -1
- package/dist/connectIdSystem.js +1 -1
- package/dist/connectadBidAdapter.js +1 -1
- package/dist/consumableBidAdapter.js +1 -1
- package/dist/conversantAnalyticsAdapter.js +1 -1
- package/dist/conversantBidAdapter.js +1 -1
- package/dist/craftBidAdapter.js +1 -1
- package/dist/criteoBidAdapter.js +1 -1
- package/dist/cwireBidAdapter.js +1 -1
- package/dist/dependencies.json +6 -0
- package/dist/dspxBidAdapter.js +1 -1
- package/dist/eplanningBidAdapter.js +1 -1
- package/dist/eskimiBidAdapter.js +1 -1
- package/dist/euidIdSystem.js +1 -0
- package/dist/feedadBidAdapter.js +1 -1
- package/dist/finativeBidAdapter.js +1 -1
- package/dist/freepassIdSystem.js +1 -0
- package/dist/freewheel-sspBidAdapter.js +1 -1
- package/dist/gdprEnforcement.js +1 -1
- package/dist/glimpseBidAdapter.js +1 -1
- package/dist/gmosspBidAdapter.js +1 -1
- package/dist/goldbachBidAdapter.js +1 -1
- package/dist/greenbidsAnalyticsAdapter.js +1 -1
- package/dist/greenbidsRtdProvider.js +1 -1
- package/dist/gridBidAdapter.js +1 -1
- package/dist/growthCodeRtdProvider.js +1 -0
- package/dist/gumgumBidAdapter.js +1 -1
- package/dist/h12mediaBidAdapter.js +1 -1
- package/dist/id5IdSystem.js +1 -1
- package/dist/improvedigitalBidAdapter.js +1 -1
- package/dist/inmarBidAdapter.js +1 -1
- package/dist/insticatorBidAdapter.js +1 -1
- package/dist/ixBidAdapter.js +1 -1
- package/dist/justpremiumBidAdapter.js +1 -1
- package/dist/kargoBidAdapter.js +1 -1
- package/dist/konduitAnalyticsAdapter.js +1 -1
- package/dist/kueezBidAdapter.js +1 -1
- package/dist/kueezRtbBidAdapter.js +1 -1
- package/dist/kulturemediaBidAdapter.js +1 -1
- package/dist/lassoBidAdapter.js +1 -1
- package/dist/lifestreetBidAdapter.js +1 -1
- package/dist/limelightDigitalBidAdapter.js +1 -1
- package/dist/liveyieldAnalyticsAdapter.js +1 -1
- package/dist/logicadBidAdapter.js +1 -1
- package/dist/loglyliftBidAdapter.js +1 -1
- package/dist/magniteAnalyticsAdapter.js +1 -1
- package/dist/malltvAnalyticsAdapter.js +1 -1
- package/dist/marsmediaBidAdapter.js +1 -1
- package/dist/mediafuseBidAdapter.js +1 -1
- package/dist/mediasquareBidAdapter.js +1 -1
- package/dist/mgidBidAdapter.js +1 -1
- package/dist/minutemediaBidAdapter.js +1 -1
- package/dist/minutemediaplusBidAdapter.js +1 -1
- package/dist/nexx360BidAdapter.js +1 -1
- package/dist/not-for-prod/prebid.js +154 -146
- package/dist/objectGuard.js +1 -0
- package/dist/oguryBidAdapter.js +1 -1
- package/dist/onetagBidAdapter.js +1 -1
- package/dist/ooloAnalyticsAdapter.js +1 -1
- package/dist/optidigitalBidAdapter.js +1 -1
- package/dist/outbrainBidAdapter.js +1 -1
- package/dist/oxxionAnalyticsAdapter.js +1 -0
- package/dist/pairIdSystem.js +1 -1
- package/dist/parrableIdSystem.js +1 -1
- package/dist/pixfutureBidAdapter.js +1 -1
- package/dist/prebid-core.js +1 -1
- package/dist/proxistoreBidAdapter.js +1 -1
- package/dist/publinkIdSystem.js +1 -1
- package/dist/pubmaticBidAdapter.js +1 -1
- package/dist/pubwiseAnalyticsAdapter.js +1 -1
- package/dist/pxyzBidAdapter.js +1 -1
- package/dist/quantcastBidAdapter.js +1 -1
- package/dist/readpeakBidAdapter.js +1 -1
- package/dist/relaidoBidAdapter.js +1 -1
- package/dist/retailspotBidAdapter.js +1 -1
- package/dist/rhythmoneBidAdapter.js +1 -1
- package/dist/richaudienceBidAdapter.js +1 -1
- package/dist/riseBidAdapter.js +1 -1
- package/dist/rtdModule.js +1 -1
- package/dist/rubiconAnalyticsAdapter.js +1 -1
- package/dist/rubiconBidAdapter.js +1 -1
- package/dist/schain.js +1 -1
- package/dist/seedingAllianceBidAdapter.js +1 -1
- package/dist/seedtagBidAdapter.js +1 -1
- package/dist/sharethroughAnalyticsAdapter.js +1 -1
- package/dist/sharethroughBidAdapter.js +1 -1
- package/dist/shinezBidAdapter.js +1 -1
- package/dist/sirdataRtdProvider.js +1 -1
- package/dist/smaatoBidAdapter.js +1 -1
- package/dist/smartadserverBidAdapter.js +1 -1
- package/dist/smartxBidAdapter.js +1 -1
- package/dist/smilewantedBidAdapter.js +1 -1
- package/dist/sonobiBidAdapter.js +1 -1
- package/dist/sovrnAnalyticsAdapter.js +1 -1
- package/dist/sovrnBidAdapter.js +1 -1
- package/dist/sspBCBidAdapter.js +1 -1
- package/dist/stroeerCoreBidAdapter.js +1 -1
- package/dist/stvBidAdapter.js +1 -1
- package/dist/sublimeBidAdapter.js +1 -1
- package/dist/synacormediaBidAdapter.js +1 -1
- package/dist/targetVideoBidAdapter.js +1 -1
- package/dist/teadsBidAdapter.js +1 -1
- package/dist/trionBidAdapter.js +1 -1
- package/dist/tripleliftBidAdapter.js +1 -1
- package/dist/ttdBidAdapter.js +1 -1
- package/dist/ucfunnelAnalyticsAdapter.js +1 -1
- package/dist/uid2IdSystem.js +1 -1
- package/dist/uid2IdSystem_shared.js +1 -0
- package/dist/underdogmediaBidAdapter.js +1 -1
- package/dist/undertoneBidAdapter.js +1 -1
- package/dist/userId.js +1 -1
- package/dist/vidazooBidAdapter.js +1 -1
- package/dist/videobyteBidAdapter.js +1 -1
- package/dist/viouslyBidAdapter.js +1 -1
- package/dist/visxBidAdapter.js +1 -1
- package/dist/vuukleBidAdapter.js +1 -1
- package/dist/weboramaRtdProvider.js +1 -1
- package/dist/widespaceBidAdapter.js +1 -1
- package/dist/winrBidAdapter.js +1 -1
- package/dist/yahoosspBidAdapter.js +1 -1
- package/dist/yieldlabBidAdapter.js +1 -1
- package/dist/yieldmoBidAdapter.js +1 -1
- package/dist/yieldoneAnalyticsAdapter.js +1 -1
- package/dist/zeta_global_sspBidAdapter.js +1 -1
- package/integrationExamples/gpt/growthcode.html +20 -9
- package/integrationExamples/gpt/userId_example.html +20 -6
- package/libraries/objectGuard/objectGuard.js +108 -0
- package/libraries/objectGuard/ortbGuard.js +88 -0
- package/modules/.submodules.json +3 -1
- package/modules/1plusXRtdProvider.js +31 -60
- package/modules/adagioBidAdapter.js +86 -24
- package/modules/adgenerationBidAdapter.js +14 -5
- package/modules/adkernelBidAdapter.js +2 -2
- package/modules/adriverIdSystem.js +1 -1
- package/modules/airgridRtdProvider.js +11 -12
- package/modules/allowActivities.js +74 -0
- package/modules/asoBidAdapter.js +2 -1
- package/modules/beopBidAdapter.js +6 -0
- package/modules/conceptxBidAdapter.js +70 -0
- package/modules/conceptxBidAdapter.md +36 -0
- package/modules/connectIdSystem.js +89 -13
- package/modules/connectIdSystem.md +4 -7
- package/modules/criteoBidAdapter.js +18 -2
- package/modules/eskimiBidAdapter.js +171 -41
- package/modules/eskimiBidAdapter.md +35 -16
- package/modules/euidIdSystem.js +121 -0
- package/modules/euidIdSystem.md +131 -0
- package/modules/freepassIdSystem.js +61 -0
- package/modules/freepassIdSystem.md +47 -0
- package/modules/gdprEnforcement.js +98 -169
- package/modules/greenbidsAnalyticsAdapter.js +1 -1
- package/modules/growthCodeRtdProvider.js +131 -0
- package/modules/growthCodeRtdProvider.md +55 -0
- package/modules/id5IdSystem.js +3 -5
- package/modules/ixBidAdapter.js +17 -3
- package/modules/limelightDigitalBidAdapter.js +1 -1
- package/modules/logicadBidAdapter.js +14 -1
- package/modules/mediasquareBidAdapter.js +13 -5
- package/modules/nexx360BidAdapter.js +1 -0
- package/modules/oxxionAnalyticsAdapter.js +212 -0
- package/modules/oxxionAnalyticsAdapter.md +33 -0
- package/modules/pairIdSystem.js +16 -11
- package/modules/proxistoreBidAdapter.js +11 -14
- package/modules/richaudienceBidAdapter.js +10 -1
- package/modules/riseBidAdapter.js +1 -1
- package/modules/rtdModule/index.js +12 -1
- package/modules/schain.js +2 -2
- package/modules/sharethroughBidAdapter.js +2 -2
- package/modules/sirdataRtdProvider.js +73 -146
- package/modules/smartadserverBidAdapter.js +5 -0
- package/modules/sovrnBidAdapter.js +4 -1
- package/modules/stroeerCoreBidAdapter.js +55 -6
- package/modules/stvBidAdapter.js +34 -1
- package/modules/uid2IdSystem.js +27 -210
- package/modules/uid2IdSystem.md +104 -23
- package/modules/uid2IdSystem_shared.js +232 -0
- package/modules/undertoneBidAdapter.js +9 -1
- package/modules/userId/eids.js +8 -0
- package/modules/userId/index.js +69 -41
- package/modules/userId/userId.md +2 -1
- package/modules/viouslyBidAdapter.js +2 -2
- package/modules/weboramaRtdProvider.js +25 -95
- package/modules/weboramaRtdProvider.md +4 -4
- package/modules/yahoosspBidAdapter.js +45 -3
- package/modules/yahoosspBidAdapter.md +1 -1
- package/modules/yieldlabBidAdapter.js +23 -14
- package/modules/zeta_global_sspBidAdapter.js +28 -22
- package/package.json +1 -1
- package/src/activities/activities.js +47 -0
- package/src/activities/activityParams.js +8 -0
- package/src/activities/modules.js +1 -1
- package/src/activities/params.js +59 -0
- package/src/activities/redactor.js +157 -0
- package/src/activities/rules.js +95 -0
- package/src/adapterManager.js +45 -8
- package/src/adloader.js +1 -0
- package/src/fpd/rootDomain.js +1 -1
- package/src/prebid.js +1 -1
- package/src/storageManager.js +57 -44
- package/src/userSync.js +35 -18
- package/test/spec/activities/allowActivites_spec.js +138 -0
- package/test/spec/activities/objectGuard_spec.js +144 -0
- package/test/spec/activities/ortbGuard_spec.js +140 -0
- package/test/spec/activities/params_spec.js +25 -0
- package/test/spec/activities/redactor_spec.js +296 -0
- package/test/spec/activities/rules_spec.js +135 -0
- package/test/spec/modules/1plusXRtdProvider_spec.js +98 -149
- package/test/spec/modules/adagioBidAdapter_spec.js +46 -17
- package/test/spec/modules/adgenerationBidAdapter_spec.js +52 -12
- package/test/spec/modules/airgridRtdProvider_spec.js +2 -0
- package/test/spec/modules/beopBidAdapter_spec.js +24 -0
- package/test/spec/modules/conceptxBidAdapter_spec.js +136 -0
- package/test/spec/modules/connectIdSystem_spec.js +291 -23
- package/test/spec/modules/criteoBidAdapter_spec.js +85 -1
- package/test/spec/modules/eids_spec.js +15 -0
- package/test/spec/modules/eskimiBidAdapter_spec.js +264 -112
- package/test/spec/modules/euidIdSystem_spec.js +130 -0
- package/test/spec/modules/freepassIdSystem_spec.js +186 -0
- package/test/spec/modules/gdprEnforcement_spec.js +127 -414
- package/test/spec/modules/growthCodeRtdProvider_spec.js +127 -0
- package/test/spec/modules/id5IdSystem_spec.js +10 -3
- package/test/spec/modules/ixBidAdapter_spec.js +32 -1
- package/test/spec/modules/logicadBidAdapter_spec.js +122 -2
- package/test/spec/modules/mediasquareBidAdapter_spec.js +4 -0
- package/test/spec/modules/oxxionAnalyticsAdapter_spec.js +324 -0
- package/test/spec/modules/pairIdSystem_spec.js +16 -3
- package/test/spec/modules/realTimeDataModule_spec.js +1 -1
- package/test/spec/modules/richaudienceBidAdapter_spec.js +44 -0
- package/test/spec/modules/schain_spec.js +9 -0
- package/test/spec/modules/sharethroughBidAdapter_spec.js +1 -1
- package/test/spec/modules/sirdataRtdProvider_spec.js +110 -17
- package/test/spec/modules/smartadserverBidAdapter_spec.js +42 -0
- package/test/spec/modules/sovrnBidAdapter_spec.js +13 -0
- package/test/spec/modules/stroeerCoreBidAdapter_spec.js +151 -6
- package/test/spec/modules/stvBidAdapter_spec.js +13 -1
- package/test/spec/modules/uid2IdSystem_helpers.js +70 -0
- package/test/spec/modules/uid2IdSystem_spec.js +131 -86
- package/test/spec/modules/undertoneBidAdapter_spec.js +57 -1
- package/test/spec/modules/userId_spec.js +96 -33
- package/test/spec/modules/weboramaRtdProvider_spec.js +331 -205
- package/test/spec/modules/yahoosspBidAdapter_spec.js +103 -51
- package/test/spec/modules/yieldlabBidAdapter_spec.js +42 -2
- package/test/spec/modules/zeta_global_sspBidAdapter_spec.js +204 -4
- package/test/spec/unit/core/adapterManager_spec.js +181 -1
- package/test/spec/unit/core/storageManager_spec.js +76 -68
- package/test/spec/unit/pbjs_api_spec.js +15 -25
- package/test/spec/userSync_spec.js +45 -16
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
## FreePass User ID Submodule
|
|
2
|
+
|
|
3
|
+
[FreePass](https://freepass-login.com/introduction.html) is a common authentication service operated by Freebit Co., Ltd. Users with a FreePass account do not need to create a new account to use partner services.
|
|
4
|
+
|
|
5
|
+
# General Information
|
|
6
|
+
|
|
7
|
+
Please contact FreePass before using this ID.
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
Module Name: FreePass Id System
|
|
11
|
+
Module Type: User Id System
|
|
12
|
+
Maintainer: freepass-headerbidding@craid-inc.com
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Building Prebid with FreePass ID Support
|
|
16
|
+
|
|
17
|
+
First, make sure to add the FreePass ID submodule to your Prebid.js package with:
|
|
18
|
+
|
|
19
|
+
```shell
|
|
20
|
+
gulp build --modules=freepassIdSystem,userId
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
The following configuration parameters are available:
|
|
24
|
+
|
|
25
|
+
```javascript
|
|
26
|
+
pbjs.setConfig({
|
|
27
|
+
userSync: {
|
|
28
|
+
userIds: [{
|
|
29
|
+
name: 'freepassId',
|
|
30
|
+
params: {
|
|
31
|
+
freepassData: {
|
|
32
|
+
commonId: 'fpcommonid123',
|
|
33
|
+
userIp: '127.0.0.1'
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}]
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
| Param under userSync.userIds[] | Scope | Type | Description | Example |
|
|
42
|
+
|--------------------------------|----------|--------|------------------------------------------------------|----------------|
|
|
43
|
+
| name | Required | String | The name of this module | `"freepassId"` |
|
|
44
|
+
| freepassData | Optional | Object | FreePass data | `{}` |
|
|
45
|
+
| freepassData.commonId | Optional | String | Common ID obtained from FreePass | `"abcd1234"` |
|
|
46
|
+
| freepassData.userIp | Optional | String | User IP obtained in cooperation with partner service | `"127.0.0.1"` |
|
|
47
|
+
|
|
@@ -2,30 +2,42 @@
|
|
|
2
2
|
* This module gives publishers extra set of features to enforce individual purposes of TCF v2
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import {deepAccess,
|
|
5
|
+
import {deepAccess, logError, logWarn} from '../src/utils.js';
|
|
6
6
|
import {config} from '../src/config.js';
|
|
7
7
|
import adapterManager, {gdprDataHandler} from '../src/adapterManager.js';
|
|
8
|
-
import {find
|
|
9
|
-
import {registerSyncInner} from '../src/adapters/bidderFactory.js';
|
|
8
|
+
import {find} from '../src/polyfill.js';
|
|
10
9
|
import {getHook} from '../src/hook.js';
|
|
11
|
-
import {validateStorageEnforcement} from '../src/storageManager.js';
|
|
12
10
|
import * as events from '../src/events.js';
|
|
13
11
|
import CONSTANTS from '../src/constants.json';
|
|
14
12
|
import {GDPR_GVLIDS, VENDORLESS_GVLID} from '../src/consentHandler.js';
|
|
15
13
|
import {
|
|
16
14
|
MODULE_TYPE_ANALYTICS,
|
|
17
15
|
MODULE_TYPE_BIDDER,
|
|
18
|
-
|
|
16
|
+
MODULE_TYPE_PREBID,
|
|
17
|
+
MODULE_TYPE_RTD,
|
|
19
18
|
MODULE_TYPE_UID
|
|
20
19
|
} from '../src/activities/modules.js';
|
|
20
|
+
import {
|
|
21
|
+
ACTIVITY_PARAM_ANL_CONFIG,
|
|
22
|
+
ACTIVITY_PARAM_COMPONENT_NAME,
|
|
23
|
+
ACTIVITY_PARAM_COMPONENT_TYPE
|
|
24
|
+
} from '../src/activities/params.js';
|
|
25
|
+
import {registerActivityControl} from '../src/activities/rules.js';
|
|
26
|
+
import {
|
|
27
|
+
ACTIVITY_ACCESS_DEVICE,
|
|
28
|
+
ACTIVITY_ENRICH_EIDS,
|
|
29
|
+
ACTIVITY_FETCH_BIDS,
|
|
30
|
+
ACTIVITY_REPORT_ANALYTICS,
|
|
31
|
+
ACTIVITY_SYNC_USER
|
|
32
|
+
} from '../src/activities/activities.js';
|
|
21
33
|
|
|
22
34
|
export const STRICT_STORAGE_ENFORCEMENT = 'strictStorageEnforcement';
|
|
23
35
|
|
|
24
36
|
const TCF2 = {
|
|
25
|
-
'purpose1': {
|
|
26
|
-
'purpose2': {
|
|
27
|
-
'purpose7': {
|
|
28
|
-
}
|
|
37
|
+
'purpose1': {id: 1, name: 'storage'},
|
|
38
|
+
'purpose2': {id: 2, name: 'basicAds'},
|
|
39
|
+
'purpose7': {id: 7, name: 'measurement'}
|
|
40
|
+
};
|
|
29
41
|
|
|
30
42
|
/*
|
|
31
43
|
These rules would be used if `consentManagement.gdpr.rules` is undefined by the publisher.
|
|
@@ -48,9 +60,9 @@ export let purpose7Rule;
|
|
|
48
60
|
|
|
49
61
|
export let enforcementRules;
|
|
50
62
|
|
|
51
|
-
const storageBlocked =
|
|
52
|
-
const biddersBlocked =
|
|
53
|
-
const analyticsBlocked =
|
|
63
|
+
const storageBlocked = new Set();
|
|
64
|
+
const biddersBlocked = new Set();
|
|
65
|
+
const analyticsBlocked = new Set();
|
|
54
66
|
|
|
55
67
|
let hooksAdded = false;
|
|
56
68
|
let strictStorageEnforcement = false;
|
|
@@ -62,6 +74,9 @@ const GVLID_LOOKUP_PRIORITY = [
|
|
|
62
74
|
MODULE_TYPE_RTD
|
|
63
75
|
];
|
|
64
76
|
|
|
77
|
+
const RULE_NAME = 'TCF2';
|
|
78
|
+
const RULE_HANDLES = [];
|
|
79
|
+
|
|
65
80
|
/**
|
|
66
81
|
* Retrieve a module's GVL ID.
|
|
67
82
|
*/
|
|
@@ -73,7 +88,7 @@ export function getGvlid(moduleType, moduleName, fallbackFn) {
|
|
|
73
88
|
// Return GVL ID from user defined gvlMapping
|
|
74
89
|
if (gvlMapping && gvlMapping[moduleName]) {
|
|
75
90
|
return gvlMapping[moduleName];
|
|
76
|
-
} else if (moduleType ===
|
|
91
|
+
} else if (moduleType === MODULE_TYPE_PREBID) {
|
|
77
92
|
return VENDORLESS_GVLID;
|
|
78
93
|
} else {
|
|
79
94
|
let {gvlid, modules} = GDPR_GVLIDS.get(moduleName);
|
|
@@ -83,8 +98,8 @@ export function getGvlid(moduleType, moduleName, fallbackFn) {
|
|
|
83
98
|
for (const type of GVLID_LOOKUP_PRIORITY) {
|
|
84
99
|
if (modules.hasOwnProperty(type)) {
|
|
85
100
|
gvlid = modules[type];
|
|
86
|
-
if (type !== moduleType
|
|
87
|
-
logWarn(`Multiple GVL IDs found for module '${moduleName}'; using the ${type} module's ID (${gvlid}) instead of the ${moduleType}'s ID (${modules[moduleType]})`)
|
|
101
|
+
if (type !== moduleType) {
|
|
102
|
+
logWarn(`Multiple GVL IDs found for module '${moduleName}'; using the ${type} module's ID (${gvlid}) instead of the ${moduleType}'s ID (${modules[moduleType]})`);
|
|
88
103
|
}
|
|
89
104
|
break;
|
|
90
105
|
}
|
|
@@ -109,9 +124,9 @@ export function getGvlidFromAnalyticsAdapter(code, config) {
|
|
|
109
124
|
try {
|
|
110
125
|
return gvlid.call(adapter.adapter, config);
|
|
111
126
|
} catch (e) {
|
|
112
|
-
logError(`Error invoking ${code} adapter.gvlid()`, e)
|
|
127
|
+
logError(`Error invoking ${code} adapter.gvlid()`, e);
|
|
113
128
|
}
|
|
114
|
-
})(adapter?.adapter?.gvlid)
|
|
129
|
+
})(adapter?.adapter?.gvlid);
|
|
115
130
|
}
|
|
116
131
|
|
|
117
132
|
export function shouldEnforce(consentData, purpose, name) {
|
|
@@ -120,7 +135,7 @@ export function shouldEnforce(consentData, purpose, name) {
|
|
|
120
135
|
// NOTE: this check is not foolproof, as when Prebid first loads, enforcement hooks have not been attached yet
|
|
121
136
|
// This piece of code would not run at all, and `gdprDataHandler.enabled` would be false, until the first
|
|
122
137
|
// `setConfig({consentManagement})`
|
|
123
|
-
logWarn(`Attempting operation that requires purpose ${purpose} consent while consent data is not available${name ? ` (module: ${name})` : ''}. Assuming no consent was given.`)
|
|
138
|
+
logWarn(`Attempting operation that requires purpose ${purpose} consent while consent data is not available${name ? ` (module: ${name})` : ''}. Assuming no consent was given.`);
|
|
124
139
|
return true;
|
|
125
140
|
}
|
|
126
141
|
return consentData && consentData.gdprApplies;
|
|
@@ -142,7 +157,7 @@ export function validateRules(rule, consentData, currentModule, gvlId) {
|
|
|
142
157
|
if ((rule.vendorExceptions || []).includes(currentModule)) {
|
|
143
158
|
return true;
|
|
144
159
|
}
|
|
145
|
-
const vendorConsentRequred = !((gvlId === VENDORLESS_GVLID || (rule.softVendorExceptions || []).includes(currentModule)))
|
|
160
|
+
const vendorConsentRequred = !((gvlId === VENDORLESS_GVLID || (rule.softVendorExceptions || []).includes(currentModule)));
|
|
146
161
|
|
|
147
162
|
// get data from the consent string
|
|
148
163
|
const purposeConsent = deepAccess(consentData, `vendorData.purpose.consents.${purposeId}`);
|
|
@@ -169,170 +184,80 @@ export function validateRules(rule, consentData, currentModule, gvlId) {
|
|
|
169
184
|
}
|
|
170
185
|
|
|
171
186
|
/**
|
|
172
|
-
*
|
|
187
|
+
* all activity rules follow the same structure:
|
|
188
|
+
* if GDPR is in scope, check configuration for a particular purpose, and if that enables enforcement,
|
|
189
|
+
* check against consent data for that purpose and vendor
|
|
173
190
|
*
|
|
174
|
-
* @param
|
|
175
|
-
* @param
|
|
176
|
-
* @param
|
|
177
|
-
* @param
|
|
178
|
-
* @param validate
|
|
191
|
+
* @param purposeNo TCF purpose number to check for this activity
|
|
192
|
+
* @param getEnforcementRule getter for gdprEnforcement rule definition to use
|
|
193
|
+
* @param blocked optional set to use for collecting denied vendors
|
|
194
|
+
* @param gvlidFallback optional factory function for a gvlid falllback function
|
|
179
195
|
*/
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
hasEnforcementHook: true
|
|
183
|
-
});
|
|
184
|
-
if (!hasDeviceAccess()) {
|
|
185
|
-
logWarn('Device access is disabled by Publisher');
|
|
186
|
-
result.valid = false;
|
|
187
|
-
} else if (moduleType === MODULE_TYPE_CORE && !strictStorageEnforcement) {
|
|
188
|
-
// for vendorless (core) storage, do not enforce rules unless strictStorageEnforcement is set
|
|
189
|
-
result.valid = true;
|
|
190
|
-
} else {
|
|
196
|
+
function gdprRule(purposeNo, getEnforcementRule, blocked = null, gvlidFallback = () => null) {
|
|
197
|
+
return function (params) {
|
|
191
198
|
const consentData = gdprDataHandler.getConsentData();
|
|
192
|
-
|
|
193
|
-
if (shouldEnforce(consentData,
|
|
194
|
-
const
|
|
195
|
-
|
|
196
|
-
if (
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
gvlid = getGvlid(moduleType, moduleName)
|
|
200
|
-
}
|
|
201
|
-
const curModule = moduleName || curBidder;
|
|
202
|
-
let isAllowed = validate(purpose1Rule, consentData, curModule, gvlid,);
|
|
203
|
-
if (isAllowed) {
|
|
204
|
-
result.valid = true;
|
|
205
|
-
} else {
|
|
206
|
-
curModule && logWarn(`TCF2 denied device access for ${curModule}`);
|
|
207
|
-
result.valid = false;
|
|
208
|
-
storageBlocked.push(curModule);
|
|
199
|
+
const modName = params[ACTIVITY_PARAM_COMPONENT_NAME];
|
|
200
|
+
if (shouldEnforce(consentData, purposeNo, modName)) {
|
|
201
|
+
const gvlid = getGvlid(params[ACTIVITY_PARAM_COMPONENT_TYPE], modName, gvlidFallback(params));
|
|
202
|
+
let allow = !!validateRules(getEnforcementRule(), consentData, modName, gvlid);
|
|
203
|
+
if (!allow) {
|
|
204
|
+
blocked && blocked.add(modName);
|
|
205
|
+
return {allow};
|
|
209
206
|
}
|
|
210
|
-
} else {
|
|
211
|
-
result.valid = true;
|
|
212
207
|
}
|
|
213
|
-
}
|
|
214
|
-
fn.call(this, moduleType, moduleName, result);
|
|
208
|
+
};
|
|
215
209
|
}
|
|
216
210
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
let isAllowed = validateRules(purpose1Rule, consentData, curBidder, gvlid);
|
|
228
|
-
if (isAllowed) {
|
|
229
|
-
fn.call(this, ...args);
|
|
230
|
-
} else {
|
|
231
|
-
logWarn(`User sync not allowed for ${curBidder}`);
|
|
232
|
-
storageBlocked.push(curBidder);
|
|
233
|
-
}
|
|
234
|
-
} else {
|
|
235
|
-
fn.call(this, ...args);
|
|
236
|
-
}
|
|
237
|
-
}
|
|
211
|
+
export const accessDeviceRule = ((rule) => {
|
|
212
|
+
return function (params) {
|
|
213
|
+
// for vendorless (core) storage, do not enforce rules unless strictStorageEnforcement is set
|
|
214
|
+
if (params[ACTIVITY_PARAM_COMPONENT_TYPE] === MODULE_TYPE_PREBID && !strictStorageEnforcement) return;
|
|
215
|
+
return rule(params);
|
|
216
|
+
};
|
|
217
|
+
})(gdprRule(1, () => purpose1Rule, storageBlocked));
|
|
218
|
+
|
|
219
|
+
export const syncUserRule = gdprRule(1, () => purpose1Rule, storageBlocked);
|
|
220
|
+
export const enrichEidsRule = gdprRule(1, () => purpose1Rule, storageBlocked);
|
|
238
221
|
|
|
239
|
-
/**
|
|
240
|
-
* This hook checks if user id module is given consent or not
|
|
241
|
-
* @param {Function} fn reference to original function (used by hook logic)
|
|
242
|
-
* @param {Submodule[]} submodules Array of user id submodules
|
|
243
|
-
* @param {Object} consentData GDPR consent data
|
|
244
|
-
*/
|
|
245
222
|
export function userIdHook(fn, submodules, consentData) {
|
|
223
|
+
// TODO: remove this in v8 (https://github.com/prebid/Prebid.js/issues/9766)
|
|
246
224
|
if (shouldEnforce(consentData, 1, 'User ID')) {
|
|
247
|
-
|
|
248
|
-
const moduleName = submodule.submodule.name;
|
|
249
|
-
const gvlid = getGvlid(MODULE_TYPE_UID, moduleName);
|
|
250
|
-
let isAllowed = validateRules(purpose1Rule, consentData, moduleName, gvlid);
|
|
251
|
-
if (isAllowed) {
|
|
252
|
-
return submodule;
|
|
253
|
-
} else {
|
|
254
|
-
logWarn(`User denied permission to fetch user id for ${moduleName} User id module`);
|
|
255
|
-
storageBlocked.push(moduleName);
|
|
256
|
-
}
|
|
257
|
-
return undefined;
|
|
258
|
-
}).filter(module => module)
|
|
259
|
-
fn.call(this, userIdModules, { ...consentData, hasValidated: true });
|
|
225
|
+
fn.call(this, submodules, {...consentData, hasValidated: true});
|
|
260
226
|
} else {
|
|
261
227
|
fn.call(this, submodules, consentData);
|
|
262
228
|
}
|
|
263
229
|
}
|
|
264
230
|
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
const consentData = gdprDataHandler.getConsentData();
|
|
273
|
-
if (shouldEnforce(consentData, 2)) {
|
|
274
|
-
adUnits.forEach(adUnit => {
|
|
275
|
-
adUnit.bids = adUnit.bids.filter(bid => {
|
|
276
|
-
const currBidder = bid.bidder;
|
|
277
|
-
const gvlId = getGvlid(MODULE_TYPE_BIDDER, currBidder);
|
|
278
|
-
if (includes(biddersBlocked, currBidder)) return false;
|
|
279
|
-
const isAllowed = !!validateRules(purpose2Rule, consentData, currBidder, gvlId);
|
|
280
|
-
if (!isAllowed) {
|
|
281
|
-
logWarn(`TCF2 blocked auction for ${currBidder}`);
|
|
282
|
-
biddersBlocked.push(currBidder);
|
|
283
|
-
}
|
|
284
|
-
return isAllowed;
|
|
285
|
-
});
|
|
286
|
-
});
|
|
287
|
-
fn.call(this, adUnits, ...args);
|
|
288
|
-
} else {
|
|
289
|
-
fn.call(this, adUnits, ...args);
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
/**
|
|
294
|
-
* Checks if Analytics adapters are allowed to send data to their servers for furhter processing.
|
|
295
|
-
* Enforces "purpose 7 (Measurement)" of TCF v2.0 spec
|
|
296
|
-
* @param {Function} fn - Function reference to the original function.
|
|
297
|
-
* @param {Array<AnalyticsAdapterConfig>} config - Configuration object passed to pbjs.enableAnalytics()
|
|
298
|
-
*/
|
|
299
|
-
export function enableAnalyticsHook(fn, config) {
|
|
300
|
-
const consentData = gdprDataHandler.getConsentData();
|
|
301
|
-
if (shouldEnforce(consentData, 7, 'Analytics')) {
|
|
302
|
-
if (!isArray(config)) {
|
|
303
|
-
config = [config]
|
|
231
|
+
export const fetchBidsRule = ((rule) => {
|
|
232
|
+
return function (params) {
|
|
233
|
+
if (params[ACTIVITY_PARAM_COMPONENT_TYPE] !== MODULE_TYPE_BIDDER) {
|
|
234
|
+
// TODO: this special case is for the PBS adapter (componentType is 'prebid')
|
|
235
|
+
// we should check for generic purpose 2 consent & vendor consent based on the PBS vendor's GVL ID;
|
|
236
|
+
// that is, however, a breaking change and skipped for now
|
|
237
|
+
return;
|
|
304
238
|
}
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
analyticsBlocked.push(analyticsAdapterCode);
|
|
311
|
-
logWarn(`TCF2 blocked analytics adapter ${conf.provider}`);
|
|
312
|
-
}
|
|
313
|
-
return isAllowed;
|
|
314
|
-
});
|
|
315
|
-
fn.call(this, config);
|
|
316
|
-
} else {
|
|
317
|
-
fn.call(this, config);
|
|
318
|
-
}
|
|
319
|
-
}
|
|
239
|
+
return rule(params);
|
|
240
|
+
};
|
|
241
|
+
})(gdprRule(2, () => purpose2Rule, biddersBlocked));
|
|
242
|
+
|
|
243
|
+
export const reportAnalyticsRule = gdprRule(7, () => purpose7Rule, analyticsBlocked, (params) => getGvlidFromAnalyticsAdapter(params[ACTIVITY_PARAM_COMPONENT_NAME], params[ACTIVITY_PARAM_ANL_CONFIG]));
|
|
320
244
|
|
|
321
245
|
/**
|
|
322
246
|
* Compiles the TCF2.0 enforcement results into an object, which is emitted as an event payload to "tcf2Enforcement" event.
|
|
323
247
|
*/
|
|
324
248
|
function emitTCF2FinalResults() {
|
|
325
249
|
// remove null and duplicate values
|
|
326
|
-
const
|
|
327
|
-
return
|
|
328
|
-
}
|
|
250
|
+
const formatSet = function (st) {
|
|
251
|
+
return Array.from(st.keys()).filter(el => el != null);
|
|
252
|
+
};
|
|
329
253
|
const tcf2FinalResults = {
|
|
330
|
-
storageBlocked:
|
|
331
|
-
biddersBlocked:
|
|
332
|
-
analyticsBlocked:
|
|
254
|
+
storageBlocked: formatSet(storageBlocked),
|
|
255
|
+
biddersBlocked: formatSet(biddersBlocked),
|
|
256
|
+
analyticsBlocked: formatSet(analyticsBlocked)
|
|
333
257
|
};
|
|
334
258
|
|
|
335
259
|
events.emit(CONSTANTS.EVENTS.TCF2_ENFORCEMENT, tcf2FinalResults);
|
|
260
|
+
[storageBlocked, biddersBlocked, analyticsBlocked].forEach(el => el.clear());
|
|
336
261
|
}
|
|
337
262
|
|
|
338
263
|
events.on(CONSTANTS.EVENTS.AUCTION_END, emitTCF2FinalResults);
|
|
@@ -340,9 +265,15 @@ events.on(CONSTANTS.EVENTS.AUCTION_END, emitTCF2FinalResults);
|
|
|
340
265
|
/*
|
|
341
266
|
Set of callback functions used to detect presence of a TCF rule, passed as the second argument to find().
|
|
342
267
|
*/
|
|
343
|
-
const hasPurpose1 = (rule) => {
|
|
344
|
-
|
|
345
|
-
|
|
268
|
+
const hasPurpose1 = (rule) => {
|
|
269
|
+
return rule.purpose === TCF2.purpose1.name;
|
|
270
|
+
};
|
|
271
|
+
const hasPurpose2 = (rule) => {
|
|
272
|
+
return rule.purpose === TCF2.purpose2.name;
|
|
273
|
+
};
|
|
274
|
+
const hasPurpose7 = (rule) => {
|
|
275
|
+
return rule.purpose === TCF2.purpose7.name;
|
|
276
|
+
};
|
|
346
277
|
|
|
347
278
|
/**
|
|
348
279
|
* A configuration function that initializes some module variables, as well as adds hooks
|
|
@@ -373,27 +304,25 @@ export function setEnforcementConfig(config) {
|
|
|
373
304
|
if (!hooksAdded) {
|
|
374
305
|
if (purpose1Rule) {
|
|
375
306
|
hooksAdded = true;
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
307
|
+
RULE_HANDLES.push(registerActivityControl(ACTIVITY_ACCESS_DEVICE, RULE_NAME, accessDeviceRule));
|
|
308
|
+
RULE_HANDLES.push(registerActivityControl(ACTIVITY_SYNC_USER, RULE_NAME, syncUserRule));
|
|
309
|
+
RULE_HANDLES.push(registerActivityControl(ACTIVITY_ENRICH_EIDS, RULE_NAME, enrichEidsRule));
|
|
310
|
+
// TODO: remove this hook in v8 (https://github.com/prebid/Prebid.js/issues/9766)
|
|
379
311
|
getHook('validateGdprEnforcement').before(userIdHook, 47);
|
|
380
312
|
}
|
|
381
313
|
if (purpose2Rule) {
|
|
382
|
-
|
|
314
|
+
RULE_HANDLES.push(registerActivityControl(ACTIVITY_FETCH_BIDS, RULE_NAME, fetchBidsRule));
|
|
383
315
|
}
|
|
384
316
|
if (purpose7Rule) {
|
|
385
|
-
|
|
317
|
+
RULE_HANDLES.push(registerActivityControl(ACTIVITY_REPORT_ANALYTICS, RULE_NAME, reportAnalyticsRule));
|
|
386
318
|
}
|
|
387
319
|
}
|
|
388
320
|
}
|
|
389
321
|
|
|
390
322
|
export function uninstall() {
|
|
323
|
+
while (RULE_HANDLES.length) RULE_HANDLES.pop()();
|
|
391
324
|
[
|
|
392
|
-
validateStorageEnforcement.getHooks({hook: deviceAccessHook}),
|
|
393
|
-
registerSyncInner.getHooks({hook: userSyncHook}),
|
|
394
325
|
getHook('validateGdprEnforcement').getHooks({hook: userIdHook}),
|
|
395
|
-
getHook('makeBidRequests').getHooks({hook: makeBidRequestsHook}),
|
|
396
|
-
getHook('enableAnalyticsCb').getHooks({hook: enableAnalyticsHook}),
|
|
397
326
|
].forEach(hook => hook.remove());
|
|
398
327
|
hooksAdded = false;
|
|
399
328
|
}
|
|
@@ -8,7 +8,7 @@ const analyticsType = 'endpoint';
|
|
|
8
8
|
|
|
9
9
|
export const ANALYTICS_VERSION = '1.0.0';
|
|
10
10
|
|
|
11
|
-
const ANALYTICS_SERVER = 'https://
|
|
11
|
+
const ANALYTICS_SERVER = 'https://a.greenbids.ai';
|
|
12
12
|
|
|
13
13
|
const {
|
|
14
14
|
EVENTS: {
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This module adds GrowthCode HEM and other Data to Bid Requests
|
|
3
|
+
* @module modules/growthCodeRtdProvider
|
|
4
|
+
*/
|
|
5
|
+
import { submodule } from '../src/hook.js'
|
|
6
|
+
import { getStorageManager } from '../src/storageManager.js';
|
|
7
|
+
import {
|
|
8
|
+
logMessage, logError, tryAppendQueryString, mergeDeep
|
|
9
|
+
} from '../src/utils.js';
|
|
10
|
+
import * as ajax from '../src/ajax.js';
|
|
11
|
+
import { MODULE_TYPE_RTD } from '../src/activities/modules.js';
|
|
12
|
+
|
|
13
|
+
const MODULE_NAME = 'growthCodeRtd';
|
|
14
|
+
const LOG_PREFIX = 'GrowthCodeRtd: ';
|
|
15
|
+
const ENDPOINT_URL = 'https://p2.gcprivacy.com/v2/rtd?'
|
|
16
|
+
const RTD_EXPIRE_KEY = 'gc_rtd_expires_at'
|
|
17
|
+
const RTD_CACHE_KEY = 'gc_rtd_items'
|
|
18
|
+
|
|
19
|
+
export const storage = getStorageManager({ moduleType: MODULE_TYPE_RTD, moduleName: MODULE_NAME });
|
|
20
|
+
let items
|
|
21
|
+
|
|
22
|
+
export const growthCodeRtdProvider = {
|
|
23
|
+
name: MODULE_NAME,
|
|
24
|
+
init: init,
|
|
25
|
+
getBidRequestData: alterBidRequests,
|
|
26
|
+
addData: addData,
|
|
27
|
+
callServer: callServer
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Parse json if possible, else return null
|
|
32
|
+
* @param data
|
|
33
|
+
* @returns {any|null}
|
|
34
|
+
*/
|
|
35
|
+
function tryParse(data) {
|
|
36
|
+
try {
|
|
37
|
+
return JSON.parse(data);
|
|
38
|
+
} catch (err) {
|
|
39
|
+
logError(err);
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Init The RTD Module
|
|
46
|
+
* @param config
|
|
47
|
+
* @param userConsent
|
|
48
|
+
* @returns {boolean}
|
|
49
|
+
*/
|
|
50
|
+
function init(config, userConsent) {
|
|
51
|
+
logMessage(LOG_PREFIX + 'Init RTB');
|
|
52
|
+
|
|
53
|
+
if (config == null) {
|
|
54
|
+
return false
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const configParams = (config && config.params) || {};
|
|
58
|
+
let expiresAt = parseInt(storage.getDataFromLocalStorage(RTD_EXPIRE_KEY, null));
|
|
59
|
+
|
|
60
|
+
items = tryParse(storage.getDataFromLocalStorage(RTD_CACHE_KEY, null));
|
|
61
|
+
|
|
62
|
+
return callServer(configParams, items, expiresAt, userConsent);
|
|
63
|
+
}
|
|
64
|
+
function callServer(configParams, items, expiresAt, userConsent) {
|
|
65
|
+
// Expire Cache
|
|
66
|
+
let now = Math.trunc(Date.now() / 1000);
|
|
67
|
+
if ((!isNaN(expiresAt)) && (now > expiresAt)) {
|
|
68
|
+
expiresAt = NaN;
|
|
69
|
+
storage.removeDataFromLocalStorage(RTD_CACHE_KEY, null)
|
|
70
|
+
storage.removeDataFromLocalStorage(RTD_EXPIRE_KEY, null)
|
|
71
|
+
}
|
|
72
|
+
if ((items === null) && (isNaN(expiresAt))) {
|
|
73
|
+
let gcid = localStorage.getItem('gcid')
|
|
74
|
+
|
|
75
|
+
let url = configParams.url ? configParams.url : ENDPOINT_URL;
|
|
76
|
+
url = tryAppendQueryString(url, 'pid', configParams.pid);
|
|
77
|
+
url = tryAppendQueryString(url, 'u', window.location.href);
|
|
78
|
+
url = tryAppendQueryString(url, 'gcid', gcid);
|
|
79
|
+
if ((userConsent !== null) && (userConsent.gdpr !== null) && (userConsent.gdpr.consentData.getTCData.tcString)) {
|
|
80
|
+
url = tryAppendQueryString(url, 'tcf', userConsent.gdpr.consentData.getTCData.tcString)
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
ajax.ajaxBuilder()(url, {
|
|
84
|
+
success: response => {
|
|
85
|
+
let respJson = tryParse(response);
|
|
86
|
+
// If response is a valid json and should save is true
|
|
87
|
+
if (respJson && respJson.results >= 1) {
|
|
88
|
+
storage.setDataInLocalStorage(RTD_CACHE_KEY, JSON.stringify(respJson.items), null);
|
|
89
|
+
storage.setDataInLocalStorage(RTD_EXPIRE_KEY, respJson.expires_at, null)
|
|
90
|
+
} else {
|
|
91
|
+
storage.setDataInLocalStorage(RTD_EXPIRE_KEY, respJson.expires_at, null)
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
error: error => {
|
|
95
|
+
logError(LOG_PREFIX + 'ID fetch encountered an error', error);
|
|
96
|
+
}
|
|
97
|
+
}, undefined, {method: 'GET', withCredentials: true})
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return true;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function addData(reqBidsConfigObj, items) {
|
|
104
|
+
let merge = false
|
|
105
|
+
|
|
106
|
+
for (let j = 0; j < items.length; j++) {
|
|
107
|
+
let item = items[j]
|
|
108
|
+
let data = JSON.parse(item.parameters);
|
|
109
|
+
if (item['attachment_point'] === 'data') {
|
|
110
|
+
mergeDeep(reqBidsConfigObj.ortb2Fragments.bidder, data)
|
|
111
|
+
merge = true
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return merge
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Alter the Bid Request for additional information such as HEM or 3rd Party Ids
|
|
119
|
+
* @param reqBidsConfigObj
|
|
120
|
+
* @param callback
|
|
121
|
+
* @param config
|
|
122
|
+
* @param userConsent
|
|
123
|
+
*/
|
|
124
|
+
function alterBidRequests(reqBidsConfigObj, callback, config, userConsent) {
|
|
125
|
+
if (items != null) {
|
|
126
|
+
addData(reqBidsConfigObj, items)
|
|
127
|
+
}
|
|
128
|
+
callback();
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
submodule('realTimeData', growthCodeRtdProvider);
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
## GrowthCode Real-time Data Submodule
|
|
2
|
+
|
|
3
|
+
The [GrowthCode](https://growthcode.io) real-time data module in Prebid enables publishers to fully
|
|
4
|
+
leverage the potential of their first-party audiences and contextual data.
|
|
5
|
+
With an integrated cookieless GrowthCode identity, this module offers real-time
|
|
6
|
+
contextual and audience segmentation (IAB Taxonomy 2.2, cattax: 6) capabilities, and HEMs that can seamlessly
|
|
7
|
+
integrate into your existing Prebid deployment, making it easy to maximize
|
|
8
|
+
your advertising strategies.
|
|
9
|
+
|
|
10
|
+
## Building Prebid with GrowthCode Support
|
|
11
|
+
|
|
12
|
+
Compile the GrowthCode RTD module into your Prebid build:
|
|
13
|
+
|
|
14
|
+
`gulp serve --modules=userId,rtdModule,appnexusBidAdapter,growthCodeRtdProvider,sharedIdSystem,criteoBidAdapter`
|
|
15
|
+
|
|
16
|
+
Please visit https://growthcode.io/ for more information.
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
pbjs.setConfig(
|
|
20
|
+
...
|
|
21
|
+
realTimeData: {
|
|
22
|
+
auctionDelay: 1000,
|
|
23
|
+
dataProviders: [
|
|
24
|
+
{
|
|
25
|
+
name: 'growthCodeRtd',
|
|
26
|
+
waitForIt: true,
|
|
27
|
+
params: {
|
|
28
|
+
pid: 'TEST01',
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
...
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Parameter Descriptions for the GrowthCode Configuration Section
|
|
38
|
+
|
|
39
|
+
| Name | Type | Description | Notes |
|
|
40
|
+
|:---------------------------------|:--------|:--------------------------------------------------------------------------|:----------------------------|
|
|
41
|
+
| name | String | Real time data module name | Always 'growthCodeRtd' |
|
|
42
|
+
| waitForIt | Boolean | Required to ensure that the auction is delayed until prefetch is complete | Optional. Defaults to false |
|
|
43
|
+
| params | Object | | |
|
|
44
|
+
| params.pid | String | This is the Parter ID value obtained from GrowthCode | `TEST01` |
|
|
45
|
+
| params.url | String | Custom URL for server | Optional |
|
|
46
|
+
|
|
47
|
+
## Testing
|
|
48
|
+
|
|
49
|
+
To view an example of GrowthCode backends:
|
|
50
|
+
|
|
51
|
+
`gulp serve --modules=userId,rtdModule,appnexusBidAdapter,growthCodeRtdProvider,sharedIdSystem,criteoBidAdapter`
|
|
52
|
+
|
|
53
|
+
and then point your browser at:
|
|
54
|
+
|
|
55
|
+
`http://localhost:9999/integrationExamples/gpt/growthcode.html`
|
package/modules/id5IdSystem.js
CHANGED
|
@@ -60,11 +60,11 @@ export const id5IdSubmodule = {
|
|
|
60
60
|
*/
|
|
61
61
|
decode(value, config) {
|
|
62
62
|
let universalUid;
|
|
63
|
-
let
|
|
63
|
+
let ext = {};
|
|
64
64
|
|
|
65
65
|
if (value && typeof value.universal_uid === 'string') {
|
|
66
66
|
universalUid = value.universal_uid;
|
|
67
|
-
|
|
67
|
+
ext = value.ext || ext;
|
|
68
68
|
} else {
|
|
69
69
|
return undefined;
|
|
70
70
|
}
|
|
@@ -72,9 +72,7 @@ export const id5IdSubmodule = {
|
|
|
72
72
|
let responseObj = {
|
|
73
73
|
id5id: {
|
|
74
74
|
uid: universalUid,
|
|
75
|
-
ext:
|
|
76
|
-
linkType: linkType
|
|
77
|
-
}
|
|
75
|
+
ext: ext
|
|
78
76
|
}
|
|
79
77
|
};
|
|
80
78
|
|