Search documentation...

K
ChangelogBook a demoSign up

Handling violations

Violations occur when the events flowing through an event source do not satisfy the contract applied to the source.

Events can cause 3 different types of violations:

  • An undeclared event violation occurs when a specific event is not specified in the contract
    • e.g. Button Clicked event is sent to Hightouch, but it is not in the E-commerce Events contract
  • An undeclared field violation occurs when a field in an event is not specified in the validation schema
    • e.g. user_name field is sent to Hightouch in the Order Completed payload, but it is not specified in the validation schema
  • A schema validation violation occurs when a field does not pass the schema validation defined by JSONSchema rules
    • e.g. userId field is passed in as a string when the schema violation defines the field as type number

All violations are written to a separate event_violations table in your destination, regardless of how violation enforcement is configured.

This table has the schema:

  • payload: JSONB
  • event_name: string (derived from payload)
  • event_type: string (derived from payload)
  • schema_version: string (derived from payload)
  • has_undeclared_schema: boolean
  • has_undeclared_fields: boolean
  • has_schema_violated: boolean
  • violations: string[]

Violation enforcement

Hightouch allows you to configure how to handle violations at the contract level. Depending on the cleanliness of your current event tracking, you may want to allow violations to be written to your main event tables.

Schema validationUndeclared fieldUndeclared event
AllowAllowAllow
Block eventBlock eventBlock event
Omit fields

This table represents the different ways Hightouch can handle a violation. The bolded actions represent the default behavior.

Violation enforcement screenshot

Currently, Hightouch only allows configuring enforcement behavior on the contract. If you are looking to override the enforcement behavior for different events, let us know.

Ready to get started?

Jump right in or a book a demo. Your first destination is always free.

Book a demoSign upBook a demo

Need help?

Our team is relentlessly focused on your success. Don't hesitate to reach out!

Feature requests?

We'd love to hear your suggestions for integrations and other features.

Last updated: Oct 16, 2023

On this page

Was this page helpful?