Skip to content

Commit

Permalink
Add OneTrust CMP (#30339)
Browse files Browse the repository at this point in the history
* Add OneTrust CMP

* update license year to 2020
  • Loading branch information
gramesan committed Sep 23, 2020
1 parent 463c561 commit fbd6065
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 0 deletions.
19 changes: 19 additions & 0 deletions examples/amp-consent/cmp-vendors.amp.html
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,25 @@ <h3>Image that is NOT blocked by consent</h3>
</amp-consent>
<!-- End Ogury example -->

<!-- OneTrust example -->
<amp-consent id='consent' layout='nodisplay' type='onetrust'>
<script type="application/json">
{
"postPromptUI": "onetrust-consent-prompt-ui",
"clientConfig": {
"CMP_id": "ac6c1ea9-9ac8-460e-a132-b328dea3f56f-test",
"Env": "App",
"Opt_Out": "C0004"
}
}
</script>
<div id="onetrust-consent-prompt-ui">
Post Prompt UI
<button on="tap:consent.prompt(consent=onetrust)" role="button">Privacy Settings</button>
</div>
</amp-consent>
<!-- End OneTrust example -->

<!-- opencmp example -->
<amp-consent id='consent' layout='nodisplay' type='opencmp'>
<script type="application/json">
Expand Down
6 changes: 6 additions & 0 deletions extensions/amp-consent/0.1/cmps.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ CMP_CONFIG['Ogury'] = {
'promptUISrc': 'https://www.ogury.mgr.consensu.org/amp.html',
};

CMP_CONFIG['onetrust'] = {
'consentInstanceId': 'onetrust',
'checkConsentHref': 'https://cdn.cookielaw.org/amp/consent/check',
'promptUISrc': ' https://amp.onetrust.mgr.consensu.org/',
};

CMP_CONFIG['opencmp'] = {
'consentInstanceId': 'opencmp',
'checkConsentHref': 'https://amp.opencmp.net/consent/check',
Expand Down
1 change: 1 addition & 0 deletions extensions/amp-consent/amp-consent.md
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,7 @@ Join in on the discussion where we are discussing [upcoming potential features](
- Sirdata : [Website](http://www.sirdata.com/) - [Documentation](https://cmp.sirdata.com/#/docs)
- Marfeel : [Website](https://www.marfeel.com/) - [Documentation](./cmps/marfeel.md)
- Ogury : [Website](https://www.ogury.com/) - [Documentation](./cmps/ogury.md)
- OneTrust: [Website](https://www.onetrust.com/) - [Documentation](./cmps/onetrust.md)
- opencmp : [Documentation](./cmps/opencmp.md)
- SourcePoint : [Website](https://www.sourcepoint.com/) - [Documentation](./cmps/sourcepoint.md)
- Usercentrics : [Website](https://www.usercentrics.com/) - [Documentation](./cmps/usercentrics.md)
Expand Down
62 changes: 62 additions & 0 deletions extensions/amp-consent/cmps/onetrust.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<!---
Copyright 2020 The AMP HTML Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS-IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

# OneTrust

## Example

```html
<amp-consent id="consent" layout="nodisplay" type="onetrust">
<script type="application/json">
{
"postPromptUI": "onetrust-consent-prompt-ui",
"clientConfig": {
"CMP_id": "ac6c1ea9-9ac8-460e-a132-b328dea3f56f-test",
"Env": "App",
"Opt_Out": "C0004"
}
}
</script>
<div id="onetrust-consent-prompt-ui">
Post Prompt UI
<button on="tap:consent.prompt(consent=onetrust)" role="button">
Privacy Settings
</button>
</div>
</amp-consent>
```

## Notes

### `postPromptUI`

The value of `postPromptUI` should be the id of the html tag in which the consent ui will be attached to. In our example above, the value of `postPromptUI` is `onetrust-consent-prompt-ui` since we have a div with that id.

### Opening the Preference Center

Notice in the example above, we have a `button` with the attribute `on="tap.consent.prompt(consent=onetrust)"` with the text "Privacy Settings". The id of your `<amp-consent>` element is relevant here. Notice how the id of our `<amp-consent>` is `consent`, that's why the `on` attribute has the value "tap.**consent**.prompt(consent=onetrust)". This button is required if using IAB TCF 2.0, but the button text and position can be changed.

## Configuration (`clientConfig`)

| Attribute | Type | Mandatory | Description |
| --------- | :----: | :-------: | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| CMP_id | String | yes | This your domain script ID, if can be found in the data-domain-script attribute of your script tag. |
| Env | String | yes | This is the environment of where your OneTrust account is hosted. This affects which domain your script is being served from. Options include: "App", "App-eu", "App-de", "App-uk", "CookiePro" |
| Opt_Out | String | Yes | This indicates which cookie category id should be used to return a rejection or acceptance to AMP. Recommend using your Targeting Ads category, which has a default id of C0004 (your id may be different) |

## Getting Help

For more information on how to integrate AMP to your page please visit our [support portal](http://my.onetrust.com/) or contact your technical account manager directly.

0 comments on commit fbd6065

Please sign in to comment.