Set up behavioral segmentation triggers by mapping event properties to list filters and linking them to flow entry conditions in Klaviyo or ActiveCampaign.
1. Define target behaviors – e.g., product view, add‑to‑cart, email open, link click. Record each as a custom event via the platform SDK or API.
2. Create the segment
- Klaviyo: Lists & Segments → Create List → Segment → Condition: What someone has done > Viewed Product > at least once in the last 30 days (use AND/OR for multiple events).
- ActiveCampaign: Automation → New Automation → Start Trigger → Event is recorded → select event name → add If/Else conditions (e.g., Tag is added).
3. Attach segment to a flow
- Klaviyo: Open the Flow → Settings → Trigger → select the segment you just built.
- ActiveCampaign: Drag the Start node onto the canvas, choose the event trigger, then connect to subsequent email actions.
4. Validate – In Klaviyo use Test Segment to preview members; in ActiveCampaign click Test and send a preview email to an internal address.
5. Automate event ingestion – push events from your site or CRM.
Quick comparison
| Feature | Klaviyo | ActiveCampaign |
|---|---|---|
| Real‑time capture | Webhooks, API v1/v2 | Site tracking, API v3 |
| Segment limit | 100 per account | 250 per account |
| Conditional depth | Up to 5 nested AND/OR | Unlimited nested branches |
# Example: send a Klaviyo event via Python
import requests, json
api_key = "YOUR_PRIVATE_API_KEY"
url = "https://a.klaviyo.com/api/v1/track"
payload = {
"token": "PUBLIC_API_TOKEN",
"event": "Viewed Product",
"customer_properties": {"$email": "user@example.com"},
"properties": {"Product ID": "12345"},
"time": "2026-08-23T12:34:56Z"
}
requests.post(url, data=json.dumps(payload), headers={"Content-Type": "application/json", "Authorization": f"Klaviyo-API-Key {api_key}"})Gotcha: Klaviyo and ActiveCampaign expect timestamps in UTC ISO‑8601; sending local time will cause the segment to miss recent events and break the trigger logic.