WICG / floc

This proposal has been replaced by the Topics API.
https://github.com/patcg-individual-drafts/topics
Other
936 stars 90 forks source link

FLoC API returning empty id and version #122

Closed gonzen2310 closed 3 years ago

gonzen2310 commented 3 years ago

Hi! I'm using the following snippet to get and log the data returned by the FLoC API

async function getAndLogFlocData() {
  try {
    if (document.interestCohort) {
      const { id, version } = await document.interestCohort();
      logToDatabase(id, version)
  } catch (err) {
       // handle error
  }
}

getAndLogFlocData()

However, some of my entries contain empty ids and versions while others log them correctly. Is this an issue with the FLoC API or am I missing something?

P.S: I set a valid token in the response header

michaelkleber commented 3 years ago

Hi @gonzen2310: This is indeed what's expected. Only some people are assigned a FLoC — for example, if you have browsed too few different websites, your cohort id will be empty.