Sub topic 11
Personalising from behaviour and events
This chapter assumes you know merge tags, fallback values and conditional blocks, and that you have read the consent chapter. Here you will use what subscribers do, not only what they told you.
What behavioural data is
Behavioural data records actions: opening an email, viewing a product, adding to a cart, finishing a purchase. Each action arrives in the platform as an event. An event has a name, a timestamp, and properties such as a product name or a cart value.
Profile fields describe a person and change rarely. Events describe a moment and go stale quickly. A "viewed running shoes" event is useful for a day or two, and after a month it can feel odd.
How events reach the template
Your website, app or shop sends events to the email platform through a tracking script, an integration or an API. The platform stores them against the contact and can then do two things:
- Use an event as a trigger that starts a send, such as a cart abandonment email.
- Expose event properties or summary fields to the template, such as
last_viewed_product.
Using event data in a template
Treat event properties like any other field. They can be missing, so give them fallbacks and wrap them in conditions. Field names vary by platform, so check your platform's documentation for the exact object names.
{% if event.product_name %}
Still thinking about the {{ event.product_name }}?
It is waiting in your cart.
{% elsif customer.last_viewed_category %}
New arrivals in {{ customer.last_viewed_category }}.
{% else %}
See what is new this week.
{% endif %}The template has three levels. It uses the most specific data first, then a broader signal, then generic content. This ordering is a common way to design behavioural emails, because it keeps the email sensible when the data is thin.
Common problems
- Stale events. Check an event's age before using it. Many platforms let you filter a trigger or segment by "within the last 7 days". Use that instead of relying on the copy to sound timeless.
- Events that arrive late or twice. A purchase event may arrive after the abandonment email is queued. Add an exit condition so people who have already bought do not receive a "you forgot something" message.
- Missing properties. Events sent by hand-written code often omit fields. Test with an event that has no
product_name. - Over-personalising. "We saw you looking at size 9 boots at 11:42 pm" is accurate and unsettling. Refer to the interest, not the surveillance.
Choosing between profile fields and events
| Use | Good for | Risk |
|---|---|---|
| Profile field (plan, city) | Stable facts, long-term content | Goes out of date if not updated |
| Recent event (cart, view) | Timely, relevant triggers | Stale or incomplete quickly |
| Summary field (last purchase date) | Simple rules without raw events | Depends on the sync running correctly |
Summary fields are often the safest option. A "last purchase date" field is easier to test and explain than a raw event stream.
Checklist before sending
- Confirm the consent basis for each event you use.
- Set a freshness window on the trigger or segment.
- Add an exit condition for goals already completed.
- Provide a generic fallback branch.
- Preview with a contact who has no events.
Exercise
A "viewed product" event triggers an email, but some recipients bought the product an hour before the email sent. Name two changes that reduce this problem.
Show answer
Add an exit condition that cancels the send if a purchase event exists after the view, and add a short delay or a check just before sending so late-arriving purchase events are counted. A freshness window on the trigger also helps.