Why Hashing User IDs Fails the Anonymity Test in JavaScript Analytics Pipelines

Why Hashing User IDs Fails the Anonymity Test in JavaScript Analytics Pipelines

pr0h0••33 min read•tech
AI Usage (83%)
On this page

A Hashed User ID Still Gives Analytics a Persistent Identity

The Consequence: A Stable Digest Is Still a Stable Identifier

Replacing userId with sha256(userId) and calling the result "anonymous" is a description the cryptography doesn't support. This post walks through why hashing user IDs fails the anonymity test in a JavaScript analytics pipeline, what a stable digest still enables, and which changes — server-side HMAC, scoped keys, coarser timestamps, allowlisted properties — actually reduce re-identification risk without breaking the product questions the pipeline exists to answer.

A SHA-256 digest of a stable input is deterministic, not random. The same account produces the same 64 hex characters on every page load, in every session, on every device where the user logs in, and in every export you ever write. Whatever userId could join, the digest can join. Whatever retention window userId had, the digest inherits.

That shows up in three places at once:

  • Cross-event linking still works. The digest is the join key. Session stitching, funnels, cohort retention, "user did X then Y" queries — all of it runs unchanged.
  • Candidate matching is often trivial. If the input space is guessable — sequential account numbers, employee IDs, emails built from a name grammar — a recipient with a candidate list can enumerate it offline on a laptop.
  • "We hashed it" becomes a claim nobody tests. The privacy statement lives in a design doc; the pipeline keeps shipping linkable identifiers.

A better hash does not fix this. What fixes it is treating anonymization as an identifiability assessment over the whole dataset, the whole recipient list, and the auxiliary information a recipient can plausibly obtain.

What the 3 December Report Actually Says

PPC Land published a report dated 3 December 2026 stating that eleven industry groups asked the European Data Protection Board (EDPB) to wait for the Digital Omnibus before proceeding on anonymity rules.

That's the whole claim, and it's narrow. It describes a request about regulatory sequencing — industry bodies asking a supervisory-coordination body to hold off on guidance until a legislative package moves. It is not an announcement that new anonymity requirements took effect, that the EDPB issued guidance, or that the Digital Omnibus was adopted.

The technical mechanics in this post don't depend on how that request resolves. Hashing behaves the same way regardless of which regulator says what. What the regulatory discussion changes is how defensible your description of the data is — and that description is the part you should stop getting wrong.

Position: Hashing Is Pseudonymization, Not an Anonymity Control

My position: do not classify analytics data as anonymous merely because identifiers are hashed. Hashing is a pseudonymization technique. It reduces some exposure and it's worth doing properly, but on its own it doesn't move data outside the scope of identifiability analysis.

I'll make the case with a dependency-free Node.js lab you can run in a minute, a pipeline trace, the architecture changes that actually help, and CI checks that turn the privacy claim into something a reviewer can fail.

⚠️

Everything below uses invented fixtures: fake account numbers, fake tenants, fake timestamps, fake paths. No real personal data, no production systems, no live endpoints. Every command is offline.

What the Report Establishes—and What It Does Not

A Request About Timing, Not a Change in Obligations

The event is procedural. Eleven industry groups reportedly asked the EDPB to wait for the Digital Omnibus before proceeding on anonymity rules. Nothing in that sentence creates a new obligation, revokes an existing one, or defines anonymity for your pipeline.

The tempting write-up — "EU anonymity rules are changing, here's what to do" — would be wrong on the facts. A request to a regulator is not a rule. A legislative package under discussion is not applicable law.

The Evidence Limit: Headline and Summary Only

The source material for this post is a headline, a one-paragraph summary, and the publication date and publisher. That is it.

The supplied material does not include:

  • the text of the industry letter, its signatories, or its precise ask
  • any EDPB response, statement, or work programme item
  • the Digital Omnibus proposal text, its recitals, or its procedural status
  • any statement about whether existing EDPB guidance on anonymization is paused, withdrawn, or unchanged

I'm not going to fill those gaps with plausible-sounding detail. Where the post needs a legal anchor, it uses the GDPR text itself, which is stable and verifiable.

If you plan to cite this development in a design review or a privacy note, answer these first:

QuestionWhy it changes the answer
What exactly does the letter ask the EDPB to delay?A delay in guidance is not a delay in obligations
What is the Digital Omnibus's procedural stage?Proposal, trilogue, and adopted-but-not-applicable are three different legal facts
Which provisions would it touch?If nothing touches Article 4(1) or Recital 26, the identifiability test is unchanged
Has the EDPB responded?Silence and a published work-plan change are different signals
Does any of it apply to your role and establishment?Territorial and material scope are separate questions from the anonymity test

Until those are answered from primary documents, the correct framing in your own documentation is: reported industry request about regulatory timing; no change to applicable requirements identified.

Anonymization Is an Identifiability Assessment, Not a Hash Function

Article 4(1), Article 4(5), and Recital 26

