Parameters with PII-suggesting names
Parameters with names like "email", "phone", or "user_name" — GA4 prohibits sending PII.
Summary
- rule_id —
ga4-pii-parameter-names - purpose — Detect GA4 event parameters and user properties with names that suggest personally identifiable information
- effect — PII field names sent to GA4 violate Google's Terms of Service and expose users to regulatory risk
- layer — container
- reversibility — non-destructive
What fires this
The rule inspects all active GA4 tags via getGA4Tags(). For each tag it collects ga4.eventParameters and ga4.userProperties, then tests each parameter name against a fixed pattern list: email, e_mail, mail, phone, telephone, mobile, first_name, last_name, full_name, user_name, username, ssn, social_security, credit_card, card_number, address, zip_code, postal_code, date_of_birth, dob, ip_address, passport. Matching is case-insensitive. A parameter is excluded only when its value is a GTM variable reference (starts with {{). Any remaining match produces an issue. Paused tags are excluded.
Why it matters
GA4's Terms of Service prohibit sending personally identifiable information to Google's servers. A parameter named email carrying a raw email address — or phone carrying a phone number — is a direct ToS breach. Google may suspend data collection or terminate the property. Beyond ToS, transmitting identifiable values to a third-party analytics platform without a lawful basis violates GDPR. Hashing the value before dispatch is not sufficient if the parameter name alone reveals intent; rename or remove the parameter entirely. Regulatory: GDPR Art. 5 (data minimization), GDPR Art. 6 (lawful basis).
Before / after
// GA4 event tag — custom parameters
gtag('event', 'sign_up', {
email: user.email, // raw PII — flagged
phone: user.phoneNumber, // raw PII — flagged
plan: 'pro'
})
async function sha256hex(str) {
const buf = await crypto.subtle.digest(
'SHA-256',
new TextEncoder().encode(str)
)
return Array.from(new Uint8Array(buf))
.map(b => b.toString(16).padStart(2, '0')).join('')
}
gtag('event', 'sign_up', {
user_id_hash: await sha256hex(user.email), // hashed, renamed
plan: 'pro'
})
Remediation
- Open GTM and locate each flagged GA4 tag.
- Identify which parameters match the PII name list (see "What fires this" above).
- Determine whether the collected value is confirmed PII or a false positive.
- For confirmed PII: rename the parameter to a non-identifying key and hash the value with SHA-256 before dispatch.
- If the data is not needed for the measurement use case, remove the parameter entirely.
- For false positives: add a GTM tag comment documenting why the name is safe.
- Publish the updated container and verify GA4 DebugView shows no PII field names.
- Submit a data deletion request in GA4 Admin to purge any PII already collected.
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-pii-parameter-names","url":"https://example.com"}'
User: Run ga4-pii-parameter-names on https://example.com
# Tool call
{
"tool": "evaluate_rule",
"arguments": {
"rule_id": "ga4-pii-parameter-names",
"url": "https://example.com"
}
}