Privacy & Cookies
Author: Anete Jodzevica 15 minute read
#Ad Monetization #Advertising Industry Trends #Google Update
All Categories >Privacy & Cookies > A Guide to Google Topics API

A Guide to Google Topics API

Google Topics API provides a privacy-focused solution that aims to balance the interests of users, publishers, and advertisers in delivering personalized content while respecting privacy standards. For more than two decades, the web relied on cross-site cookies. Topics API emerges as a new chapter for privacy-conscious and effective ad targeting, as we bid farewell to third-party cookies. 

Read and learn more about Google Topics API and how it can reshape the future of digital advertising!

What is Google Topics API?

The Google Topics API is a part of the Privacy Sandbox initiative, designed to address privacy concerns arising from the phasing out of third-party cookies

Google Topics API marks a shift towards a more privacy-conscious approach, enabling the browser to recognize and record user interests from their web activity. Topics are periodically refreshed, calculated during defined epochs, and returned to callers, providing up to three randomly selected topics for targeted advertising. 

How is Topics API different from third-party cookies?

Historically, user browsing behavior was tracked across sites using third-party cookies to figure out topics of interest. This method raised privacy concerns, leading to regulations and the eventual phase-out of third-party cookies.

  • Third-party cookies were small text files stored on users’ browsers to track their browsing across different websites. 

In contrast, the Google Topics API is a more privacy-conscious model. 

Instead of relying on centralized third-party tracking, the Topics API allows browsers to identify and record users’ topics of interest based on their web activity. This information is stored locally on the user’s device, reducing the risk of third-party data access and providing users greater control over their data. 

The API grants ad tech platforms access to a user’s topics of interest while maintaining confidentiality regarding specific browsing history details. 

What is Google Privacy Sandbox?

The Privacy Sandbox initiative aims to create technologies that both protect people’s privacy online and give companies and developers tools to build thriving digital businesses.

The Privacy Sandbox has 2 core goals:

  • Phase out support for third-party cookies when new solutions are in place.
  • Reduce cross-site and cross-app tracking while helping to keep online content and services free for all.

Topics API privacy and security considerations

The Privacy Sandbox APIs generally represent a shift for web browsers, empowering them to take a proactive role in safeguarding user privacy. Instead of relying on limited tools and protections, these APIs enable the user’s browser to locally and independently protect their information during web browsing.

Here are the main 7 Google Topics API aspects that help to ensure user data privacy:

  • Topics API stores topics of interest locally on the user’s device, reducing the reliance on centralized servers and providing a more private environment for user data.
  • The API allows ad tech platforms (callers) to access a user’s topics of interest without revealing specific details about their browsing history. This limited sharing ensures that only relevant information is exposed, enhancing user privacy.
  • Users have increased control over their data. They can block specific topics or turn off the Topics API entirely if they choose not to participate. 
  • Websites can implement opt-out mechanisms to exclude specific users or pages from Topics API calculations. 
  • When returning topics to callers, the API randomizes the selection from the user’s top topics for a specific time frame. This randomization adds an extra layer of privacy by making it harder for callers to identify users solely based on their topics.
  • Last but not least, Google Topics API uses a publicly maintained taxonomy–a hierarchical categorization of topics. This taxonomy avoids sensitive topics and can evolve over time with input from the web ecosystem, maintaining a balance between relevance and user privacy.

How the Topics API Works?

The Topics API is designed to provide human-readable and understandable topics, enabling meaningful user controls. Google’s Topic API functions in 3 primary steps for categorizing and using website data:

  1. Topic labeling. The API assigns high-level topic labels to websites based on their content.

For example, a sports website would be categorized under the topic “sports.” 

  1. Topic collection and sharing. The browser tracks the most common topics from the user’s browsing history. It then shares these topics (adding one new topic per week) with websites the user visits. 
  1. Providing access to current topics. It offers mechanisms to access the user’s current topics of interest, aiding advertisers in selecting relevant ads.