Three provisions do the work here, and they're worth reading directly rather than through a summary.

Article 4(1) defines personal data as information relating to an identified or identifiable natural person — someone who can be identified, directly or indirectly, by reference to an identifier such as a name, an identification number, location data, or an online identifier.

Article 4(5) defines pseudonymization as processing personal data so it can no longer be attributed to a specific data subject without the use of additional information, provided that additional information is kept separately and subject to technical and organisational measures.

Recital 26 decides most arguments. It states that data protection principles don't apply to anonymous information — information that doesn't relate to an identified or identifiable natural person — and that identifiability depends on all the means reasonably likely to be used, such as singling out, by the controller or another person, taking account of available technology and the cost of processing.

Two things fall out of that:

  1. Pseudonymized data is still personal data by construction. Article 4(5) says the data can no longer be attributed without additional information — not that it stops being personal data.
  2. Identifiability is relative to means reasonably likely to be used, an empirical question about your pipeline and your recipients, not a property of a digest.

Pseudonymization Is Useful and Is Not an Exemption

Pseudonymization earns its place. Keeping the mapping table behind a separate access boundary means the analyst building a funnel doesn't see account numbers, the support export doesn't carry emails, and a leaked dashboard screenshot doesn't contain a customer list. Those are real reductions in exposure and real limits on blast radius.

What it doesn't do is remove the data from scope. The additional information — the mapping, the key, the candidate list, the joinable timestamp — is what decides attribution, and that information lives somewhere in your architecture.

The Opposite Overstatement: Not Every Hash Is Identifiable to Everyone

The failure mode in the other direction is just as common: treating every hash as automatically re-identifiable, which collapses into "nothing is anonymous, so why bother."

Recital 26 doesn't say that either. The test is recipient- and means-specific. Take three different holders of sha256("ACCT-004211"):

  • A third-party recipient with no candidate list, no auxiliary data, and no way to test guesses has a value it can't attribute. For that recipient, on that data alone, attribution may genuinely be infeasible.
  • The same recipient with a plausible account-number format and a few thousand candidates can attribute it in milliseconds — as the lab below shows.
  • The first-party controller holds the raw identifier at ingest and the key material. Attribution is a JOIN, not an attack.

Same digest, three answers. That's why "is this anonymous?" is the wrong question shape. The right one is: anonymous with respect to which recipient, holding which auxiliary information, over which retention window?

Trace Identity Through a JavaScript Analytics Pipeline

Mapping the Pipeline and Who Sees What

A typical browser analytics path in a JavaScript stack:

browser SDK
  -> POST /collect            (ingestion API, Node/Express or edge function)
  -> queue (Kafka / SQS / PubSub)
  -> warehouse (BigQuery / Snowflake / Postgres)
  -> dashboards (Metabase / Looker / internal React app)
  -> logs (application logs, CDN logs, error tracker)
  -> exports (CSV drops, partner feeds, support tooling)

Write down, per hop, which identifier form exists and who can read it:

StageIdentifier formWho can see it
Browser SDKraw userId or session tokenthe user's device, anyone with the bundle, any XSS
Ingestion APIraw userId in request bodyserver process, request logs, APM traces
Queuewhatever the API wroteevery consumer with topic access
Warehouseraw or hashed, per tableanalysts, BI service accounts, anyone with a saved query
Dashboardsgrouped outputdashboard viewers, screenshots, shared links
Logsoften raw, often forgottenobservability vendor, on-call engineers
Exportswhatever the query returnedrecipients outside your access control

The most common finding in that table isn't a cryptographic weakness. It's that the identifier is transformed at the warehouse layer while remaining raw in ingestion logs, APM traces, and the error tracker — three systems with entirely different access lists and retention defaults.

Define the Adversaries Separately

Collapsing these into "an attacker" produces useless analysis.

AdversaryWhat they holdWhat they can do
First-party controllerraw IDs at ingest, key material, account tablerecompute any digest, join to identity at will
Analytics recipient with a candidate liststable digests plus a plausible list of inputsenumerate candidates offline, match by equality
Recipient with only an event exportdigests, timestamps, paths, tenant labelslink events to each other; attribute only via auxiliary joins

Only the second adversary needs the lab below. The first needs a database connection. The third needs one more dataset.

A Synthetic Event Fixture (All Invented)

Everything from here uses this fixture. Every field is fabricated.

{
  "hashed_user_id": "<sha256 of ACCT-004211>",
  "event_name": "feature_export_clicked",
  "occurred_at": "2026-03-14T09:41:07.000Z",
  "page_path": "/app/reports/quarterly-export",
  "tenant": "tenant-blue"
}

Label it that way in code, not just in your head — a comment at the top of the file saying INVENTED LAB DATA stops someone from assuming later that it came from a real export.

The Three Independent Risks to Test

