Manual marking (v2)
This page describes the v2 banner. For the v3 banner, see Mark scripts.
This page explains how to mark a <script> or an <iframe> by hand, so that the v2 banner blocks it until consent.
Who this is for
This page is for you if you installed the v2 banner with the HTML snippet and want to block vendor scripts by hand.
Prerequisites
Before you start, check that:
- the site loads the v2 banner;
- you know the IAB purpose ids and the vendor id that the script requires. A custom vendor id looks like
d116.
Steps
- Add the
data-managed="as-oil"attribute to the element. - Change the script's
typeattribute toas-oil. The browser does not recognize the type and does not run the script. - If the script is not plain JavaScript, add
data-typewith the original type, for examplemodule. - If the script is in a separate file, add
data-srcwith the path to the.jsfile. - Add the requirement attributes (table below).
| Attribute | What it requires |
|---|---|
data-purposes | The IAB purpose ids, comma-separated |
data-legints | The IAB purpose ids with legitimate interest as legal basis |
data-special-features | The IAB special feature ids |
data-iab-vendor | The IAB vendor id |
data-custom-vendor | The custom vendor id |
The element is activated only when the visitor meets all the requirements present. The v2 banner reads them together, as an AND.
A missing attribute requires nothing. An attribute that is present but empty behaves differently in the two banners, except the vendor ones.
| Attribute present but empty | v2 banner | v3 banner |
|---|---|---|
data-purposes="" | Requires all purposes, IAB and custom | The script stays blocked |
data-legints="" | The script stays blocked. The v2 banner requires legitimate interest for purposes 2 to 10, but never grants it to purposes 3, 4, 5 and 6 | The script stays blocked |
data-special-features="" | Requires all special features | The script stays blocked |
data-iab-vendor="" and data-custom-vendor="" | Requires nothing | Requires nothing |
TCF 2.2 rules do not allow legitimate interest for IAB purposes 3, 4, 5 and 6: for these only consent applies. See Understanding the upcoming Transparency & Consent Framework v2.2 by IAB Europe.
This example blocks a script until the visitor consents to purposes 1, 2 and 4 and to vendor d116.
<script data-managed="as-oil"
data-type="text/javascript"
data-src="path/to/the/script.js"
data-purposes="1,2,4"
data-custom-vendor="d116"
type="as-oil"></script>
The v2 banner also handles <iframe>s. For an iframe the v2 banner restores the src, href, title, display and type attributes, copying them from data-src, data-href, data-title, data-display and data-type.
Verify
- Open the page without giving consent. Check that the script does not run.
- In the preferences panel, allow the required purposes and vendor, and save.
- Reload the page and check that the script runs. If you had already made a choice on the banner, the v2 banner unblocks the scripts only after the reload.
Common problems
The most frequent issues:
- The script runs right away: check that
typeisas-oiland thatdata-managedisas-oil; - The script never runs: check that the ids in the requirements exist in the web space. With the v2 banner, an id that does not exist blocks the script;
- After the switch to the v3 banner the script stays blocked: the element has an empty
data-purposes,data-legintsordata-special-features, or the web space does not have the preemptive blocking add-on. See Backward compatibility with the v2 banner.
Last updated: 10/11/2026.