demo · v134 · privacy-sandbox

Audience Segment Builder

Build a Shared Storage worklet that filters interest groups by owner, name, segment bucket, and the spec-defined timeSinceLastUpdateMs metadata returned from interestGroups(). Mock IGs included; see how each filter slice changes the distinct Private Aggregation buckets.

A fixed pool of mock StorageInterestGroup records for the worklet to read from interestGroups(). Durations are stored in milliseconds, matching the API, and displayed as days for readability.

mock interest groups

    filtered (worklet sees these)

      0
      total IGs
      0
      matched IGs
      0
      distinct buckets
      0
      contributions
      
        

      why this matters

      Before v134, Shared Storage worklets had no way to incorporate audience signals from Protected Audience interest groups; aggregation jobs were blind to which IGs the user belonged to. With interestGroups() exposed inside the worklet, you can join IG membership against shared-storage state and contribute aggregate segment counts without any IG data leaving the worklet.

      see also