From 201ac720bbf24e9998bdb5e919ab44c6455734c9 Mon Sep 17 00:00:00 2001 From: Tiago Peczenyj Date: Thu, 29 Feb 2024 15:33:18 +0100 Subject: [PATCH] update docs related to fix gdpr consent verification with user data on weborama rtd module --- dev-docs/modules/weboramaRtdProvider.md | 55 ++++++++++++++++++------- 1 file changed, 40 insertions(+), 15 deletions(-) diff --git a/dev-docs/modules/weboramaRtdProvider.md b/dev-docs/modules/weboramaRtdProvider.md index 8bab28f872..29d450291a 100644 --- a/dev-docs/modules/weboramaRtdProvider.md +++ b/dev-docs/modules/weboramaRtdProvider.md @@ -111,8 +111,6 @@ This is the main configuration section | params.weboUserDataConf | Object | Weborama WAM User-Centric Configuration | Optional | | params.sfbxLiteDataConf | Object | Sfbx LiTE Site-Centric Configuration | Optional | | params.onData | Callback | If set, will receive the profile and metadata | Optional. Affects the `weboCtxConf`, `weboUserDataConf` and `sfbxLiteDataConf` sections | -| params.setProfileAsBidderKeywords | Object | If present, specify one or more bidders to send data also as keywords (`site.content.keywords` or `user.keywords`) | Optional. Affects the `weboCtxConf`, `weboUserDataConf` and `sfbxLiteDataConf` sections | -| params.checkBidderAliasForKeywords | Boolean | Modify `params.setProfileAsBidderKeywords` to search in the bidder alias registry| Optional. Affects the `weboCtxConf`, `weboUserDataConf` and `sfbxLiteDataConf` sections | #### Contextual Site-Centric Configuration @@ -132,8 +130,6 @@ On this section we will explain the `params.weboCtxConf` subconfiguration: | onData | Callback | If set, will receive the profile and metadata | Optional. Default is `params.onData` (if any) or log via prebid debug | | enabled | Boolean| if false, will ignore this configuration| Default is `true` if this section is present| | baseURLProfileAPI | String| if present, update the domain of the contextual api| Optional. Default is `ctx.weborama.com` | -| setProfileAsBidderKeywords | String or Array | If present, specify one or more bidders to send data also as keywords (`site.content.keywords` or `user.keywords`) | Optional. Default is `appnexus`. | -| checkBidderAliasForKeywords | Boolean | Modify `setProfileAsBidderKeywords` to search in the bidder alias registry. | Optional. Default is `true` | #### User-Centric Configuration @@ -152,8 +148,15 @@ On this section we will explain the `params.weboUserDataConf` subconfiguration: | defaultProfile | Object | default value of the profile to be used when there are no response from contextual api (such as timeout)| Optional. Default is `{}` | | localStorageProfileKey| String | can be used to customize the local storage key | Optional | | enabled | Boolean| if false, will ignore this configuration| Default is `true` if this section is present| -| setProfileAsBidderKeywords | String or Array | If present, specify one or more bidders to send data also as keywords (`site.content.keywords` or `user.keywords`) | Optional. Default is `appnexus`. | -| checkBidderAliasForKeywords | Boolean | Modify `setProfileAsBidderKeywords` to search in the bidder alias registry. | Optional. Default is `true` | + +##### User Consent + +The WAM User-Centric configuration will check for user consent if gdpr applies. It will check for consent: + +* Vendor ID 284 (Weborama) +* Purpose IDs: 1, 3, 4, 5 and 6 + +If the user consent does not match such conditions, this module will not load, means we will not check for any data in local storage and the default profile will be ignored. #### Sfbx LiTE Site-Centric Configuration @@ -170,8 +173,6 @@ On this section we will explain the `params.sfbxLiteDataConf` subconfiguration: | defaultProfile | Object | default value of the profile to be used when there are no response from contextual api (such as timeout)| Optional. Default is `{}` | | localStorageProfileKey| String | can be used to customize the local storage key | Optional | | enabled | Boolean| if false, will ignore this configuration| Default is `true` if this section is present| -| setProfileAsBidderKeywords | String or Array | If present, specify one or more bidders to send data also as keywords (`site.content.keywords` or `user.keywords`) | Optional. Default is `appnexus`. | -| checkBidderAliasForKeywords | Boolean | Modify `setProfileAsBidderKeywords` to search in the bidder alias registry. | Optional. Default is `true` | ##### Property setPrebidTargeting supported types @@ -193,6 +194,28 @@ setPrebidTargeting: function(adUnitCode, data, metadata){ } ``` +This callback will be executed with the adUnitCode, profile and a metadata with the following fields + +{: .table .table-bordered .table-striped } +| Name |Type | Description | Notes | +| :------------ | :------------ | :------------ |:------------ | +| user | Boolean | If true, it contains user-centric data | | +| source | String | Represent the source of data | can be `contextual`, `wam` or `lite` | +| isDefault | Boolean | If true, it contains the default profile defined in the configuration | | + +It is possible customize the targeting based on the parameters: + +```javascript +setPrebidTargeting: function(adUnitCode, data, metadata){ + // check metadata.source can be omitted if defined in params.weboUserDataConf + if (adUnitCode == 'adUnitCode1' && metadata.source == 'wam'){ + data['foo']=['bar']; // add this section only for adUnitCode1 + delete data['other']; // remove this section + } + return true; +} +``` + ##### Property sendToBidders supported types This property support the following types @@ -204,7 +227,7 @@ This property support the following types | String|Will send data to only one bidder | `'appnexus'` | | | Array of Strings|Will send data to only some bidders | `['appnexus','pubmatic']` | | | Object |Will send data to only some bidders and some ad units | `{appnexus: true, pubmatic:['adUnitCode1']}` | | -| Callback |Will be executed for each adunit, expects return a true value to set prebid targeting or not| `function(bid, adUnitCode){return bid.bidder == 'appnexus' && adUnitCode == 'adUnitCode';}` | the parameter `adUnitCode` can be consider | +| Callback |Will be executed for each adunit, expects return a true value to set prebid targeting or not| `function(bid, adUnitCode){return bid.bidder == 'appnexus' && adUnitCode == 'adUnitCode';}` | | A better look on the `Object` type @@ -236,7 +259,7 @@ It is possible customize the targeting based on the parameters: ```javascript sendToBidders: function(bid, adUnitCode, data, metadata){ - if (bid.bidder == 'appnexus'){ + if (bid.bidder == 'appnexus' && adUnitCode == 'adUnitCode1'){ data['foo']=['bar']; // add this section only for appnexus + adUnitCode1 delete data['other']; // remove this section } @@ -545,10 +568,10 @@ pbjs.que.push(function () { }, weboUserDataConf: { accountId: 12345, // recommended - setPrebidTargeting: true + setPrebidTargeting: ['adUnitCode1',...], // set target only on certain adunits sendToBidders: { // send to only some bidders and adunits - 'appnexus': true, // enable appnexus - 'pubmatic': false // explicit disable pubmatic + 'appnexus': true, // all adunits for appnexus + 'pubmatic': ['adUnitCode1',...] // some adunits for pubmatic // other bidders will be ignored }, defaultProfile: { // optional @@ -560,9 +583,11 @@ pbjs.que.push(function () { //, onData: function (data, ...) { ...} }, sfbxLiteDataConf: { - setPrebidTargeting: true, + setPrebidTargeting: function(adUnitCode){ // specify set target via callback + return adUnitCode == 'adUnitCode1'; + }, sendToBidders: function(bid, adUnitCode){ // specify sendToBidders via callback - return bid.bidder == 'appnexus'; + return bid.bidder == 'appnexus' && adUnitCode == 'adUnitCode1'; } defaultProfile: { // optional lite_occupation: ['gérant', 'bénévole'],