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
Button Clickedevent 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
user_namefield is sent to Hightouch in the
Order Completedpayload, 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
userIdfield is passed in as a
stringwhen the schema violation defines the field as type
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
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 validation||Undeclared field||Undeclared event|
|Block event||Block event||Block event|
This table represents the different ways Hightouch can handle a violation. The bolded actions represent the default behavior.
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.