Each risk has its own test and its own mitigation. They're not interchangeable.

  1. Candidate matching. Can a recipient recover the input by enumerating guesses? Depends on the input distribution and the recipient's auxiliary data.
  2. Persistent linkability. Can events be tied together across time, sessions, and exports? Depends on digest stability — which is the whole point of a stable hash.
  3. Identification through auxiliary attributes. Can identity be recovered from the rest of the event — exact timestamps, distinctive paths, tenant labels, IP metadata — even after the identifier is removed? Depends on how much you collect.

Risk 2 is not a bug you fix with cryptography. It's the feature you asked for. The only lever is how long the linkage window is.

Reproduce Candidate Matching Against SHA-256 in Node.js

Build the Candidate-Matching Lab

No dependencies. node:crypto only.

lab/hash-candidates.mjs
import { createHash } from "node:crypto";

const sha256 = (value) =>
createHash("sha256").update(value, "utf8").digest("hex");

// INVENTED LAB DATA. Not real accounts, tenants, or people.
const TENANT = "tenant-blue";

const event = {
hashed_user_id: sha256("ACCT-004211"),
event_name: "feature_export_clicked",
occurred_at: "2026-03-14T09:41:07.000Z",
page_path: "/app/reports/quarterly-export",
tenant: TENANT,
};

const started = process.hrtime.bigint();
let match = null;
let scanned = 0;

for (let n = 1; n <= 5000; n += 1) {
const candidate = `ACCT-${String(n).padStart(6, "0")}`;
scanned += 1;
if (sha256(candidate) === event.hashed_user_id) {
  match = candidate;
  break;
}
}

const elapsedMs = Number(process.hrtime.bigint() - started) / 1e6;

console.log(`scanned ${scanned} candidates in ${elapsedMs.toFixed(1)} ms`);
console.log(match ? `MATCH -> ${match}` : "no match in candidate set");
console.log(
`event: ${event.event_name} @ ${event.occurred_at} on ${event.page_path}`
);

Run the Lab and Read the Output

node lab/hash-candidates.mjs
scanned 4211 candidates in 9.4 ms
MATCH -> ACCT-004211
event: feature_export_clicked @ 2026-03-14T09:41:07.000Z on /app/reports/quarterly-export

Timings vary by machine and Node version; the match doesn't. This is a local run against an invented candidate set, not a test against any production system, and it says nothing about re-identification rates in real datasets.

The Mechanics: Guessing, Not Reversing

Nothing was reversed. SHA-256 wasn't broken, and no collision was used. The lab did one operation: guessed an input, hashed the guess, compared to a value it already had.

That's what makes hashing a poor anonymity primitive for low-entropy inputs. A hash is a confirmation oracle for anyone who can guess. The cost of an attack is decided by the size and shape of the input space, not by digest length.

Truncating the digest to save storage doesn't help either. It still confirms guesses; it just adds false positives, and the attacker tests more candidates per bucket.

Email-Shaped Identifiers and Why Input Distribution Matters

The account-number lab looks contrived until you remember how often structured identifiers show up in real schemas: employee numbers, org-scoped user IDs, emails built from a name grammar.

const first = ["ana", "bo", "chen", "dara", "eli", "fatima"];
const last = ["lopez", "nguyen", "okafor", "silva", "tanaka", "weber"];
const domains = ["example.com", "example.org"];

const candidates = [];
for (const f of first)
  for (const l of last)
    for (const d of domains) candidates.push(`${f}.${l}@${d}`);

const target = createHash("sha256")
  .update("[email protected]", "utf8")
  .digest("hex");

const hit = candidates.find(
  (c) => createHash("sha256").update(c, "utf8").digest("hex") === target
);

console.log(`candidate space: ${candidates.length}`);
console.log(`recovered: ${hit}`);
candidate space: 72
recovered: [email protected]

Seventy-two hashes. A real employee directory or scraped name-plus-domain list is larger, but the shape is the same: the candidate space grows with the structure of the identifier, not with the strength of the hash.

Now swap in a 128-bit random identifier generated per account:


const opaqueId = randomBytes(16).toString("hex"); // 32 hex chars, 128 bits

Enumeration becomes infeasible — 2^128 candidates is not a candidate list. But linkability is unchanged. Every event carrying sha256(opaqueId) still joins every other event carrying it, forever, because the input is stable. High entropy buys resistance to guessing. It buys nothing on linkage or on attribution by anyone holding the mapping — including you.

Assertions for Determinism, Recovery, and Linkage

Facts you can assert in CI rather than argue about in a document:

lab/assert-identity-properties.mjs
import assert from "node:assert/strict";


const sha256 = (v) =>
createHash("sha256").update(v, "utf8").digest("hex");

// INVENTED LAB DATA
const acct = "ACCT-004211";

// 1. Determinism: the same input always yields the same digest.
assert.equal(sha256(acct), sha256(acct));

// 2. Candidate recovery from a constrained set.
const candidateSet = Array.from(
{ length: 5000 },
(_, i) => `ACCT-${String(i + 1).padStart(6, "0")}`
);
const target = sha256(acct);
const recovered = candidateSet.find((c) => sha256(c) === target);
assert.equal(recovered, acct);

