PII rules
Checks that detect personally identifiable information leaking through the dataLayer or encoded in tag payloads — for teams managing GDPR and CPRA compliance.
On this page 5
PII rules exist because regulatory exposure — GDPR, CPRA — attaches to how client-side analytics stacks handle personal data, not just to how backend systems handle it. A tag manager is not exempt. When a custom HTML tag captures form field values or encodes identifiers before sending them to an analytics endpoint, those actions fall squarely within scope.
Both rules in this category target patterns that are invisible to most tag audits. They surface through JavaScript behavior inside custom HTML tags, not through explicit configuration in the GTM UI. That invisibility is why they exist as automated checks.
What this category covers
The dataLayer is a shared namespace. Every tag in a GTM container can read every value pushed to it. When a custom HTML tag captures form fields — email, phone, name, company — and pushes them to the dataLayer, those values become available to every analytics platform, ad pixel, and third-party script in the container. GA4 can log them as event parameters. LinkedIn can include them in conversion payloads. The propagation is silent.
The second pattern is subtler. Teams sometimes intend to "protect" sensitive data by encoding it with btoa() before sending it to an analytics endpoint. Base64 is a reversible transformation — any tool can decode it in milliseconds. If an email address or user ID passes through btoa() and lands in an analytics payload, it travels as readable text. The encoding provides no protection.
Both findings cite GDPR Article 5 (data minimization) and Article 32 (security of processing). datalayer-pii-push also cites CCPA/CPRA. Neither framework makes exceptions for data that flows through a tag manager.
How findings are tiered
Both PII rules are errors. Errors apply the largest deduction to the health score and appear first in audit results. The tier reflects regulatory stakes: these findings represent potential violations, not configuration preferences.
Error-tier findings in this category also require manual triage. The automated check flags the pattern — the code matches a known signature for PII exposure. A human must confirm whether the specific fields or values in context actually constitute PII.
Rules in this category
Errors
datalayer-pii-push— Form data pushed to dataLayer (potential PII leak)btoa-pii— Base64 encoding used for PII
Common patterns
datalayer-pii-push is the more common of the two. It appears in legacy form tracking implementations built before GA4 became standard. The original pattern — capturing all form field values and pushing them to the dataLayer for flexibility — made sense when analytics stacks were simpler. As containers grew and third-party pixels multiplied, that data became broadly accessible. The implementation didn't change; the blast radius did.
btoa-pii tends to appear alongside a specific intent: someone on the team flagged that raw PII was being sent and wanted to mask it. btoa() was chosen because it's a built-in browser function and the result looks opaque. The fix for both findings follows the same direction — use SHA-256 for identifiers that must be transmitted, or remove the collection entirely if the data serves no downstream purpose.
See also
- Health score — how findings translate to score deductions
- Rules catalog — browse all rules
- Consent rules — adjacent regulatory category
Examples
curl https://developer.tagmanifest.com/v1/scan-url \
-H "Authorization: Bearer $TM_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com","category":"pii"}'