Sec-Browsing-Topics

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

Non-standard: This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.

Warning: This feature is currently opposed by two browser vendors. See the Standards positions section below for details of opposition.

Note: An Enrollment process is required to use this feature in your applications.

The Sec-Browsing-Topics request header sends the selected topics for the current user along with the associated request, which are used by an ad tech platform to choose a personalized ad to display.

If the calling site does not have the Topics API included in a successful privacy sandbox enrollment process, attempting to create or modify Sec-Browsing-Topics fails silently, and any existing Sec-Browsing-Topics header is deleted.

See Using the Topics API for more details.

Header type Request header
Forbidden header name yes (prefix Sec-)

Syntax

http
Sec-Browsing-Topics: <array-of-observed-topics>

Directives

A JSON object representing an array of up to three objects representing the current user's selected topics for the last three epochs. Each object contains the following properties:

configVersion

A string identifying the algorithm (other than the model part) used to calculate the topic.

modelVersion

A string representing the model used to classify a string (such as a web page's hostname) into topic IDs.

taxonomyVersion

A string representing the taxonomy version used.

topic

A number representing the ID of the topic, which can be used by the browser to retrieve the topic from the taxonomy (see an example taxonomy of interests).

version

The configVersion, modelVersion, and taxonomyVersion, concatenated with colons (:) between each.

Examples

The exact property values may vary by browser implementation. An example header from Chrome might look as follows:

http
Sec-Browsing-Topics: [{configVersion: "chrome.1", modelVersion: "1", taxonomyVersion: "1", topic: 43, version: "chrome.1:1:1"}]

Specifications

This feature is not part of an official standard, although it is specified in the Topics API Unofficial Proposal Draft.

Browser compatibility

BCD tables only load in the browser

See also