Enabling Auto Blocking
To enable the Auto Blocking feature an additional script needs to be loaded along with the main loader.js script:
<script src="https://web.cmp.usercentrics.eu/modules/autoblocker.js"></script>
<script
id="usercentrics-cmp"
src="https://web.cmp.usercentrics.eu/ui/loader.js"
data-settings-id="y05NPaJsbGnT2v"
async
></script>
Understanding Auto Blocking
Identifying services
Auto blocking relies on information collected by the scanner. The scanner essentially detects third-party server calls and logs these as data processing services.
Services that have been added to the Admin that match the findings of the scanner are compiled into a list of instructions which essentially lists the services by service ID and then a method to recognize the element. These are in order of priority:
- Tag
id
- Tag
src
- hash (Essentially a resource is encoded and compared to the previously encoded resource.)
The file will look similar to this:
{
"nodes": [
{
"serviceIds": [
"H1Vl5NidjWX"
],
"hash": "4013037056144",
"src": "https://web.cmp.usercentrics-sandbox.eu/ui/loader.js",
"id": "usercentrics-cmp"
},
{
"serviceIds": [
"H1Vl5NidjWX"
],
"hash": "3809307713796",
"src": "https://web.cmp.usercentrics-sandbox.eu/modules/autoblocker.js"
},
{
"serviceIds": [
"BJz7qNsdj-7",
"H1PKqNodoWQ",
"rw4DyFQcg6s3-W"
],
"hash": "13409490399530",
"src": "https://www.youtube-nocookie.com/embed/bp612TdEK1c"
},
{
"serviceIds": [
"BJz7qNsdj-7",
"9V8bg4D63",
"S1_9Vsuj-Q"
],
"hash": "16595230151636",
"src": "https://www.youtube.com/embed/tROVq1lW0IU?si=VMdGX-0tbe-6Ed7d"
}
]
}
Please note
- Multiple resources can share the same service ID. All these resources are (un)blocked when the corresponding service is (dis)allowed.
- A single resource can also have multiple service IDs. For this resource to be allowed to load, all these services must be consented to.
- Unknown services, or services that aren't added to the CMP are not added to this checkfile.
Blocking services prior consent
When an element on the website matches an entry in the checkfile it is added to the DOM pre-marked up; i.e.:
- Scripts have their
type
set to "text/plain" to load it, but prevent it from executing. - Iframes and images have their
src
replaced withdata-uc-src
to prevent the resource from being fetched and loaded.
For all elements the data-uc-hash
attribute is added to allow the CMP to identify which elements belong to what service, and thus whether it is allowed to load.
Overriding the Auto Blocking feature
It's possible to prevent the Auto Blocking feature from blocking a resource by manually adding the data-uc-allowed="true"
attribute. This ensures that the Auto Blocking feature won't block the resource.
You can combine the use of the Auto Blocking feature and manual mark up.
The Auto Blocking feature respects mark up and checks to see if the element is already marked up (the script has type="text/plain"
or the generic element doesn't have a src
), if this is the case the element is disregared.
Comments
0 comments
Please sign in to leave a comment.