Sub topic 13
Data clean rooms and identity solutions
This chapter assumes you know what first-party data is and why consent matters (earlier chapters cover both). You should also know what a hashed identifier is, and be able to read short Python. It covers two tools for connecting audiences and results across companies when third-party cookies are no longer available. A data clean room is a controlled environment for joint analysis. An identity solution is a shared way to recognize the same person across sites and platforms.
The problem these tools address
Your first-party data is rich but narrow. It covers only people who bought from you, subscribed, or logged in. A publisher or retailer has the opposite problem: it knows a great deal about its own audience but not what they did on your site. Cookies used to bridge that gap, because a pixel on both sides could recognize the same browser. With that bridge weakened, the two parties must either exchange personal data directly, which is risky and often not permitted, or find a way to compute on the combined data without exposing it.
A clean room is that second option. An identity solution is a different answer, because it makes the same person recognizable across parties.
How a clean room works
A clean room is a secured environment, hosted by a cloud provider, a platform or a specialist vendor, where two or more parties load their data and run approved queries. Nobody gets to see the other side's rows. Five mechanisms do most of the work:
- Separate storage. Each party's data stays in its own account or is encrypted so the other party cannot read it.
- A join key. The parties match records on a shared key, most often a normalized and hashed email address or phone number.
- Query controls. Only approved query templates or analysis rules run. A free-form
SELECT *on the other party's table is blocked. - Aggregation thresholds. Results come back only as counts or averages over groups above a minimum size, so a result cannot single out one person.
- Optional noise. Some systems add statistical noise (differential privacy) so that repeated queries cannot reveal individuals.
A working sketch
The code below imitates the join and the suppression rule. Real clean rooms add encryption, access control and auditing, but the logic is the same.
import hashlib
def hash_email(email: str) -> str:
return hashlib.sha256(email.strip().lower().encode("utf-8")).hexdigest()
def clean_room_report(advertiser_rows, exposed_emails, min_group=3):
exposed = {hash_email(e) for e in exposed_emails}
groups = {}
matched_total = 0
for email, segment, converted in advertiser_rows:
if hash_email(email) in exposed:
matched_total += 1
g = groups.setdefault(segment, {"matched": 0, "converted": 0})
g["matched"] += 1
g["converted"] += int(converted)
report = {
seg: g if g["matched"] >= min_group else "suppressed: group too small"
for seg, g in groups.items()
}
match_rate = matched_total / len(exposed_emails)
return round(match_rate, 2), report
advertiser_rows = [
("[email protected]", "gold", True),
("[email protected]", "gold", False),
("[email protected]", "gold", True),
("[email protected]", "gold", True),
("[email protected]", "silver", False),
("[email protected]", "silver", True),
("[email protected]", "silver", False),
]
exposed = [
" [email protected]", "[email protected]", "[email protected]",
"[email protected]", "[email protected]", "[email protected]",
"[email protected]",
]
print(clean_room_report(advertiser_rows, exposed))The output shows a match rate of 0.86 (6 of 7 exposed people matched). The gold segment returns 4 matched and 3 converted. The silver segment is suppressed because only 2 people matched, below the minimum of 3. Note that " [email protected]" matched only because both sides normalized the address before hashing.
Identity solutions
An identity solution gives a person a persistent identifier that more than one company can recognize. They fall into two groups.
- Deterministic identity relies on something the person provided, usually a login email or phone number. Matches are accurate, but coverage is limited to logged-in or known users.
- Probabilistic identity infers that two devices belong together from signals such as IP address, device type and timing. Coverage is wider and accuracy is lower. Many privacy regulators and browsers treat these signals as personal data, and some platforms prohibit using them.
Common deterministic approaches include hashed-email-based shared IDs (such as UID2 and its European counterpart EUID, and vendor IDs like RampID), publisher-provided identifiers that a publisher builds from its own logged-in users, and the platform walled gardens' own logged-in IDs.
| Approach | Needs login or email | Typical accuracy | Main limit |
|---|---|---|---|
| Third-party cookie (declining) | No | Medium | Blocked or limited in most browsers |
| Hashed-email shared ID | Yes | High | Coverage is only as large as the known-user base |
| Publisher-provided ID | Yes, on that publisher | High within the publisher | Works only inside that publisher's audience |
| Probabilistic graph | No | Lower | Regulatory and platform-policy risk |
| Clean-room join | Yes, on both sides | High | Aggregate output only, needs a partner |
Gotchas and failure modes
Hashing is not anonymization. A SHA-256 hash of an email address is deterministic. Anyone with a list of candidate addresses can hash them and compare. Regulators generally treat hashed emails as personal data, so consent and purpose limits still apply. Hashing makes matching safe to run in a shared environment. It does not remove your legal obligations.
Match rates are lower than expected. A match rate is the share of your records found on the other side. Typical causes are people using different emails for different services, inconsistent normalization (case, whitespace, dots in Gmail addresses), and partner audiences with few logged-in users. Measure the match rate before you commit budget. A 20 percent match rate means your result describes only a fifth of the audience, and that fifth may not represent the rest.
Small groups get suppressed. Thresholds protect privacy but make narrow segments unusable. A query for "gold customers in one city who saw creative B" may return nothing.
Query attacks. If an analyst can run many slightly different queries, differences between results can reveal one person. Good platforms limit the number and overlap of queries. If you set up your own rules, restrict this too.
Consent must travel with the data. A customer who agreed to receive email may not have agreed to have their email matched with a partner's data for advertising. Record the purpose at collection time and filter the upload by it.
Fragmentation. Each partner may use a different clean-room product or ID. Interoperability is improving but incomplete, so every new partner can mean new integration work.
Cost and skill. Most clean rooms charge for storage and compute. Analysts must write queries within the platform's rules, and the work is slower than using an ad platform dashboard.
Common uses
- Audience overlap. Count how many of your customers a publisher also reaches, to decide whether the partnership is worth buying.
- Measurement. Join the publisher's exposure log to your sales to see conversions by campaign, or to run a holdout test when the exposed and held-out groups sit in different companies' data.
- Activation. Build an audience of customers who have not bought in 90 days and send it to a partner for targeting, where the platform allows the audience to leave the room.
- Retail media. Retailers use clean rooms so brands can see sales results from retailer ad campaigns without receiving shopper-level data.
Decision criteria
Ask these questions in order.
- Do you have enough known customers? If your first-party list is only a few thousand people, thresholds and match rates will leave little to analyze.
- Does the partner have a logged-in audience that overlaps yours? Test with a small match before committing.
- Is the question aggregate? Clean rooms answer "how many" and "what share". They do not answer "which individual".
- Is consent in place for this use? If not, fix collection before you upload anything.
- Does an easier option exist? A platform's built-in conversion API or a marketing mix model may already answer the question.
A shared ID is the better choice when you need real-time targeting across many publishers and your users are logged in. A clean room is the better choice when the main need is analysis or measurement with a few large partners, and when your legal team wants the strongest control over what leaves the environment.
Exercise
Your retailer partner offers a clean room. You upload 50,000 hashed emails and the partner's exposure log contains 200,000 hashed emails. The join finds 6,000 matches, and a query for one product category and one region returns "suppressed". Calculate the match rate on your side, and give two reasons the narrow query may have been suppressed.
Show answer
The match rate on your side is 6,000 / 50,000 = 12 percent. (Measured against the partner's 200,000 emails it is 3 percent, but the share of your own customers reached is the usual figure.) The narrow query was probably suppressed because the cross of category and region left fewer matched people than the platform's minimum group size, and because only 12 percent of your list matched at all, so each narrow slice shrinks quickly. A third reason is that differences in email normalization may have lowered matches. Widen the query, or check that both sides normalize before hashing.
Exercise
A colleague says that because the customer list is hashed before upload, no consent check is needed. Explain what is wrong with this view.
Show answer
A hashed email can be reversed by hashing guessed addresses and comparing, so regulators treat it as personal data. Consent and purpose limits apply to the upload, and the list should include only people who agreed to this use.