← Writing
Analytics Engineering22 Jul 2026 · 5 min read

Designing Healthcare Analytics Events Without PHI

Useful product analytics can describe workflow state without copying patient identity or clinical content into every event.

Direct answer: Healthcare analytics can be useful without sending PHI when events describe controlled workflow state instead of patient identity, clinical content, raw URLs, free text, or document values. If identifiers or health details can reach the analytics vendor, treat it as a PHI data flow that needs vendor, BAA, and configuration review.

Healthcare teams need to know whether onboarding works, where users abandon a workflow, which release introduced friction, and whether a feature improves completion. The quickest implementation is often to let developers send arbitrary event names and properties. That is also how analytics platforms quietly accumulate identifiers, appointment details, diagnoses, and free text.

A safer system treats analytics as a governed data product. Events describe product behavior. Clinical systems retain clinical facts. The analytics payload should answer a defined product question with the smallest practical set of fields.

Sources reviewed: HHS tracking technology guidance, HHS de-identification guidance, and Google Analytics guidance on avoiding personally identifiable information.

Scope: Removing obvious identifiers does not guarantee that data is de-identified under HIPAA. This is an engineering pattern for minimizing exposure, not legal advice or a formal de-identification determination.
Principle 1

Track workflow state, not healthcare content

Start from the decision the team needs to make. If the question is whether users complete an intake flow, the event needs the workflow, step, outcome, duration bucket, and application version. It does not need the answers entered into the form.

NeedAvoidPrefer
Measure intake completiondiagnosis_entered with diagnosis textintake_step_completed with step=medical_history
Measure appointment flowProvider name, patient email, reason for visitappointment_request_completed with channel and duration bucket
Debug document uploadFilename, document text, patient IDdocument_upload_failed with file-type category and error code
Measure medication featureDrug name, dosage, prescription IDmedication_workflow_completed with step count and outcome
Measure searchRaw search termsearch_completed with result-count bucket and filter category
Principle 2

Use a closed event contract

Do not let every feature send arbitrary objects to the analytics SDK. Put one application-owned tracking function in front of the vendor library. It should accept only registered event names and validate each property against a schema.

Event: intake_step_completed
Allowed: step, attempt_number, duration_bucket, platform, app_version
Rejected: name, email, date_of_birth, patient_id, answers, notes, raw_url

The registry becomes a reviewable contract between product, engineering, analytics, privacy, and security. A new property is a schema change, not an informal addition made inside a feature branch.

Principle 3

Keep dangerous fields out by design

Free text

Do not send notes, messages, search text, error text, form values, filenames, or model prompts as analytics properties.

URLs and titles

Strip path identifiers and query strings. Send a controlled route name rather than the browser's raw location.

Direct identifiers

Avoid names, email addresses, phone numbers, account numbers, medical record numbers, and device-level identifiers.

Clinical values

Keep diagnoses, medications, results, appointment reasons, documents, and treatment details in the source system.

Also review fields generated outside the feature code: SDK defaults, IP addresses, device metadata, referrers, attribution parameters, tag managers, session replay, heatmaps, support widgets, and advertising integrations.

Identity

Hashing is not a magic eraser

A stable hash of an email address or medical record number can still allow records to be linked over time and may be reversible through guessing. Pseudonymization can reduce exposure, but it does not automatically make information de-identified or take it outside HIPAA.

Ask whether user-level identity is needed at all. Many product questions can be answered with aggregate counts, short-lived session identifiers, or an analytics-specific random identifier that has no direct meaning outside a tightly controlled lookup process.

If the use case genuinely requires identifiable or linkable PHI, treat it as such. Use a vendor and account covered by the necessary BAA, apply minimum-necessary access, and document the purpose.

Validation pipeline

Enforce the schema before transmission

  1. Define product questions and approve a small event catalog.
  2. Give every event an owner, purpose, allowed properties, value types, and retention expectation.
  3. Validate payloads in the application-owned tracking wrapper.
  4. Reject unknown properties and values rather than forwarding them optimistically.
  5. Normalize routes, errors, durations, counts, and workflow states into controlled categories.
  6. Run automated tests with canary values that resemble emails, phone numbers, record numbers, dates, and free text.
  7. Inspect the vendor's received payloads in a production-like environment.
  8. Monitor the schema for new events, new properties, cardinality spikes, and prohibited patterns.
Governance

Control where events go next

Analytics data rarely stays in one system. It may flow into a warehouse, reverse-ETL platform, messaging tool, experimentation service, advertising destination, customer-support system, notebook, or downloaded CSV.

Maintain a destination register. For each connection, document the fields transferred, purpose, owner, legal basis, contract and BAA status, retention, access roles, and deletion path. Disable destinations that do not have an approved use.

Permissions matter too. Limit who can edit schemas, reveal user profiles, export raw events, create integrations, change retention, and grant access. Audit administrative changes and review access regularly.

Example schema

Enough context to improve the product

event: questionnaire_step_submitted
workflow: intake
step: insurance
attempt_number: 2
duration_bucket: 30_to_60_seconds
outcome: validation_failed
error_code: REQUIRED_FIELD_MISSING
platform: ios
app_version: 4.8.1

This payload can reveal where users struggle and whether the issue changed after a release. It does not require the patient's insurance details, answers, identity, or the field value that failed validation.

Related reading

Choose and govern the platform

Mixpanel vs Google Analytics

Compare BAA availability, PHI restrictions, and appropriate deployment zones.

HIPAA Vendor Checklist

Review agreements, service boundaries, subprocessors, retention, and response obligations.

Official references: HHS tracking technology guidance and Google guidance for avoiding PII in analytics.

Need PHI-safe analytics design?

I can help define event schemas, validation rules, vendor boundaries, and dashboards that answer product questions without spreading sensitive data.

Start a project inquiry

Please do not send patient information, PHI, credentials, or private system details by email.