Copyright © 2019 W3C® (MIT, ERCIM, Keio, Beihang). W3C liability, trademark and document use rules apply.
This specification defines the DNT request header field as an
HTTP mechanism for expressing a user's preference regarding tracking,
an HTML DOM property to make that expression readable by scripts, and
APIs that allow scripts to register exceptions granted by
the user. It also defines mechanisms for sites to communicate whether
and how they honor a received preference, including
well-known resources for retrieving preflight tracking status,
a media type for representing tracking status information, and the
Tk
response header field for confirming tracking status.
This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at https://www.w3.org/TR/.
This Note is a final outcome of the standardization process by the Tracking Protection Working Group for the extensions to HTTP known variously as DNT, Do Not Track, or Tracking Protection Expression.
Since its last publication as a Candidate Recommendation, there has not been sufficient deployment of these extensions (as defined) to justify further advancement, nor have there been indications of planned support among user agents, third parties, and the ecosystem at large. The working group has therefore decided to conclude its work and republish the final product as this Note, with any future addendums to be published separately.
This document was published by the Tracking Protection Working Group as a Working Group Note.
Comments regarding this document are welcome. Please send them to the GitHub repository or public-tracking@w3.org (archives).
Publication as a Working Group Note does not imply endorsement by the W3C Membership. This is a final document and may be replaced at any time. It is inappropriate to cite this document as other than a final note, with any future addendums to be published separately.
This document was produced by a group operating under the W3C Patent Policy.
This document is governed by the 1 February 2018 W3C Process Document.
The World Wide Web consists of billions of resources interconnected through the use of hypertext. Hypertext provides a simple, page-oriented view of the information provided by those resources, which can be traversed by selecting links, manipulating controls, and supplying data via forms and search dialogs.
A Web page is often composed of many information sources beyond the initial resource request, including embedded references to stylesheets, inline images, javascript, and other elements that might be automatically requested as part of the rendering or behavioral processing defined for that page. The user's experience is seamless, even if the page has been composed from the results of many network interactions with multiple servers. From the user's perspective, they are simply visiting and interacting with a single Web site: all of the technical details and protocol mechanisms used to compose a page to represent that site are hidden behind the scenes.
Web site owners often collect data regarding usage of their sites, for a variety of purposes, including what led a user to visit the site (referrals), how effective the user experience is within the site (web analytics), and the nature of who is using the site (audience segmentation). In some cases, the data collected is used to dynamically adapt content (personalization) or advertising presented to the user (targeted advertising). Data collection often occurs through insertion of embedded elements on each page, resulting in a stream of data that connects a user's activity across multiple pages. A survey of these techniques and their privacy implications can be found in [KnowPrivacy].
Users need a mechanism to express their own preferences regarding tracking that is both simple to configure and efficient when implemented. However, merely expressing a preference does not imply that all recipients will comply. In some cases, a server might be dependent on some forms of tracking and unwilling or unable to turn that off. In other cases, a server might perform only limited forms of tracking that would be acceptable to most users. Therefore, servers need mechanisms for communicating their own tracking behavior, requesting consent, and storing a user-granted exception once the user has made an informed choice.
This specification extends Hypertext Transfer Protocol (HTTP) semantics
[RFC7231] to communicate a user's tracking preference, if any, and an
origin server's tracking behavior. The DNT request header field
is defined for communicating the user's tracking preference for the
target resource. A well-known URI for a
tracking status resource and the
Tk response header field are defined for communicating the
server's tracking behavior. In addition, JavaScript APIs are defined for
enabling scripts to determine DNT status and register a user-granted
exception.
This specification does not define requirements on what a recipient needs to do to comply with a user's expressed tracking preference, except for the means by which such compliance is communicated. Instead, the tracking status provides the ability to identify a set of compliance regimes to which the server claims to comply, with the assumption being that each regime defines its own requirements on compliant behavior. For example, [TCS] is a work-in-progress that intends to define such a compliance regime.
The following terms are used as defined by HTTP/1.1 syntax [RFC7230] and semantics [RFC7231]: client, server, origin server, user agent, sender, recipient, request, response, message, intermediary, proxy, cache, uri-host, authority, header field, target resource, resource, and representation.
The following terms are used as defined by HTML [HTML51]: active document, document.domain, effective script origin, responsible document, browsing context, nested browsing context, and top-level browsing context.
Tracking is the collection of data regarding a particular user's activity across multiple distinct contexts and the retention, use, or sharing of data derived from that activity outside the context in which it occurred. A context is a set of resources that are controlled by the same party or jointly controlled by a set of parties.
A network interaction is a single HTTP request and its corresponding response(s): zero or more interim (1xx) responses and a single final (2xx-5xx) response.
A user action is a deliberate action by the user, via configuration, invocation, or selection, to initiate a network interaction. Selection of a link, submission of a form, and reloading a page are examples of user actions. User activity is any set of such user actions.
A user is a natural person who is making, or has made, use of the Web.
A party is a natural person, a legal entity, or a set of legal entities that share common owner(s), common controller(s), and a group identity that is easily discoverable by a user. Common branding or providing a list of affiliates that is available via a link from a resource where a party describes DNT practices are examples of ways to provide this discoverability.
With respect to a given user action, a first party is a party with which the user intends to interact, via one or more network interactions, as a result of making that action. Merely hovering over, muting, pausing, or closing a given piece of content does not constitute a user's intent to interact with another party.
In some cases, a resource on the Web will be jointly controlled by two or more distinct parties. Each of those parties is considered a first party if a user would reasonably expect to communicate with all of them when accessing that resource. For example, prominent co-branding on the resource might lead a user to expect that multiple parties are responsible for the content or functionality.
For any data collected as a result of one or more network interactions resulting from a user's action, a third party is any party other than that user, a first party for that user action, or a service provider acting on behalf of either that user or that first party.
Access to Web resources often involves multiple parties that might process the data received in a network interaction. For example, domain name services, network access points, content distribution networks, load balancing services, security filters, cloud platforms, and software-as-a-service providers might be a party to a given network interaction because they are contracted by either the user or the resource owner to provide the mechanisms for communication. Likewise, additional parties might be engaged after a network interaction, such as when services or contractors are used to perform specialized data analysis or records retention.
For the data received in a given network interaction, a service provider is considered to be the same party as its contractee if the service provider:
A party collects data received in a network interaction if that data remains within the party’s control after the network interaction is complete.
A party uses data if the party processes the data for any purpose other than storage or merely forwarding it to another party.
A party shares data if it transfers or provides a copy of that data to any other party.
Data is permanently de-identified when there exists a high level of confidence that no human subject of the data can be identified, directly or indirectly (e.g., via association with an identifier, user agent, or device), by that data alone or in combination with other retained or available information.
The key words must, must not, required, should, should not, recommended, may, and optional in this specification are to be interpreted as described in [RFC2119].
This specification uses the Augmented Backus-Naur Form (ABNF) notation of [RFC5234] to define network protocol syntax and WebIDL [WebIDL-20161215] to define scripting APIs. Conformance criteria and considerations regarding error handling are defined in Section 2.5 of [RFC7230].
How to throw a DOMexception and the exceptions named "InvalidStateError", "SecurityError", and "SyntaxError" are defined in [WebIDL-20161215].
Promise objects are defined in [ECMASCRIPT]; the phrases promise-call, resolve promise, reject promise, upon fulfillment, and upon rejection are used in accordance with [PromiseGuide].
The goal of this protocol is to allow a user to express their personal preference regarding tracking to each server and web application that they communicate with via HTTP, thereby allowing recipients of that preference to adjust tracking behavior accordingly or to reach a separate agreement with the user that satisfies all parties.
Key to that notion of expression is that the signal sent MUST reflect the user's preference, not the choice of some vendor, institution, site, or network-imposed mechanism outside the user's control; this applies equally to both the general preference and exceptions. The basic principle is that a tracking preference expression is only transmitted when it reflects a deliberate choice by the user. In the absence of user choice, there is no tracking preference expressed (see section 10.1 Why DNT:1 is Not Preconfigured by Default).
A user agent MUST offer users a minimum of two alternative choices
for a Do Not Track
preference: unset or
DNT:1.
A user agent MAY offer a third alternative choice: DNT:0.
If the user's choice is DNT:1 or DNT:0, the
tracking preference is enabled; otherwise, the
tracking preference is not enabled.
A user agent MUST have a default tracking preference of
unset (not enabled) unless a specific tracking preference
is implied by the user's decision to use that agent. For example, use
of a general-purpose browser would not imply a tracking preference
when invoked normally as SuperFred
, but might imply a
preference if invoked as SuperDoNotTrack
or
UltraPrivacyFred
.
Implementations of HTTP that are not under control of the user MUST NOT add, delete, or modify a tracking preference. Some controlled network environments, such as public access terminals or managed corporate intranets, might impose restrictions on the use or configuration of installed user agents, such that a user might only have access to user agents with a predetermined preference enabled. However, if a user brings their own Web-enabled device to a library or cafe with wireless Internet access, the expectation will be that their chosen user agent and personal preferences regarding Web site behavior will not be altered by the network environment (aside from blanket limitations on what resources can or cannot be accessed through that network).
An HTTP intermediary MUST NOT add, delete, or modify a tracking
preference expression in a request forwarded through that intermediary
unless the intermediary has been specifically installed or configured
to do so by the user making the request. For example, an Internet
Service Provider MUST NOT inject DNT:1 on behalf
of all users who have not expressed a preference.
User agents often include user-installable extensions, also known as add-ons or plug-ins, that are capable of modifying configurations and making network requests. From the user's perspective, these extensions are considered part of the user agent and ought to respect the user's configuration of a tracking preference. The user agent as a whole is responsible for ensuring conformance with this protocol, to the extent possible, which means the user agent core and each extension are jointly responsible for conformance. However, there is no single standard for extension interfaces. A user agent that permits such extensions SHOULD provide an appropriate mechanism for extensions to determine the user's tracking preference.
A user agent extension MUST NOT alter the tracking preference expression or its associated configuration unless the act of installing and enabling that extension is an explicit choice by the user for that tracking preference, or the extension itself complies with all of the requirements this protocol places on a user agent.
Likewise, software outside of the user agent might filter network traffic or cause a user agent's configuration to be changed. Software that alters a user agent configuration MUST adhere to the above requirements on a user agent extension. Software that filters network traffic MUST adhere to the above requirements on an HTTP intermediary.
Aside from the above requirements, we do not specify how the tracking preference choices are offered to the user or how the preference is enabled: each implementation is responsible for determining the user experience by which a tracking preference is enabled.
For example, a user might select a check-box in their user agent's
configuration, install an extension that is specifically
designed to add a tracking preference expression,
or make a choice for privacy that then implicitly includes a
tracking preference (e.g., Privacy settings: high
).
A user agent might ask the user for their preference during startup,
perhaps on first use or after an update adds the tracking protection
feature. Likewise, a user might install or configure a proxy to add
the expression to their own outgoing requests.
When a user has enabled a tracking preference, that preference needs to be expressed to all mechanisms that might perform or initiate tracking.
When enabled, a tracking preference is expressed as either:
| DNT | meaning |
|---|---|
| 1 | This user prefers not to be tracked on this request. |
| 0 | This user prefers to allow tracking on this request. |
A user agent MUST NOT send a tracking preference expression if a tracking preference is not enabled. This means that no expression is sent for each of the following cases:
In the absence of regulatory, legal, or other requirements, servers MAY interpret the lack of an expressed tracking preference as they find most appropriate for the given user, particularly when considered in light of the user's privacy expectations and cultural circumstances. Likewise, servers might make use of other preference information outside the scope of this protocol, such as site-specific user preferences or third-party registration services, to inform or adjust their behavior when no explicit preference is expressed via this protocol.
The DNT header field is a mechanism for expressing the
user's tracking preference in an HTTP request ([RFC7230]).
At most one DNT header field can be present in a valid request.
DNT-field-name = "DNT" DNT-field-value = ( "0" / "1" ) *DNT-extension
A user agent MUST NOT generate a DNT header field if the
user's tracking preference is not enabled.
A user agent MUST generate a DNT header field with a
field-value that begins with the numeric character "1" if the user's
tracking preference is enabled, their preference is for
DNT:1, and no exception has been granted for the
target resource (see section 6. User-Granted Exceptions).
A user agent MUST generate a DNT header field with a
field-value that begins with the numeric character "0" if the user's
tracking preference is enabled and their preference is for
DNT:0, or if an exception has been granted for
the target resource.
A proxy MUST NOT generate a DNT header field unless it has
been specifically installed or configured to do so by the user
making the request and adheres to the above requirements as if it
were a user agent.
GET /something/here HTTP/1.1
Host: example.com
DNT: 1
The remainder of the DNT field-value, after the initial character,
is reserved for future extensions. DNT extensions can only be
transmitted when a tracking preference is enabled.
The extension syntax is restricted to visible ASCII characters that
can be parsed as a single word in HTTP and safely embedded in a
JSON string without further encoding
(section 7.5 Tracking Status Representation).
DNT-extension = %x21 / %x23-2B / %x2D-5B / %x5D-7E
; excludes CTL, SP, DQUOTE, comma, backslash
For example, additional characters might indicate modifiers to the
main preference expressed by the first digit, such that the main
preference will be understood if the recipient does not understand
the extension. Hence, a field-value of "1xyz" can be thought of
as do not track, but if you understand the refinements defined
by x, y, or z, then adjust my preferences according to those
refinements.
User agents that do not implement DNT extensions MUST NOT send
DNT-extension characters in the DNT field-value.
Servers that do not implement DNT extensions SHOULD ignore
anything beyond the first character.
This DNT-extension feature is speculative because no known extensions have been defined; implementers that do not read this specification are likely to assume that DNT only has the fixed values of "0" or "1". Furthermore, the potential benefits of this mechanism are unclear given that extension information could be supplied using separate request header fields. Inappropriate extensions to the "1" value might cause the user's requests to be more easily fingerprinted.
The Navigator.doNotTrack property enables
a client-side script with read access to the
Navigator object
[HTML51] to determine what DNT header field value would be
sent to the effective script origin, taking into account the
user's general preference (if any) and user-granted exceptions
applicable to the target domain when referenced by the
active document's top-level browsing context.
The value is null if no DNT header field would be
sent (e.g., because a tracking preference is not enabled
and no user-granted exception is applicable);
otherwise, the value is a string beginning with "0" or "1",
possibly followed by DNT-extension characters.
Specifically, the value of Navigator.doNotTrack for a given
script is either null or the string value that would be
sent in a DNT field-value
(section 5.2 DNT Header Field for HTTP Requests)
in a request to a target resource at the
effective script origin (the current document.domain of
the script's responsible document) when that request is due to
an embedded reference from this site (the document.domain of
the top-level browsing context's active document).
Ideally, the value of Navigator.doNotTrack ought to reflect
the current set of user-granted exceptions in effect when the
attribute is read. In practice, however, the value might only reflect
the value that was in effect when the script was initiated.
A user's tracking preference is intended to apply in general, regardless of the protocols being used for Internet communication. However, it is beyond the scope of this specification to define how a user's tracking preference might be communicated via protocols other than HTTP.
Content providers might wish to prompt visitors to opt in
to
tracking for behavioral advertising or similar purposes when they
arrive with the Do Not Track setting enabled. However, granting an
exception in one context (e.g., while browsing a news site) does not
imply that exception is applicable to other contexts (e.g., browsing
an unrelated medical site). Furthermore, users might wish to view or
edit all the exceptions they've granted in a single, consistent user
interface, rather than managing preferences in a different way on
every content provider or tracker's privacy page.
A user-granted exception is the record of a decision by
the user to grant consent for tracking (DNT:0) on future
requests from a given site to a set of target domains.
Both site and target are scoped by domain, similar to the existing
domain scope of cookies
(Section 5.3.1
of [HTML51]), to avoid prompting the user for every subdomain of a
site and every target resource that might be referenced.
A client-side database can be used for persistent storage of
user-granted exceptions, such that permission to send DNT:0
is obtained by a site and stored via a JavaScript API. However, we
only define the API (below); the choice of storage mechanism is left
to each implementation. In comparison to the use of cookies to manage
consent, an exception database and APIs provide more transparency and
better user control, while also providing better persistence of those
exceptions for sites.
There are three domain concepts involved in the processing of user-granted exceptions:
A user-granted exception is site-specific if the exception is limited to requests embedded in, or referred by, a given site domain; otherwise, the exception is web-wide because it applies to the target domain regardless of the referring site. For example, a user might wish to grant a certain target domain a web-wide exception for the purpose of audience measurement across multiple sites, perhaps in exchange for some incentive.
When asking for consent to record a site-specific exception, a site might make some claims regarding limitations on the actions and behavior of the known third parties that it references. Such a site might wish to restrict its site-specific exceptions to only target domains for which those claims have been verified. (For example, consider the dilemma of a site that has trusted advertisers and analytics providers, along with some less trusted mashed-up content that might reference other sites). For this reason, site-specific exceptions can be limited to the script domain, limited to a named set of target domains, or be applicable to any target domain ("*").
It is expected that a site will explain to the user, in its online
content, the need for an exception and the consequences of granting or
denying that exception. Upon receipt of an informed consent from the
user, a script operating on the site's page is expected to
promise-call the Navigator.storeTrackingException API using
parameters consistent with the consent granted by the user.
A site MUST ensure that a call to store an exception reflects the user's intention to grant an exception at the time of that call. It is the sole responsibility of the site to determine that a call to record an exception reflects the user's informed consent at the time of that call.
Third party target domains that might wish to receive a user-granted exception often do not have the ability to invoke an interactive JavaScript presence on a page (for example, those that provide only images or "tracking pixels"). They cannot request an exception under these circumstances, either because a script is needed to make the API call or it requires interaction to ensure the user is informed and to receive an indication of their consent. In general, this process of informing, getting consent, and calling the API is not expected within page elements where such trackers are invoked.
A first party site's page (the top-level browsing context) might be used to obtain consent for multiple parties; e.g., using multiple iframe elements containing scripts that can convey information about each party's policies and obtain specific consent for each party. In this case, the effective script origin might be different from the site for which consent is being granted.
Alternatively, a third party might encourage the user to visit their own site directly in order to engage in a consent dialog and make use of the API to store a web-wide exception.
A site can request an exception be stored even when the user's
general preference is not enabled. This permits the sending of
DNT only for target resources for which an expressed
preference is desired. Stored exceptions could affect which
preference is transmitted if a user later chooses to configure a
general tracking preference.
A user agent might not store the exception immediately, possibly because it is allowing the user to confirm. Even though the site has acquired the user's informed consent before calling the store API, it is possible that the user will change their mind, allow the storing of an exception to proceed but later remove it, or perhaps deny the storage by prior configuration. Nonetheless, at the time of a call, the site has acquired the user's consent and can proceed on that basis whether or not the user agent has stored an exception.
A site can promise-call the Navigator.trackingExceptionExists
API to enquire whether a set of exceptions has been granted and stands
in the user agent. If the promise resolves to false (indicating the
exception set has expired, been deleted, or has not yet been stored),
the user can be asked again for consent.
A user agent is expected to query the exceptions database at the time of a request in order to determine what value (if any) to send as the user's tracking preference.
DNT:0 preference is sent,
otherwise the user’s general preference is sent (if any).A pair of duplets [A,B] and [X,Y] match if A matches X and B matches Y. A pair of values A and X match if and only if one of the following is true:
For example, a user might grant an exception for metrics.example.net
to track their activity on news.example.com and weather.example.com,
but not on medical.example.org. If the document at
http://news.example.com/news/story/2098373.html
has embedded references to
http://metrics.example.net/1x1.gif and
http://weather.example.com/widget.js, the
site domain for those references is
news.example.com and the target domains are
metrics.example.net and
weather.example.com, respectively.
A user agent MAY choose to disregard a user-granted exception when the target resource does not have a corresponding tracking status resource with a valid tracking status representation, since that would imply the target resource does not conform to this specification.
A site that stores exceptions is also expected to enable revocation
of those exceptions. The Navigator.removeTrackingException API
can be promise-called by a script to remove all exceptions applicable
to that site.
A site MAY monitor for changes to its user-granted exceptions. If a user revokes consent by deleting an exception, the site MUST respect that revocation, though it MAY ask again for a new exception. In other words, a site MUST NOT resurrect a deleted exception without first interacting with and receiving new consent from the user.
When a site has obtained consent for a
user-granted exception, a script running within an active
browsing context or nested browsing context of that
site can promise-call
Navigator.storeTrackingException
to store one or more tracking exceptions.
A TrackingExData object is
supplied as a parameter to define the exception's scope (the set of
[site, target] duplets that encompass the granted exception)
and optional information to be stored for that exception.
The call returns a promise which either resolves to a
TrackingExResult or is rejected with
a DOMException identifying the reason for the failure.
dictionaryTrackingExData{ DOMString?site; sequence<DOMString>?targets; DOMString?name; DOMString?explanation; DOMString?details; long?maxAge; }; dictionaryTrackingExResult{ booleanisSiteWide; };
Navigator.storeTrackingException passes a
TrackingExData object. A user agent MUST ignore unknown
properties of the TrackingExData object (for future
extensibility). The following OPTIONAL properties are defined:
sitesite is
undefined, null, or the empty string, the exception's referring
domain scope defaults to the script domain.site is
defined and equal to "*", the exception is
intended to be web-wide for the set of
targets.
A user agent MUST reject the promise with the
DOMException named "SecurityError" if both
site and
any of the targets
are "*".site
that is treated in the same way as the domain parameter to
cookies [RFC6265], allowing subdomains to be included with
the prefix "*.". The value
can be set to a fully-qualified right-hand segment of the
document host name, up to one level below TLD.targetstargets
is undefined or null, the user-granted
exception to be stored is [site, *], meaning
that the exception applies to all domains referenced by the
site.targets
is an empty array, the user-granted exception to be stored is
[site, script domain], meaning that
the exception applies only to resources that share the same
domain as the effective script origin.targets
array, a user-granted exception to be stored is the duplet
[site, domain].namename is a
user-readable string for naming the exception, usually
descriptive of the targets or their intended purpose for this
site, encoded as UTF-8 and appropriate for the natural language(s)
used to inform consent for the exception.explanationexplanation is a
user-readable short explanation of the granted exception,
encoded as UTF-8 and in the same natural language(s)
used to inform consent for the exception.detailsdetails is a URI
reference at which further information about the granted
exception can be found [RFC3986].maxAgemaxAge is a positive
number of seconds indicating the maximum lifetime of the grant:
maxAge is supplied and not null, empty, or
negative, the user agent MUST remove the stored exception
no later than the specified number of seconds after being
stored.maxAge is not supplied, the user agent
MAY retain the stored grant indefinitely.
The properties name,
explanation, and
details are provided by the
caller for the sake of potential user interfaces.
If a user agent presents these properties to the user, it ought to
be clear that they are provided for informational value and are
less important than the exception's technical effect.
In addition to the data above, a user agent might also store ambient information about the call, such as the URI associated with the top-level browsing context, the effective script origin, a current timestamp, or other information potentially obtained from applicable tracking status resources.
The calling script domain MUST have a
site-wide tracking status resource with a valid
tracking status representation
that includes a policy property.
This allows a user agent to obtain and possibly store additional
information about the caller’s controller and tracking
policies at the time an exception is granted.
A user agent MAY reject the promise with a DOMException named "InvalidStateError" if it cannot determine the effective script origin or if the site corresponding to that origin does not have a site-wide tracking status resource with a valid tracking status representation.
For each site-specific exception being stored, a user agent MUST NOT store the duplets and MUST reject the promise with a DOMException named "SecurityError" if the script would not be able to set a cookie on that duplet's referring domain scope following the cookie domain rules [RFC6265].
For example, a script on www.foo.bar.example.com can set
the site as
"bar.example.com" or
"example.com", but not to
"something.else.example.com" or "com".
For each web-wide exception being stored, a user agent MUST NOT store the duplets and MUST reject the promise with a DOMException named "SecurityError" if the script would not be able to set a cookie on that target domain following the cookie domain rules [RFC6265]. This limits storing of a web-wide exception to scripts that share the same domain scope as the exception targets, but allows such scripts to be embedded within iframes of a common consent portal.
For any other failure, such as an incorrectly formatted parameter in
the TrackingExData, the user agent MUST NOT store
any of the target duplets in the database and MUST reject the promise
with a DOMException named "SyntaxError".
Upon fulfillment, the user agent has added to its local
database one or more site-pair duplets [site, target], each
indicating that a request from that site domain to the
target domain will include DNT:0 regardless of the
user's general tracking preference. The fulfilled promise object
contains the following TrackingExResult attribute: