Rules define automations that execute in response to collected Events.
Rules allow you to control the Actions that should be taken based on a set of Conditions that have passed a truth test.
Rules execute all of their Actions when all of their specified Conditions are true. Conditions may reference Events, Sessions, Profiles, Sources, and Segments, while Actions may utilize Connections when interacting with external systems.
For example, suppose you fire an event Form Completed after a visitor to your website completes a form. You may define
a Rule that depends on a Condition where event must equal Form Completed, and which fires an Action that sends a
notification email.
Rules are retrieved based on an inbound Event's information and are processed via a structured lifecycle:
write_key valueRules are executed after a response is sent to the client. This is appropriate when used in conjunction with the JavaScript Source, since the client browser making a request won't have to wait for the Rule to evaluate - it will just receive a super fast response.