Skip to content

Commit 3768737

Browse files
Consent Management : reset functionality to properly disable TCF/GPP modules (#6315)
* Consent Management reset * Fix line lint issue
1 parent fc9664e commit 3768737

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

dev-docs/modules/consentManagementGpp.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ Here are the parameters supported in the `consentManagement` object specific for
5858
| Param | Type | Description | Example |
5959
| --- | --- | --- | --- |
6060
| gpp | `Object` | | |
61+
| gpp.enabled | `boolean` | Enables or disables the GPP consent management module. When set to `false`, Prebid does not initialize the CMP integration, does not delay auctions for consent, removes any active CMP event listeners. Defaults to `true` if not specified. | `false` |
6162
| gpp.cmpApi | `string` | The CMP interface that is in use. Supported values are **'iab'** or **'static'**. Static allows integrations where IAB-formatted consent strings are provided in a non-standard way. Default is `'iab'`. | `'iab'` |
6263
| gpp.timeout | `integer` | Length of time (in milliseconds) to allow the CMP to obtain the GPP consent information. Default is `10000`. | `10000` |
6364
| gpp.actionTimeout | `integer` | Length of time (in milliseconds) to allow the user to take action to consent if they have not already done so. The actionTimer first waits for the CMP to load, then the actionTimeout begins for the specified duration. Default is `undefined`. | `10000` |
@@ -117,6 +118,22 @@ Example 2: Static CMP using custom data passing.
117118
});
118119
```
119120

121+
Example 3: Disabling the module. When disabled, Prebid.js will not fetch GPP data, will not wait for the CMP. Existing CMP listeners (if any were previously active) are cleaned up.
122+
123+
```javascript
124+
var pbjs = pbjs || {};
125+
pbjs.que = pbjs.que || [];
126+
pbjs.que.push(function() {
127+
pbjs.setConfig({
128+
consentManagement: {
129+
gpp: {
130+
enabled: false
131+
}
132+
}
133+
});
134+
});
135+
```
136+
120137
## Build the Package
121138

122139
Follow the basic build instructions in the GitHub Prebid.js repo's main [README](https://github.com/prebid/Prebid.js/blob/master/README.md). To include the consent management module, an additional option must be added to the **gulp build** command:

dev-docs/modules/consentManagementTcf.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ but we recommend migrating to the new config structure as soon as possible.
6666
| Param | Type | Description | Example |
6767
| --- | --- | --- | --- |
6868
| gdpr | `Object` | | |
69+
| gdpr.enabled | `boolean` | Enables or disables the TCF consent management module. When set to `false`, Prebid does not initialize the CMP integration, does not delay auctions for consent, removes any active CMP event listeners. Defaults to `true` if not specified. | `false` |
6970
| gdpr.cmpApi | `string` | The CMP interface that is in use. Supported values are **'iab'** or **'static'**. Static allows integrations where IAB-formatted consent strings are provided in a non-standard way. Default is `'iab'`. | `'iab'` |
7071
| gdpr.timeout | `integer` | Length of time (in milliseconds) to allow the CMP to obtain the GDPR consent string. Default is `10000`. | `10000` |
7172
| gdpr.actionTimeout | `integer` | Length of time (in milliseconds) to allow the user to take action to consent if they have not already done so. The actionTimer first waits for the CMP to load, then the actionTimeout begins for the specified duration. Default is `undefined`. | `10000` |
@@ -171,6 +172,22 @@ Example 3: Static CMP using custom data passing.
171172
});
172173
```
173174

175+
Example 4: Disabling the module. When disabled, Prebid.js will not fetch TCF data, will not wait for the CMP. Existing CMP listeners (if any were previously active) are cleaned up.
176+
177+
```javascript
178+
var pbjs = pbjs || {};
179+
pbjs.que = pbjs.que || [];
180+
pbjs.que.push(function() {
181+
pbjs.setConfig({
182+
consentManagement: {
183+
gdpr: {
184+
enabled: false
185+
}
186+
}
187+
});
188+
});
189+
```
190+
174191
## Build the Package
175192

176193
Follow the basic build instructions in the GitHub Prebid.js repo's main [README](https://github.com/prebid/Prebid.js/blob/master/README.md). To include the consent management module, an additional option must be added to the **gulp build** command:

0 commit comments

Comments
 (0)