Event parameters with PII-risk names
Parameters with names that strongly suggest personally identifiable information is being collected.
Summary
- rule_id —
ga4-param-pii-risk - purpose — Detect GA4 event parameters, user properties, and config settings whose names match a known list of PII identifiers
- effect — PII-risk parameter names sent to GA4 violate Google's Terms of Service and can trigger data deletion
- layer — container
- reversibility — non-destructive
What fires this
The rule calls getGA4Tags() to collect all active GA4 tags, then flattens each tag's eventParameters, userProperties, and configSettings into a single list. It tests each parameter name against a fixed set of PII-risk names: email, phone, ssn, first_name, last_name, birthdate, address, credit_card, password, ip_address, zip_code, phone_number, social_security, date_of_birth, full_name, user_email, user_phone, customer_email, and customer_phone. The comparison is case-insensitive. Any GA4 tag with at least one matching parameter name is included in the issue. Paused tags are excluded.
Why it matters
Sending parameters named email or ssn to GA4 violates Google's Terms of Service regardless of whether the values are hashed. Google's PII detection scans parameter names, not just values. A flagged property can trigger automatic data deletion or account suspension. Even if you SHA-256-hash the value, using a PII-risk name as the key signals intent and keeps the risk active. Rename the parameter to a non-PII key and hash the value before sending. Regulatory: GDPR Art. 5 (data minimization), GDPR Art. 6 (lawful basis).
Before / after
// GA4 event tag — parameter names trigger the rule
dataLayer.push({
event: 'sign_up',
email: user.email, // PII-risk name — flagged
phone: user.phoneNumber // PII-risk name — flagged
})
// Rename to a non-PII key; hash the value before sending
async function hashValue(raw) {
const buf = await crypto.subtle.digest(
'SHA-256',
new TextEncoder().encode(raw)
)
return Array.from(new Uint8Array(buf))
.map(b => b.toString(16).padStart(2, '0')).join('')
}
dataLayer.push({
event: 'sign_up',
hashed_user_id: await hashValue(user.email)
})
Remediation
- Open each flagged GA4 tag in GTM (Google Tag Manager).
- Identify every parameter name listed in the issue (
piiParams). - Determine whether the value is a real user identifier or a coincidental name match.
- If the value is PII: rename the parameter to a non-PII key and hash the value with SHA-256 before sending.
- If the value is not PII: rename the parameter to a name that does not appear in the PII-risk list.
- If the data should not be collected at all: remove the parameter from the tag entirely.
- Publish the updated container and verify the parameter name no longer appears in GA4 DebugView.
Metadata
- Severity
- critical
- Tier
- error
- Category
- ga4
- Layer
- container
- Version
- 1
- Effort
15min(about 15 minutes)- Reversibility
- non-destructive
- Regulatory
- GDPR Art. 5 (data minimization), GDPR Art. 6 (lawful basis)
See also
- GA4 rules — other rules in this category
- Health score — how this rule contributes to the score
- Rules catalog — browse all rules
Examples
curl https://developer.tagmanifest.com/v1/evaluate-rule \
-H "Authorization: Bearer $TM_API_KEY" \
-H "Content-Type: application/json" \
-d '{"rule_id":"ga4-param-pii-risk","url":"https://example.com"}'
User: Run ga4-param-pii-risk on https://example.com
# Tool call
{
"tool": "evaluate_rule",
"arguments": {
"rule_id": "ga4-param-pii-risk",
"url": "https://example.com"
}
}