The topics are chosen from a human-curated, public list containing about 469 topics. This limited taxonomy helps minimize the risk of fingerprinting and ensures privacy. 

How does Topics API work?

Note: Chrome’s topics list excludes sensitive categories (e.g., race, sexual orientation, religion, etc.)

What are Epochs in Topics API?

The Topics API analyzes user browsing activity over a defined time frame, known as an “epoch,” currently set to one week in Chrome. Each user’s epochs are unique and start at a random time. 

For each epoch, the API selects a topic randomly from the user’s top five topics of that period, which is sent to the API caller. This ensures that the information used for ad targeting remains relevant and recent.

Note: There’s a 5% chance that a topic for an epoch is randomly chosen from all possible topics in the taxonomy, enhancing privacy.

How are topics selected?

Here are the 5 key points to better showcase how topics are chosen: 

  1. Topics are calculated based on the user’s browsing activity within each epoch.
  1. A caller (e.g., an adtech platform) observes topics for a user during their browsing.
  1. The API returns up to three topics for a caller based on the user’s top five topics for that week.

Note: Random topics are included to make up the top five if fewer than five topics were observed for a user during an epoch.

  1. The topics returned to the caller are randomly selected from the user’s top five topics. 
  1. Topics for a user are recalculated for a caller based on the top-level site. Meaning that a caller will likely get different topics for a user on different top-level sites.

Can you control or opt-out of Topics API?

Yes, both users and websites have control and opt-out mechanisms for the Topics API.

Users have the option to control their topics and can choose to opt out of the Topics API entirely.

For example, if a user opts out, their topics won’t be defined or shared with external parties, disabling the targeting mechanism. However, this may result in users seeing less relevant ads.

Websites have the option to opt out of Topics API calculations for user interests on their pages.

  • Websites can include the “permissions policy” response header with “browsing topics=empty brackets” to opt out of Topics API calculations for all users on a page.

Topics API for Publishers, Advertisers, and Users

Topics API provides a privacy-focused solution that aims to balance the interests of users, publishers, and advertisers in delivering personalized content while respecting privacy standards.

Thus, users gain control, publishers have a new categorization mechanism, and advertisers can leverage user interests for more effective targeting.


For users, Topics API represents an advancement in privacy with personalized ads. 

  • The Topics API operates as an improvement over methods like FLoC, reducing potential fingerprinting surfaces.
  • User topics, reflecting their interests, are updated weekly, minimizing the amount of shared information.
  • Users gain more control over their topics, with the ability to opt out of the Topics API entirely, enhancing privacy. 


Here are the 2 main benefits of Topics API for publishers:

  • Topics API offers a way to categorize user interests without relying on third-party cookies.
  • Large publishers with diverse content may benefit more as they can use broad topics for ad targeting across various subjects.

However, smaller niche publishers might face challenges, and Google is expected to address this as the impact becomes clearer post the depreciation of third-party cookies.


Advertisers, on the other hand, gain utility with the new Topics API taxonomy. 

  • Advertisers benefit from the Topics API through a new taxonomy, allowing personalized ad targeting based on user interests.
  • Advertisers can use Topics API signals for upper-funnel advertising or personalize ads for retargeting.

Note: The utility for advertisers depends on the adoption rate among publishers and users–higher participation leads to more effective ad targeting.

What Is Topic API Caller?

Topic API callers refer to third-party entities or systems, such as ad tech platforms, that interact with the Topics API to access information about a user’s interests. 

As already mentioned before, with Topics API, the browser observes and records topics that appear to be of interest to the user, based on their browsing activity. The API can then give API callers access to a user’s topics of interest without revealing additional information about the user’s browsing activity.

From Cookies to Google FLoC to Topics API

Note: The development of FLoC has stopped. Topics is the new proposal in the Privacy Sandbox to preserve privacy while showing relevant content and ads.

Federated Learning of Cohorts (FLoC) was tested in 2021. FLoC was designed to replace cookies and infer user interests based on their browsing and group them with people who had similar browsing habits. 

