How to Be TCF/GDPR Compliant for Ad Types
How consent is passed for ad types that do not use ad-provider.js: In-Stream VAST, Direct Link, Email Clicks, and RTB.
Most ad types use ad-provider.js, which automatically processes the TC String to determine whether consent has been given. When an ad request is generated, ad-provider.js checks for the presence of a CMP. If a CMP is detected, the resulting TC String is analyzed to determine the end user's consent. If consent is granted, the ad is displayed. If consent is not given, the ad is shown using only limited information. Four ad types do not use ad-provider.js, so the consent parameters must be passed explicitly:
In-Stream VAST
Direct Link
Email Clicks
RTB
In-Stream VAST, Direct Link and Email Clicks pass them in the ad tag URL. RTB passes them in the bid request.
In-Stream VAST, Direct Link and Email Clicks
The In-Stream VAST tag currently looks like this:
https://s.adservingdomain.com/v1/vast.php?idzone=123456This endpoint provides a response in the VAST XML format. The vast.php endpoint may set cookies and the tracker URLs within the VAST response may also set cookies as well. The Ad Server processes information in the cookies from this endpoint and on tracker URLs and sets them depending on TCF parameters.
The Direct Link tag currently looks like this:
<a href="https://s.adservingdomain.com/v1/d.php?z=123456" target="_blank">Click Here!</a>The Email Clicks tag currently looks like this:
Two parameters enable the use of consent to determine whether cookies should be set. These parameters can be passed to the VAST, Direct Link and Email Clicks endpoints, in the same way described in What is a TC String:
gdpr: contains a flag (0 or 1) that indicates whether GDPR and ePrivacy apply.gdpr_consent: contains the TC String (base64url-encoded string).
The endpoint with parameters would look like this:
In-Stream VAST
Direct Link
Email Clicks
Retrieving and Passing TCF Parameter Values
TCF v2 requires Publishers to implement a Consent Management Platform (CMP) on their website. There are many different CMPs available, each with its own specific instructions for installation and setup on the Publisher's site. CMPs have to provide an API that is defined by the TCF standard. This API should be used to retrieve the parameters and pass them into the ad tag URL. These values should come from TCData object that comes from API:
gdpr:tcData.gdprAppliesgdpr_consent:tcData.tcString
In-Stream VAST Example Code
The example below shows how to use __tcfapi together with FluidPlayer to extract these parameters and serve VAST ads.
Include the scripts for CMP in the
<head>. This example is from OneTrust; different CMPs will require different code:
Include the video elements that FluidPlayer will be initialized on.
Provide the TCFListener object. This is player-agnostic, and could be used for different implementations (uses
__tcfapias defined in the TCF standard).
Use the TCFListener to get the VAST tag with TCF parameters and initialize the players (this example is specific to FluidPlayer).
Direct Link Example Code
The example below shows how to use __tcfapi to extract these parameters and update a Direct Link tag to include consent information.
Include the scripts for CMP in the
<head>. This example is from OneTrust, different CMPs will require different code here:
Include Direct Link Tag
Provide the TCFListener object. This is implementation-agnostic and can be used in various contexts, as it uses the
__tcfapidefined in the TCF standard.
Use the TCFListener to get the Direct Link tag updated with TCF parameters and change the link.
Email Clicks
Email content cannot run JavaScript, so no CMP is available at the point the recipient clicks. The gdpr and gdpr_consent values must already be in the link when the email is sent.
Add them when the email is generated, using your mail platform's personalisation fields and the consent you hold for each recipient:
If GDPR and ePrivacy do not apply to the recipient, pass gdpr=0 and omit gdpr_consent.
RTB
For OpenRTB the TCF string can be sent via the Bid Request. The field depends on the ORTB version. See the IAB Tech Lab OpenRTB GDPR advisory for details.
The Ad Server supports ORTB v2.4 and v2.5, which carry the GDPR and TCF information in the same fields:
regs.ext.gdpr:0/1user.ext.consent:CPAoZRHPArq3hBcADBENBJCgAAAAAAAAAAqIHKQAAOUgAAAA
The Ad Server supports only TCF version 2 for RTB. A version 1 string throws an exception and the request is discarded.
The consent string can be decoded and validated with the IAB TCF decoder.
Last updated
Was this helpful?

