Topics API demo

This site provides a basic demo of the Topics API.

An iframe with src=https://topics-demo.glitch.me/observe/index.html calls document.browsingTopics().

This iframe is embedded on several sites, to observe topics:

Try out the demo

  1. Run Chrome Beta 101 from the command line using the following feature flags:

    --enable-features=BrowsingTopics:time_period_per_epoch/15s,PrivacySandboxAdsAPIsOverride,PrivacySandboxSettings3,OverridePrivacySandboxSettingsLocalTesting

    Make sure that chrome://flags/#privacy-sandbox-ads-apis is disabled, since the defaults from this will override the command-line flags (in particular, the epoch duration).

  2. Open this page.
  3. Visit each of the sites listed above — it may be easier to use separate tabs for this.
  4. The most popular topics observed for the most recent three epochs will be displayed below, refreshed every second. The epoch length is set to 15 seconds using the flags above (the default length is one week).

If no topics are displayed, navigate repeatedly to the pages listed above.

The list of topics is only updated if there is a change in observed topics.

You may see unexpected results. Topics inference is not deterministic, and there is a 5% chance that a random topic is returned for each epoch.

No topics observed yet: try visiting one of the sites above.


Notes