// 3. Linkage across two independent event files.
const eventsDay1 = [{ hashed_user_id: sha256(acct), event_name: "app_open" }];
const eventsDay2 = [{ hashed_user_id: sha256(acct), event_name: "export_clicked" }];
const linked = eventsDay2.filter((e) =>
eventsDay1.some((d) => d.hashed_user_id === e.hashed_user_id)
);
assert.equal(linked.length, 1);

console.log("determinism: ok");
console.log("candidate recovery: ok");
console.log("cross-file linkage: ok (1 joined event)");
determinism: ok
candidate recovery: ok
cross-file linkage: ok (1 joined event)

That third assertion is the uncomfortable one. It's a passing test demonstrating that your pseudonymized data supports cross-export joins. If you can write it, so can a recipient.

Why Salts, Encoding Choices, and Client-Side Secrets Do Not Settle the Problem

Fixed Public Salts and Browser-Side "Secrets"

Adding a constant is the most common first response:

// NOT an anonymity control
const hash = sha256("hjs-analytics-salt-v1" + userId);

Against candidate matching, this changes the code and not the outcome. The attacker adds the same prefix to each guess — one extra string concatenation per candidate. A salt committed into a public browser bundle is worth less than nothing, because it invites a false claim.

The browser variant is worse:

// This is not a secret. It ships to every client.
const ANALYTICS_SECRET = "sk_live_...";

Anything in a JS bundle is readable by the user, any extension, and any XSS payload. A "secret" salt evaluated in the browser is public by definition. It can't function as a confidentiality boundary because there is no boundary — the code runs on the adversary's machine.

Per-Record, Per-User, and Stable Hashes Compared

SchemeAttacker with a candidate listCross-event joinWhat actually goes wrong
sha256(id)one hash per candidatefullnothing secret; pure enumeration
sha256(publicSalt ‖ id)one hash per candidatefullsalt is public, not a key
sha256(perRecordSalt ‖ id), salt stored beside recordone hash per recordnone by digest alonesalt becomes a quasi-identifier that correlates records
sha256(perUserSalt ‖ id), salt stable per userone hash per candidatefullthe salt is a surrogate user ID
HMAC(serverKey, purpose ‖ tenant ‖ id)infeasible offlinefull within scopekey holders can still match; scope boundaries are policy, not physics

Read the last column carefully. Each row is a trade-off in who can match and how much work matching costs, not a switch between personal and anonymous.

Canonicalization and Serialization Must Be Explicit

A subtler bug: hash strings without a canonical form and the same human can produce different digests, while different humans can collide.

// Fragile: different byte sequences for the same person
sha256(" [email protected]");
sha256("[email protected] ");
sha256("[email protected]");

Three digests, one person — that looks like better privacy and is actually a correctness bug that fragments your analytics and defeats deletion (you can only delete the forms you know about).

Rules that hold up:

  • Encoding: convert to UTF-8 bytes explicitly. createHash().update(value, "utf8") does this, but be explicit at the input boundary — HTTP headers and query strings aren't always what you expect.
  • Unicode normalization: decide on NFC and apply it before hashing, or the same name typed with different composition yields different digests.
  • Case: apply the case rule of the identifier system, not a generic .toLowerCase(). Email local-parts are technically case-sensitive per RFC 5321 §2.4, which discourages exploiting that; most providers treat addresses case-insensitively in practice. Whatever you choose, document it and apply it identically at write time and at deletion time.
  • Whitespace and trimming: trim, then hash. Never hash pre-trim input.
  • Type: String(42) and "042" and 42 all need a single agreed representation.

Put the canonicalization rule in one exported function that both the collector and the deletion job import. Two implementations means two identity spaces.

The Password-Hashing Workload Mismatch

Reaching for bcrypt, scrypt, or Argon2 is understandable and misplaced here.

Password hashing is deliberately slow because a password is a low-entropy secret chosen by a human and the defender controls verification rate. Analytics identifiers are different in every dimension: not secrets, computed on every event, no verification step to rate-limit.

A slower hash raises enumeration cost. It doesn't touch linkability — a slow deterministic function is still deterministic, so the digest still joins every event for the same user. It doesn't help against the first-party controller or anyone holding the mapping either. You've added latency to the hot ingestion path and bought a partial, undocumented cost increase.

If enumeration cost is your concern, the answer is a keyed function with the key held server-side. That's HMAC.

Use Server-Side HMAC to Reduce Exposure, Not to Declare Anonymity

A Scoped HMAC-SHA-256 Implementation

The goal here is narrower than anonymity: make offline enumeration infeasible for recipients who don't hold the key, and make cross-purpose joins structurally hard for everyone including you.

server/pseudonymize.mjs
import { createHmac } from "node:crypto";

// Length-prefixed framing keeps the input unambiguous:
// ("ab", "c") and ("a", "bc") produce different payloads.
const frame = (parts) =>
parts.map((p) => `${Buffer.byteLength(p, "utf8")}:${p}`).join("|");

