OA
OpsAgent

Anonymize Date

Last updated 3 weeks ago

The Anonymize Date workflow action protects sensitive date information by shifting it randomly or reducing its precision to a year, month, or quarter. Use it to comply with data privacy requirements while preserving enough date context for reporting and segmentation.

How It Works

Add the Anonymize Date action to any contact, company, deal, or ticket workflow in HubSpot. When a record reaches this step, the app reads a date from the CRM property you selected, applies the anonymization method you chose, and returns the anonymized date so your workflow can store or act on it.

Action Inputs

When you add this action to your workflow, you'll configure the following fields:

Field Required Description
Date to Anonymize Yes Pick a CRM date property from the enrolled record. This is the date value that will be anonymized.
Anonymization Type No Choose how the date should be anonymized. Options: Shift Random -- moves the date forward or backward by a random number of days; Year Only -- replaces the date with January 1 of the same year; Month Only -- replaces the date with the 1st of the same month; Quarter Only -- replaces the date with the first day of the same quarter.
Shift Days No When using the Shift Random method, enter the maximum number of days the date can be shifted in either direction. Defaults to 30 if left blank.

Action Outputs

After the action runs, the following values are available for use in later workflow actions (e.g., copy to property, branching):

Output Type Description
Anonymized Date Date The date after anonymization has been applied
Anonymized Timestamp Number The anonymized date expressed as a Unix timestamp, useful for calculations or custom integrations
Success Yes/No Whether the anonymization completed without errors
Error Message Text If something went wrong, this contains a description of the problem

Tip: To learn how to use these output values in later workflow actions (e.g., copy to a property, use in branching logic), see Using workflow action outputs in the HubSpot Knowledge Base.

Usage Examples

GDPR-Compliant Date Randomization in HubSpot

When privacy regulations require you to anonymize personal data but you still need to run time-based reports, shifting dates by a random offset preserves trends without exposing exact dates.

  1. Trigger your workflow when a contact requests data anonymization (e.g., a form submission or lifecycle stage change)
  2. Add the Anonymize Date action and select the contact's Create Date property
  3. Set the Anonymization Type to Shift Random and the Shift Days to 30
  4. Use a "Copy property value" action to write the Anonymized Date output back to a custom date property on the contact record

Quarterly Cohort Analysis in HubSpot

For aggregate reporting, you may only need to know which quarter a deal closed in rather than the exact date. Reducing precision to the quarter level protects deal-specific details while supporting cohort analysis.

  1. Trigger a deal-based workflow when a deal moves to Closed Won
  2. Add the Anonymize Date action and select the Close Date property
  3. Set the Anonymization Type to Quarter Only
  4. Copy the Anonymized Date to a custom property like "Close Quarter" for use in reports and dashboards

Anonymizing Event Dates Before Data Export

Before exporting HubSpot data to external analytics tools, you may need to reduce date precision to protect individual records. Using Year Only anonymization strips month and day details.

  1. Trigger a contact-based workflow when a contact is added to a specific list for export
  2. Add the Anonymize Date action and select the date property you plan to export (e.g., Last Activity Date)
  3. Set the Anonymization Type to Year Only
  4. Store the Anonymized Date in a custom property that your export integration reads from

Tips

  • Choose the right precision for your use case. Shift Random is best when you need dates that still look realistic. Year Only, Month Only, and Quarter Only are better when you need consistent groupings for reporting.
  • Shift Days controls the randomization window. A larger value (e.g., 90) provides stronger anonymization but less date accuracy. A smaller value (e.g., 7) keeps dates close to the original but offers less protection.
  • Anonymization is one-way. Once a date is anonymized, the original value cannot be recovered from the output. Make sure you no longer need the exact date before overwriting it.
  • Use the timestamp output for calculations. The Anonymized Timestamp output is useful when you need to compare anonymized dates or pass them to external systems that expect Unix timestamps.
Previous
Use Cases