Your resource key is the file name in the tag's URL, /api/v4/pmp/YOUR-RESOURCE-KEY.js, and it is read from there and from nowhere else. It is not an attribute and there is no data-resource-key.
Every other setting is a data- attribute on the one <script> tag you write, so each setting is written in one place and read from one place. The loader copies your attributes onto the bundle it pulls in, so you never write any of them twice.
Your key must be registered for the domain the page is served from. The request for the bundle is checked against the domains the key names, so a page on a domain the key does not cover is refused and no dialog appears.
The Attributes🔗
| Attribute | Required | Default | What it does |
data-tcf-vendor | Yes | none | Your own Transparency and Consent Framework vendor string. The PMP sets the purpose bits and the time fields from the visitor's answer and copies everything else through unchanged. A multi part string such as core.disclosedvendors is accepted and the trailing parts are preserved. |
data-brand-name | Yes | none | Your brand, shown in the dialog. |
data-brand-terms-url | Yes | none | Your privacy or terms page, linked from the dialog. |
data-alt-name | Yes | none | The label on the alternative button, for example 'Subscribe' or 'Remove ads'. |
data-alt-url | Yes | none | What the alternative button does. An http or https URL navigates the page. A javascript: URL runs inline and the page stays where it is. |
data-network-name | When sharing | none | The name of the group your sites belong to. Required for the second card, because a visitor has to be told which sites an answer would apply to. Leaving it out turns sharing off with a warning. See Sharing an Answer Across Your Sites. |
data-object-name | No | fod | The name of the 51Degrees client script's page object, so the PMP can find it. Leave it out unless your client script tag sets fod-js-object-name to something else. Every console message names whichever name is in force. |
data-action-url | No | none | A hook of your own, fired on every answer, with {preference} replaced by standard, personalized or non-marketing. An http or https URL is added as a script tag, a javascript: URL runs inline. Leaving it out means nothing is fired, and nothing else changes. |
data-license-key | No | none | Further licence keys, several separated by +, where your products need one on top of the resource key. Anyone reading the page can see it, exactly as they could when it sat on a URL. |
data-brand-logo | No | none | Your logo, shown in the dialog's header. |
data-brand-icon | No | a gear symbol | The round icon on the bubble the dialog collapses to. |
data-network-logo | No | none | The group's logo, shown beside your own. |
data-show-standard | No | false | Set to true to offer Standard alongside Personalized and the alternative. |
data-use-third-party-cookies | No | true | Whether a visitor who chose Standard or Personalized may be offered the second card. Only the exact string false turns it off, so a typo leaves it on rather than quietly removing it. Where it is on and data-network-name is present, the second card is shown only where the client script confirms that third party cookies work, and where the client script is still testing the cookie when the first card is answered, the PMP waits up to three seconds for that confirmation, counted from the later of the answer and a client script being on the page. Turning it off, or leaving out data-network-name, means there is no second card and nothing ever waits between the cards. The PMP learns whether third party cookies work from the client script's device.thirdpartycookiesenabled, which is a string rather than a boolean, so read Sharing an Answer Across Your Sites before testing that value in code of your own. |
A URL attribute that is neither a path nor an http or https address is refused and logged, so a data: or vbscript: URL never reaches the page. data-alt-url and data-action-url also accept javascript:, because running your own code inline is what they are for.
How Long the PMP Waits🔗
No attribute sets how long the PMP waits. All three times are set once when the PMP is built and are the same on every page.
| What the PMP waits for | For up to | When the time runs out |
| The cloud, when the group's shared answer is read at start up and when a visitor's answer is written to it | 1500 milliseconds | A read counts as no shared answer and the dialog is shown. A write counts as refused and the answer is kept with this site. |
| The client script to confirm that third party cookies work, from the later of the first card being answered and a client script being on the page, and only where sharing is configured and the cookie is still being tested | 3000 milliseconds (three seconds) | There is no second card and the answer stays with this site. See Sharing an Answer Across Your Sites. |
| The client script's page object to appear, before a client script is added | Until the page has loaded, and 5000 milliseconds (five seconds) at the latest | A client script is added from the cloud that served the PMP. See Integration. |
A page that still sets data-timeout gets one warning in the console saying that the attribute is no longer read, and the attribute is ignored.
The Two URL Attributes🔗
The two attributes look alike and do different jobs.
data-action-url | data-alt-url | |
| When it fires | On every answer, including the alternative | Only when the alternative button is clicked |
http or https | Added to the page as a script tag | The page navigates to it |
javascript: | Run inline | Run inline, with no navigation |
{preference} | Replaced by the answer | Not replaced |
Because data-action-url fires on the alternative as well, the alternative usually wants either a navigation or an inline call, and not both an analytics call and a navigation, since the action URL already covers the analytics half.
{preference} is replaced with a bare word, so quote it yourself inside a javascript: payload.
A Complete Tag🔗
Find Out More🔗
- Putting the tags on the page: Integration
- The three answers and how to read the one in force: Preferences
- The second card and the shared answer: Sharing an Answer Across Your Sites
- The identifier the answer leads to: 51Did (51Degrees Identifier)
- The parameters of the client script's own URL: https://cloud.51degrees.com/api-docs/index.html
- Build or check a resource key from the ready made list: https://configure.51degrees.com/YldpCKbW, and what the Configurator adds when it opens