export function pseudonymize({ userId, purpose, tenant, key }) {
if (!key) throw new Error("pseudonymize: missing server-side key");
if (!purpose || !tenant) throw new Error("pseudonymize: missing scope");

const payload = frame(["v1", purpose, tenant, String(userId).trim()]);
return createHmac("sha256", key).update(payload, "utf8").digest("base64url");
}

The scope tuple is the design. purpose and tenant are inside the HMAC input, so a digest for product-analytics in tenant-blue is a different value from the same user in billing-support or tenant-red. That's a policy boundary enforced by arithmetic instead of by a code review that nobody re-runs.

The key comes from the environment, never from source:

## .env.local — server only, never committed, never bundled
ANALYTICS_HMAC_KEY="$(node -e 'console.log(require("node:crypto").randomBytes(32).toString("base64"))')"

Where to Put the Transform

The transformation belongs at a trusted ingestion boundary — the Node service that authenticates the request, or a server-side edge function running your code.

What remains exposed before that point is still part of the assessment:

  • The browser still holds the raw identifier, and the session cookie still authenticates the user to your own API.
  • The request body may appear in APM traces, request logs, or a WAF that logs payloads.
  • Any client-side error reporter can capture the raw value in a breadcrumb.

If the raw identifier reaches your server and gets transformed there, you've moved exposure from "everywhere downstream" to "the ingest path." That's a real improvement. It's not the same as "the identifier no longer exists," and the ingest path needs its own controls: log redaction, trace sampling that excludes the body, and a retention policy on the observability vendor.

💪

Transform once, at the first trusted hop, and then never accept a pre-hashed identifier from the client. If the client can send a digest, the client can send the digest of someone else's ID.

Equality Within Scope, Inequality Across Scopes



const key = process.env.ANALYTICS_HMAC_KEY;

const base = { userId: "ACCT-004211", tenant: "tenant-blue", key };

const a = pseudonymize({ ...base, purpose: "product-analytics" });
const b = pseudonymize({ ...base, purpose: "product-analytics" });
const c = pseudonymize({ ...base, purpose: "billing-support" });
const d = pseudonymize({
  userId: "ACCT-004211",
  tenant: "tenant-red",
  purpose: "product-analytics",
  key,
});

console.log("a === b :", a === b);
console.log("a === c :", a === c);
console.log("a === d :", a === d);
console.log("length  :", a.length);
a === b : true
a === c : false
a === d : false
length  : 43

Digest values are omitted because they're key-dependent; 43 characters is the unpadded base64url encoding of 32 bytes, which you can verify from the length alone.

What this buys: a leaked product-analytics export can't be joined against a billing-support export by digest, and one tenant's export can't be joined against another's.

What it doesn't buy, plainly:

  • The key holder can still match anything. You can recompute every scope. So can anyone who obtains the key.
  • Digests remain linkable within a scope. That's the intended function of an analytics identifier.
  • Scoped outputs are still personal data if anyone in the recipient chain can associate them with a person.

Operational Failure Modes

The scoping design fails quietly, which is the worst way to fail. Watch for:

  • Key reuse across environments. If staging and production share ANALYTICS_HMAC_KEY, a staging export joins production events. Generate per-environment keys and assert they differ in CI.
  • Rotation without a plan. Rotating the key changes every digest. You need a documented window where both keys are computed, or you permanently break the join between historical and new events — which some teams "solve" by keeping the old key forever.
  • Purpose label drift. product-analytics, product_analytics, and analytics are three different scopes. Freeze the labels in a single constant and fail on unknown values.
  • Transform endpoint abuse. If /pseudonymize is reachable, it's a confirmation oracle: submit a candidate, get a digest, compare. Authenticate it, scope it to trusted internal callers, rate-limit it, and never expose it to the browser.
  • Historical joins. A JOIN between an HMAC'd table and a raw-identifier table in the same warehouse defeats the whole scheme — the warehouse has both.

That last one is the most common real-world failure. Scoping is only meaningful if the scoped table can't be joined back to raw identity by a query someone can run.

Random Lookup-Backed Tokens Versus HMAC

The alternative to a keyed derivation is tokenization: assign each user a random opaque token once, store the token → userId mapping in a controlled table, and emit the token.

PropertyHMAC (scoped)Random lookup token
Offline enumerationinfeasible without keyinfeasible without the table
Cross-event joinyes, within scopeyes
Revocable per userno (re-keying is global)yes (delete or rotate one row)
Extra runtime dependencynonea lookup on the ingest path
Attribution by table holderkey holder can recomputetable holder can read
Cross-purpose separationstructuralrequires separate tables per purpose

Neither escapes attribution by the party holding the mapping. Tokenization is genuinely better on revocability and per-user deletion, and genuinely worse on latency and operational complexity. Pick based on which failure you can live with — not on which sounds more anonymous.

Remove the Identity Signals That Hashing Leaves Behind

