Skip to main content

Manual marking (v2)

If your site uses the v3 banner

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​

  1. Add the data-managed="as-oil" attribute to the element.
  2. Change the script's type attribute to as-oil. The browser does not recognize the type and does not run the script.
  3. If the script is not plain JavaScript, add data-type with the original type, for example module.
  4. If the script is in a separate file, add data-src with the path to the .js file.
  5. Add the requirement attributes (table below).
AttributeWhat it requires
data-purposesThe IAB purpose ids, comma-separated
data-legintsThe IAB purpose ids with legitimate interest as legal basis
data-special-featuresThe IAB special feature ids
data-iab-vendorThe IAB vendor id
data-custom-vendorThe 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 emptyv2 bannerv3 banner
data-purposes=""Requires all purposes, IAB and customThe 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 6The script stays blocked
data-special-features=""Requires all special featuresThe script stays blocked
data-iab-vendor="" and data-custom-vendor=""Requires nothingRequires 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​

  1. Open the page without giving consent. Check that the script does not run.
  2. In the preferences panel, allow the required purposes and vendor, and save.
  3. 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 type is as-oil and that data-managed is as-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-legints or data-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.