However, during testing, it became apparent that FLoC could act as a surface for fingerprinting. 

Meaning that the data shared with advertisers could be combined with other information sources (e.g., IP addresses) in order to track an individual user. Additionally, its taxonomy was deemed far too granular, with over 30,000 segments included. 

The main concerns were that updates to a user’s FloC data could create a historical trail of data that would provide exponentially more information about a user until they could be identified. 

Thus, Topics API has been designed with this feedback in mind. It aims to explore other ways to support interest-based advertising, with improved transparency, stronger privacy and a different approach for sensitive categories.

What was Google FLoC?

Google FLoC was a privacy-focused initiative introduced by Google as an alternative to third-party cookies for ad targeting. FLoC aimed to provide a more privacy-preserving method for advertisers to reach their target audience.

Instead of tracking individual users, FLoC grouped users with similar browsing behaviors into cohorts, making it more challenging to identify and track users individually.

Google Topics API vs. Google FLoC

Google FLoCTopics API 
PurposeAn earlier Google initiative intended to replace cookies by grouping users into cohorts based on similar browsing behaviors.A privacy-focused method for interest-based advertising, replacing third-party cookies by assigning users to topics based on their browsing history.
Privacy ApproachAimed at preserving privacy by clustering users, but faced criticism for potentially allowing fingerprinting and other privacy concerns.Enhances user privacy by categorizing interests into broad topics without identifying individual users.
Method of User CategorizationUsed an algorithm to place users into cohorts, potentially revealing more specific browsing patterns.Assigns users to topics for a given week based on their browsing history, without specific browsing activities being shared.
Browser and Community ReceptionFaced significant pushback from privacy advocates and other browser vendors, leading to its eventual discontinuation.Generally better received due to its straightforward approach and ease of understanding for users.
Implementation and ComplexityRequires more complex algorithms and was less transparent to end-users about how cohorts were formed.Relatively simpler for publishers and advertisers to implement, with clear topic-based categorization.
Flexibility and Control for UsersProvided less direct control to users over how their cohort data was used.Offers users more control and transparency over their categorized interests.
Targeting AccuracyAimed for more precise targeting by creating cohorts with similar browsing patterns, but at the cost of potential privacy issues.Provides broad targeting based on general interest topics, potentially less precise than FLoC.
Compatibility with Existing Ad EcosystemRequired significant changes in the ad tech industry, posing challenges for implementation.Designed to be more compatible with the current digital advertising ecosystem, allowing for a smoother transition.
Future Viability and AdoptionIts development was halted due to various concerns, making it less viable as a long-term solution.Seen as more sustainable and likely to gain wider adoption due to its balanced approach to privacy and advertising needs.

Topics API vs. Cookies

CookiesTopics API 
Privacy and User DataCollect and store detailed user data, including browsing history, which can raise privacy concerns.Prioritizes user privacy by only sharing broad topic interests without detailed browsing history.
Mechanism of OperationTrack individual user behavior across websites to gather specific data about user preferences and actions.Groups users based on general interest categories derived from their browsing history.
User Control and TransparencyOften lack transparency and control for users, leading to concerns over consent and data usage.Provides users with more control and transparency over the data shared for advertising purposes.
Targeting AccuracyEnable highly precise and personalized targeting based on detailed user data.Offers broader, less precise targeting based on general interest categories.
Dependency on Third-Party DataHeavily rely on third-party data collection, which is subject to increasing regulatory and browser restrictions.Reduces dependency on third-party data by focusing on first-party interactions within the browser.
Compliance with Privacy RegulationsOften conflict with privacy regulations, leading to challenges in compliance.Designed to be more compliant with emerging privacy regulations like GDPR and CCPA.
Adaptability to Changing Web StandardsIncreasingly seen as outdated due to privacy concerns and evolving web standards.Represents Google’s adaptation to evolving web standards prioritizing privacy.
Impact on Advertising EcosystemLong-standing method offering precise targeting, deeply integrated into the current online advertising ecosystem.Requires advertisers to adapt to less granular targeting methods.
Implementation and TransitionWell-established with widespread implementation across the internet.Represents a new approach, requiring adaptation and transition for marketers and developers.
Future ViabilityFacing diminishing viability due to privacy concerns and browser restrictions like third-party cookie phase-outs.Seen as a future-forward approach aligning with privacy trends.