A Synthetic Join on Timestamp and Page Path

Here's the part that surprises people. You can delete the identifier entirely and still re-identify, if the remaining attributes are specific enough.

lab/aux-join.mjs
import { createHash } from "node:crypto";
const sha256 = (v) => createHash("sha256").update(v, "utf8").digest("hex");

// INVENTED LAB DATA
const supportExport = [
{
  ticket: "T-8891",
  opened_at: "2026-03-14T09:41:07.000Z",
  page: "/app/reports/quarterly-export",
  account: "ACCT-004211",
},
{
  ticket: "T-8892",
  opened_at: "2026-03-14T10:02:44.000Z",
  page: "/app/settings",
  account: "ACCT-005118",
},
];

// No raw identifier in this export at all — only a digest.
const analyticsExport = [
{
  hashed_user_id: sha256("ACCT-004211"),
  occurred_at: "2026-03-14T09:41:07.000Z",
  page_path: "/app/reports/quarterly-export",
},
{
  hashed_user_id: sha256("ACCT-004211"),
  occurred_at: "2026-03-14T11:15:02.000Z",
  page_path: "/app/dashboard",
},
];

const joins = analyticsExport.flatMap((event) =>
supportExport
  .filter(
    (t) => t.opened_at === event.occurred_at && t.page === event.page_path
  )
  .map((t) => ({ ticket: t.ticket, account: t.account, hash: event.hashed_user_id }))
);

console.log(JSON.stringify(joins, null, 2));
[
  {
    "ticket": "T-8891",
    "account": "ACCT-004211",
    "hash": "9d0a…"
  }
]

One match. The digest was never broken; the timestamp and the path did the work.

Two honest caveats. First, the fixture was constructed so the timestamps match to the millisecond; in a messy real dataset, clock skew and client-side timing may prevent exact matches. Second, one fixture match is not a re-identification rate. It demonstrates that the channel exists. Whether it's exploitable in your data depends on how unique your timestamp-and-path combinations actually are — a question you answer with a uniqueness query against your own warehouse, not with a blog post.

Audit URLs, Properties, and Logs

The event payload is only one surface. Check all of these:

  • URLs and query strings. /app/search?email=ana.lopez%40example.com puts a raw identifier into page_path. So does a password-reset link, an invite token, or an account_id in a path segment.
  • Event properties. Free-text properties capture whatever a developer passed: { note: "called about acct 4211" }, { fileName: "invoice-ACCT-004211.pdf" }.
  • IP metadata. The ingestion API sees the client IP. If it's stored — even as a country/city derivation — it narrows the candidate set dramatically, and in small populations it can be near-unique on its own.
  • User agent. Full UA strings plus viewport plus timezone are a well-known fingerprinting combination.
  • Tenant labels. In B2B products, tenant plus a handful of events often identifies a small set of employees.
  • Diagnostic logs. The error tracker and the request logger are the two systems most likely to still contain the raw identifier after the warehouse migration "completed."

A quick grep beats a policy document:

## Look for identifier-bearing patterns in fixtures and recorded payloads
rg -n --pcre2 '[\w.+-]+@[\w-]+\.[\w.]+|\bACCT-\d{6}\b|\b\d{1,3}(\.\d{1,3}){3}\b' \
  fixtures/ test/ src/analytics/

Run it against recorded payload fixtures, not just source — the payload shape is what actually ships.

Reconnection Through Identity Tables and Warehouse Joins

Even a well-scoped HMAC digest can be reconnected to a person if the surrounding infrastructure provides a bridge:

  • A users table with both id and analytics_hash — the warehouse can now join identity to events with a single SELECT.
  • A support tool export with both the ticket's account and the session's event stream.
  • A cross-device identity graph mapping cookies and device IDs to an account, sitting next to the pseudonymous table.
  • A BI service account with read access to both the pseudonymous events table and the billing table.

The mitigation isn't cryptographic, it's access topology: the scoped events table shouldn't be joinable to raw identity by any principal that reads it. Separate datasets, separate service accounts, no shared user_id column, and a column-level access policy on the bridge table if one must exist.

Redesign Collection Around the Analytics Question

Start From the Requirement

Before choosing a hashing scheme, write the question down. "How many distinct accounts used the export feature last week?" and "show me the retention curve for accounts onboarded in Q1, segmented by plan, over 18 months" imply completely different data.

RequirementMinimum dataLinkage window
Daily feature-use countsevent name + day + coarse tenantnone — aggregate at ingest
Weekly active accountsstable per-account scope digest + day7 days
Onboarding funnelstable digest + ordered step eventsfunnel length, e.g. 14 days
18-month cohort retentionstable digest + long history18 months (and it is a big claim)

Most product teams ask for the first row and build the fourth. That gap is where the risk lives, and closing it is a design decision, not a hashing decision.

Reduce Collection: Allowlists, Sanitized URLs, Coarser Time

Concrete, boring, effective:

