demo · v134
Reach measurement with update-age metadata
The driving use case for adding interestGroups() to Shared Storage worklets was reach measurement: how many users in audience X have been served by ad campaign Y in a recent window. Chrome exposes that timing through StorageInterestGroup metadata such as timeSinceLastUpdateMs, timeSinceGroupJoinedMs, and lifetimeRemainingMs. Move the slider to see how a worklet filters by update age before sending a single aggregate to the reporting endpoint.
probing sharedStorage worklet...
This API is only exposed inside a
SharedStorageWorkletGlobalScope in a fenced frame or window context with the shared-storage permission policy. The demo simulates the worklet locally so you can interact with the algorithm; the production code listing below is what runs inside Chrome 134+.Simulated worklet input
Each row is an interest group as Chrome would deliver it to the worklet, with timing fields in milliseconds. The table displays days to keep the filter understandable.
30 days
| name | owner | timeSinceLastUpdateMs | timeSinceGroupJoinedMs | tags | in window? |
|---|
The worklet code
// reach-worklet.js - runs inside Shared Storage worklet
class Reach {
async run({ campaign, maxUpdateAgeMs }) {
const igs = await interestGroups();
const reached = igs.filter((g) =>
g.timeSinceLastUpdateMs <= maxUpdateAgeMs &&
(!campaign || g.userBiddingSignals?.tags?.includes(campaign))
);
if (reached.length) {
// Private Aggregation contribution budgets still apply.
privateAggregation.contributeToHistogram({
bucket: BigInt(campaignBucket(campaign)),
value: 1n,
});
}
}
}
register('reach', Reach);
see also
- Interest groups in Shared Storage Worklet — feature index
- IG read baseline — sibling concept
- Reach before vs after v134
- Protected Audience StorageInterestGroup spec
- ChromeStatus entry