What’s the best way to log triggered events?
Still have a question, spotted an error, or have a better explanation or a source we should cite?
You've got a triggered automation running, and something went wrong. But you can't figure out if it's your setup, the ESP, or the data. Without good logging, you're just guessing.
Good logging transforms 'something went wrong' into 'here's exactly what happened and where it broke.'
What to log at the trigger point: The event type (purchase, form signup), exact timestamp, which system sent it, and a unique event ID. Log the recipient ID and key attributes at that moment (subscription tier, location, past purchase history). This forensic trail is vital for debugging 'why didn't they get it?' problems.
Log the evaluation: Which conditions did you check? Did they pass or fail? If a lead didn't enter the automation, the log should show why (score was too low, already on suppression list, failed validation).
Log the outcome: Which automation path did they take? What actions did it try to perform? Did the email actually send, or did it fail? If it failed, why? (Invalid address, throttling, content error.)
You don't need the same level of detail for everything, though. Summary-level logs (daily counts, pass/fail status) work for dashboards. Detailed logs (individual event records) matter for investigation. Debug-level logs (verbose traces) help when you're really stuck. (Of course, this gets expensive fast. Balance what you actually need against storage costs.)
Set a log retention policy based on your compliance needs. GDPR typically requires 30 days minimum; some contracts require longer. Make logs searchable and accessible, a log you can't query is useless. Then set up alerting on patterns. If 10% of events suddenly start failing with the same error, you want an alert, not a surprise discovery weeks later.
Start by logging the core path: trigger event, recipient ID, entry/exit decision, send success/failure. Build from there as you find gaps in your understanding.
Contributors
Who worked on this answer
Every name links to their profile. Every company links to their site. Real people, real accountability.