// Allowlist event properties at the schema boundary.
const ALLOWED_PROPERTIES = new Set([
  "feature",
  "plan_tier",
  "result_status",
  "duration_bucket",
]);

function sanitize(event) {
  const props = {};
  for (const [k, v] of Object.entries(event.properties ?? {})) {
    if (ALLOWED_PROPERTIES.has(k)) props[k] = v;
  }
  return {
    ...event,
    properties: props,
    // Strip query strings and fragments; keep the route shape only.
    page_path: event.page_path.split("?")[0].split("#")[0],
    // Coarsen to the hour.
    occurred_at: new Date(event.occurred_at).toISOString().slice(0, 13) + ":00:00.000Z",
  };
}

Hour-level coarsening costs almost nothing for feature-usage questions and removes most of the auxiliary signal that made the join above work. It's the highest-value change in this section.

Add a retention policy that matches the requirement rather than the default: 90 days for raw events, 13 months for daily aggregates, indefinite for nothing.

Aggregation, Suppression, and Differential Privacy Are Different Controls

Don't treat these as interchangeable privacy settings.

  • Aggregation reduces per-person detail but doesn't prevent differencing attacks across overlapping queries. Two aggregates over nearly identical populations can isolate an individual.
  • Small-group suppression (dropping or bucketing counts below a threshold) blocks the most obvious differencing but is defeatable with repeated overlapping queries, and it silently distorts dashboards.
  • Differential privacy provides a formal guarantee, but only relative to a stated epsilon, a stated query set, and a stated privacy unit. An epsilon chosen because the chart looked fine is not a guarantee. Composition across many queries degrades the bound, and the accounting is easy to get wrong.

None of these is an anonymity guarantee on its own, and no single threshold or noise setting should be described as one. They're controls with explicit, documented limits.

The Trade-Offs Are Real

Coarser timestamps, fewer dimensions, and shorter retention all make analytics worse in specific ways:

  • Attribution breaks: you can't say which channel produced a signup if you can't follow the user across the pre- and post-signup boundary.
  • Debugging gets harder: reproducing a specific user's event sequence requires the raw data, which now expires.
  • Retention analysis becomes impossible past your window, by design.
  • A/B tests lose power when the metric is coarsened.

Those costs are the point. The benefit is that a leaked export reveals counts and coarse patterns instead of a behavioral history per person. Decide the trade-off explicitly, in writing, with the product owner in the room — not by leaving the default retention setting alone.

Turn the Privacy Claim into Testable Acceptance Criteria

Local Checks in CI

A privacy claim no test can fail is a marketing sentence. These checks are cheap and they catch real regressions.

test/no-raw-identifiers.test.mjs
import assert from "node:assert/strict";

const FORBIDDEN_FIELDS = [
/^user_?id$/i,
/^account_?id$/i,
/^email$/i,
/^phone$/i,
/^ip_?address$/i,
];

const IDENTIFIER_IN_STRING = [
/[w.+-]+@[w-]+.[a-z]{2,}/i,   // email-shaped
/ACCT-d{6}/,                // internal account format
/d{1,3}(.d{1,3}){3}/,     // IPv4
];

export function assertEventIsClean(event) {
for (const key of Object.keys(event)) {
  assert.ok(
    !FORBIDDEN_FIELDS.some((re) => re.test(key)),
    `forbidden raw identifier field: ${key}`
  );
}
for (const [key, value] of Object.entries(event)) {
  if (typeof value !== "string") continue;
  assert.ok(
    !IDENTIFIER_IN_STRING.some((re) => re.test(value)),
    `identifier-shaped value in field ${key}`
  );
}
}

// demo
assertEventIsClean({
hashed_user_id: "9d0a1f…",
event_name: "feature_export_clicked",
page_path: "/app/reports/quarterly-export",
occurred_at: "2026-03-14T09:00:00.000Z",
tenant: "tenant-blue",
});

console.log("fixture passes identifier checks");

Add on top:

  • Cross-purpose join check. Assert that the analytics pseudonymizer refuses an unknown purpose value, and that two purpose labels never produce the same digest for the same input.
  • Client artifact scan. Assert that no key material appears in the built bundle:
node --input-type=module -e '

const key = process.env.ANALYTICS_HMAC_KEY;
if (!key) { console.error("ANALYTICS_HMAC_KEY not set"); process.exit(1); }
const walk = (d) => readdirSync(d, { withFileTypes: true }).flatMap((e) =>
  e.isDirectory() ? walk(`${d}/${e.name}`) : [`${d}/${e.name}`]);
const leaks = walk("public").filter((f) =>
  statSync(f).isFile() && readFileSync(f, "utf8").includes(key));
if (leaks.length) { console.error("key material in client artifacts:", leaks); process.exit(1); }
console.log("client bundle scan: clean");
'
client bundle scan: clean
  • Expiry of linkable data. Assert that the retention job's cutoff is what you think it is, and that it covers every table holding a stable digest.

Deletion and Retention Across the Whole Pipeline