How to Implement Topics API?

Implementing the Topics API involves a 9 essential steps for publishers:

  1. Understand Google Topics API. Familiarize yourself with Topics API by reviewing Google’s official documentation. Understand its purpose, the data it provides, and how it differs from traditional cookies.
  1. Explore the Topics Taxonomy. Review the list of categories associated with browsing activities. This taxonomy helps categorize user interests in a privacy-conscious manner.
  1. Check privacy settings. Ensure that your website complies with privacy settings and regulations. Topics API respects user privacy, and it’s crucial to maintain transparency and user consent regarding data collection.
  1. Integrate the Topics API into your website’s code. Depending on your preferred implementation method, you can either use JavaScript API calls or request/response headers in fetch requests or iframes.

If you choose JavaScript API calls, embed code snippets using the document.browsingTopics() method within iframes on your web pages. This helps mark topics as observed for the current user.

Alternatively, use request/response headers in fetch requests or iframes by including {browsing_topics: true} in the options parameter. This signals the browser to include a Sec-Browsing-Topics header in the request.

  1. Explore collab for Topics. Consider using Google’s Collab for Topics, a data analysis tool that combines code output and descriptive text into a collaborative document. This tool can aid in experimentation and understanding the API’s functionality.
  1. Provide users with a simple mechanism to control their topics. Implement settings or preferences that allow users to view topics, block specific topics, or opt-out of the Topics API entirely.
  1. Check for updates. Google may refine the implementation process, so periodically check the documentation for any new information or best practices.
  1. Before deploying the Topics API to your entire website, conduct thorough testing. Monitor its performance, user experience, and adherence to privacy standards. Address any issues or bugs that may arise during testing.
  1. Consider the top-level site structure when implementing the Topics API. Understand that topics are recalculated for each top-level site, making it harder for third parties to identify users across different domains.

Future of Digital Advertising with Topics API in Cookieless World

With its focus on user interests without compromising privacy, Google Topics API serves as a cornerstone in reshaping the future of digital advertising, fostering a balance between personalization and user empowerment.

Advertisers can navigate this new landscape by serving personalized ads based on user interests, enhancing engagement and relevance. The taxonomy associated with the Topics API allows advertisers to align their content with users’ preferences, fostering a more engaging and relevant advertising experience.

Publishers benefit from the Topics API by gaining insights into users’ interests, supporting more effective ad targeting, and potentially increasing ad revenue. However, challenges like favoring larger publishers over niche ones need to be addressed to ensure equitable opportunities for all players.

Users, on the other hand, experience enhanced privacy control, with the ability to opt out of the Topics API if they choose. This shift away from third-party cookies empowers users to have more control over their data and the ads they encounter, contributing to a more transparent and user-centric digital environment.


Google Topics API allows web browsers to share users’ interests without compromising browsing activity details, which is crucial as we move towards a more privacy-oriented digital future. As the industry navigates this transition, ongoing collaboration, feedback mechanisms, and adaptations to evolving privacy standards will become more apparent. 

Users gain control, publishers have a new categorization mechanism, and advertisers can leverage user interests for more effective targeting.

The Topics API represents a step forward, fostering a more privacy-conscious and user-friendly approach to ad targeting in the post-cookie era. Be sure to future-proof your publishing journey!

About Anete Jodzevica
Anete is a content marketing specialist at Setupad. In addition to writing articles, she works at gathering information, verifying data, and explaining complex concepts to others. Anete believes that simplicity is the key to brilliance.

message icon message icon big