document.browsingTopics() is a deprecated, non-standard instance method from the Topics API. It returns a Promise of topic objects for interest-based advertising. Learn the return shape, skipObservation, enrollment requirements, why MDN recommends HTTP headers instead, and five try-it labs for educational reference.
01
Kind
Instance method
02
Returns
Promise → topics[]
03
Status
Deprecated
04
Also
Non-standard
05
Option
skipObservation
06
Requires
Enrollment
Fundamentals
Introduction
Third-party cookies are being phased out in many browsers. Google’s Privacy Sandbox proposed alternatives for ad targeting, including the Topics API—a way to share coarse interest categories (topics) instead of cross-site tracking cookies.
MDN: Document.browsingTopics() returns a promise that fulfills with an array of objects representing the top topics for the user, one from each of the last three epochs. By default, calling it also records the current page visit as observed so the page hostname can be used in future topic calculation.
⚠️
Deprecated & non-standard (MDN)
This tutorial explains the API for learning and legacy code review only. MDN does not recommend using it in production. Prefer Topics HTTP headers when available, and avoid building new features on this method.
0–3 epoch topic(s)
[{ topic: 43, version: "chrome.1:1:1", ... }]
—or— browsingTopics not available / not enrolled
How It Works
MDN: up to three objects, one per recent epoch. Empty or error is normal outside enrolled Chrome contexts.
Example 2 — Feature Detection
Check whether the method exists before calling it.
JavaScript
if (typeof document.browsingTopics === "function") {
console.log("browsingTopics API present (may still require enrollment)");
} else {
console.log("browsingTopics not supported in this browser");
}
Document.browsingTopics() is Deprecated and Non-standard on MDN. Logos use the shared browser-image-sprite.png sprite. Historically tied to Chrome Privacy Sandbox; most browsers do not implement it. Do not rely on it in new code.
✓ Deprecated · Non-standard
Document.browsingTopics()
Topics API — deprecated Privacy Sandbox method. Educational reference only.
LimitedChrome-era only
Google ChromeHistorical / enrollment
Partial
Microsoft EdgeNot supported
No
Mozilla FirefoxOpposed / not supported
No
Apple SafariNot supported
No
OperaNot supported
No
Internet ExplorerNot supported
No
browsingTopics()Deprecated
Bottom line: Do not use browsingTopics() in new projects. Prefer standard privacy-preserving patterns and avoid deprecated ad-tech APIs.
Wrap Up
Conclusion
document.browsingTopics() was part of the Topics API for interest-based advertising. MDN marks it deprecated and non-standard. It returns a Promise of topic objects and may observe the current page by default.
Feature-detect before calling (legacy maintenance)
Wrap calls in try/catch for policy/enrollment errors
Use skipObservation: true when you must not observe the page
Prefer Topics HTTP headers when MDN says they are available
Plan migration away from deprecated Privacy Sandbox JS APIs
❌ Don’t
Build new products on browsingTopics() (MDN deprecated)
Assume enrollment or Chrome support equals wide browser support
Ignore Permissions Policy browsing-topics blocks
Confuse topics with personal identifiers or precise tracking
Skip user privacy review for ad-tech integrations
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about browsingTopics()
Deprecated Topics API — educational reference, not a build target.
5
Core concepts
📝01
Returns
Promise
topics[]
⚠️02
Status
deprecated
MDN
🚫03
Standard
no
Draft
👁04
Observe
default on
skip opt
🛡05
Enroll
required
Sandbox
❓ Frequently Asked Questions
It returns a Promise that fulfills with an array of up to three topic objects — one from each of the last three epochs — representing the user's top topics for interest-based advertising (MDN).
MDN marks Document.browsingTopics() as Deprecated and Non-standard. It is not recommended for new production code. Two browser vendors oppose the feature.
A Promise resolving to an array of topic objects. Each object includes topic (ID number), configVersion, modelVersion, taxonomyVersion, and version (MDN).
An optional boolean in the options object. When true, the browser does not record the current page visit as observed for topics calculation. Default is false (MDN).
MDN: if the Topics API is blocked by a browsing-topics Permissions Policy, or if the site is not enrolled in the Privacy Sandbox enrollment process.
MDN advises preferring Topics API HTTP header features when you can modify headers, and falling back to browsingTopics() only when headers cannot be changed.
Did you know?
MDN notes that browsingTopics() does not use HTTP headers to send topics or mark observation—unlike other Topics API features—but HTTP header-based approaches are more performant and should be preferred when you can modify headers.