Deletion is where privacy claims go to die, because the identifier lives in more places than the schema diagram shows.

StoreDeletion mechanismVerified?
Ingestion APIsynchronous transform; raw never persisteduntested unless logged
Request/APM logsvendor-side redaction + retention settingvendor docs, not tested here
Queueshort TTL on the topicneeds an explicit check
Warehouse raw tableDELETE on the identity keyneeds a row-count assertion
Warehouse aggregate tablesmust never contain a stable digestneeds a schema test
Exports / CSV dropsaccess-controlled folder + expiryusually manual
Backupsrestore-then-delete procedurealmost never tested

Two distinctions that matter and are frequently blurred in docs:

  • Immediate deletion means a request removes the record from the live store within a defined window. It says nothing about backups.
  • Documented expiry means a policy states the record will be removed at time T. Weaker than deletion, and should be labelled as such.

If restoring a backup would resurrect a deleted identifier and no procedure says what happens next, you have documented expiry without a deletion path. That's a finding, not a footnote.

An Evidence Table for the Claim

Before anyone writes "anonymous," fill this in. It forces the difference between what you tested and what you assumed.

Claim elementStatusBasis
Candidate matching recovers a sequential ID from a digestConfirmedlocal lab, synthetic 5,000-candidate set
Email-shaped identifiers are recoverable from a small grammarConfirmedlocal lab, 72-candidate set
Digest supports cross-file linkageConfirmedlocal assertion, 1 joined event
Auxiliary join on exact timestamp + path recovers an accountConfirmed for this fixturesynthetic join, 1 match
Real-world re-identification rate in production dataUnknownnot tested; needs a uniqueness query
No raw identifier in ingestion logsAssumednot verified in this post; needs a log sample audit
Warehouse has no joinable bridge to the identity tableAssumedneeds an access review
Recipient holds no candidate listAssumedneeds a contractual and empirical check
Backup deletion procedure existsUnknownneeds a restore drill

Everything in the "Unknown" and "Assumed" rows is a place where the anonymity claim can fail without anyone noticing.

The Release Gate

Require five things in writing before an anonymity claim ships:

  1. Purpose. The specific analytics question, and the requirement it serves.
  2. Recipients. Named systems and named external parties, with what each receives.
  3. Available joining information. Candidate lists, identity tables, vendor data, timestamps, IPs — per recipient.
  4. Linkage duration. How long a stable digest persists across events, per store, including backups.
  5. Residual risks. The rows from the evidence table still marked assumed or unknown, with an owner and a date.

If item 3 or 4 comes back as "we'd have to check," the claim isn't ready. That's the gate doing its job.

What to Watch in the Digital Omnibus Discussion

Documents That Would Resolve the Uncertainty

The supplied report is a headline and a summary. Three primary documents would settle the open questions, and none are in the material available here:

  • The industry letter itself — who signed, what exactly they asked the EDPB to defer, and on what basis.
  • An EDPB response or work programme entry — whether guidance is paused, proceeding, or unchanged.
  • The official Digital Omnibus text and its procedural status — proposal, amended proposal, or adopted-but-not-yet-applicable. Those are different legal facts, and only the last one changes obligations.

Until at least the third is available in official form, the accurate line in your own documentation is that a reported request exists and no change to applicable requirements has been identified.

Conditional Architecture Impact

Suppose the discussion produces recipient-specific or context-specific clarity on anonymization assessment. What would change?

What could change: the analysis you write about disclosure. If guidance emphasizes the recipient's means and available auxiliary data, documenting the recipient list and their candidate information becomes a more central part of the assessment — which is what the release gate asks for anyway.

What would not change: any of the mechanics above. SHA-256 still confirms guesses. Stable digests still link events. HMAC keys still let the key holder match. Auxiliary attributes still re-identify. Timestamps still over-resolve. Realistic identification means are still a property of the dataset and the recipient, not of the regulator's calendar.

That asymmetry is why the engineering work is worth doing now regardless of how the Omnibus discussion resolves. The architecture that satisfies a rigorous identifiability assessment is the same one that satisfies a lenient one. The reverse isn't true.

The Technical Position: Pseudonymization Is Not an Anonymity Argument

Keep pseudonymization. Do it well: server-side, keyed, purpose- and tenant-scoped, with an unambiguous canonical form and a real access boundary between scoped events and identity.

But base any anonymity claim on the full dataset and the realistic means of identification available to each recipient — not on the fact that a SHA-256 call appears in your ingestion path. "We hashed the user ID" describes a transform. It's not an anonymity argument, and it shouldn't be accepted as one in a design review.

If you can run the lab from this post against your own schema and it recovers an identifier, the claim needs to change. That test takes about a minute, and it's the cheapest privacy review you'll ever do.

Further Reading

Deliberately not linked: the industry letter, any EDPB response, and the Digital Omnibus proposal text. None could be independently verified from the material available while writing this, and a fabricated advisory link is worse than an acknowledged gap.

Share this post

More posts

Loading comments…