Topics API header demo

This page links to three sites that show how topics can be marked as observed, and then accessed, by using the headers from a `fetch()` request.

(By comparison, the demo sites linked from topics-demo.glitch.me call document.browsingTopics() from an iframe to observe and access topics.)

Run the demo

Open Chrome 111 (or above) from the command line using the following feature flags:

--enable-features=BrowsingTopics,BrowsingTopicsParameters:time_period_per_epoch/15s/max_epoch_introduction_delay/3s,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).

This site is awaiting enrollment, so enable chrome://flags/#privacy-sandbox-enrollment-overrides and add the following URLs:

https://topics-server.glitch.me,https://topics-demo.glitch.me,https://pets-animals-pets-cats.glitch.me,https://cats-cats-cats-cats.glitch.me,https://cats-pets-animals-pets.glitch.me,https://topics-fetch-demo.glitch.me,https://tennis-tennis.glitch.me,https://tennis-tennis-tennis.glitch.me,https://baseball-baseball.glitch.me,https://cricket-cricket.glitch.me

Alternatively, include the command line flag --args --disable-features=EnforcePrivacySandboxAttestations

Each of the following sites makes the same fetch() request to topics-server.glitch.me:

Open each of these in a new browser tab. Observed topics will be displayed on these pages after three epochs have passed, i.e. after around 45 seconds if you have set the epoch length to 15 seconds, though it may take longer. The observed topics are likely to be those such as 299 or 328 that correspond to an interest in sports and tennis.

If no topics are displayed, navigate repeatedly to the pages listed above, e.g. by refreshing each page (not hard-refresh).

This demo isn't anything like a real-world implementation: it only serves to show how topics can be marked as observed, and accessed, using headers.