Events
Events represent actions or occurrences in your application that are associated with a subscriber. They’re the foundation for behavioral automation and analytics.
What Are Events?
Events are timestamped records of something that happened:
{
"email" : "[email protected] " ,
"event" : "purchase_completed" ,
"properties" : {
"orderId" : "order_12345" ,
"amount" : 99.99 ,
"product" : "Pro Plan" ,
"currency" : "USD"
}
}
Unlike tags (which represent current state), events represent what happened and when .
Aspect Events Tags Purpose Track occurrences Categorize subscribers Multiple Can have many of same event Only one instance per tag Time Timestamped No timestamp Data Can carry properties No additional data Use case ”User purchased 3 times" "User is a customer”
Use events when:
The action can happen multiple times
You need to track when it happened
You want to attach properties/metadata
You’re building analytics
Use tags when:
You’re categorizing subscribers
You need to segment for campaigns
You want simple presence/absence logic
Built-in Events
Sequenzy recognizes these built-in event types:
SaaS Events
Event Description saas.purchaseCustomer made a purchase saas.payment_failedPayment attempt failed saas.cancelledSubscription cancelled saas.churnCustomer churned (end of cancelled period) saas.refundRefund processed saas.upgradePlan upgraded saas.downgradePlan downgraded saas.trial_startedTrial period started saas.trial_endedTrial period ended
Event Description contact.subscribedSubscribed to communications contact.unsubscribedUnsubscribed from communications
Email Events
Event Description email.openedOpened an email email.clickedClicked a link in email email.repliedReplied to an email email.bouncedEmail bounced
Built-in events automatically apply sync rules when triggered.
Custom Events
Create your own events for any action in your application:
curl -X POST "https://api.sequenzy.com/api/v1/subscribers/events" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"email": "[email protected] ",
"event": "feature_used",
"properties": {
"feature": "export",
"format": "csv",
"rowCount": 1500
}
}'
Common Custom Events
Product engagement:
feature_used
project_created
file_uploaded
report_generated
User lifecycle:
onboarding_completed
first_value_moment
invited_team_member
E-commerce:
product_viewed
cart_updated
checkout_started
review_submitted
Content:
article_read
video_watched
course_completed
Event Properties
Properties are key-value data attached to events:
{
"event" : "order_placed" ,
"properties" : {
"orderId" : "ord_abc123" ,
"total" : 149.99 ,
"currency" : "USD" ,
"items" : [ "Product A" , "Product B" ],
"couponUsed" : "SAVE20" ,
"isFirstOrder" : true
}
}
Property Types
Properties can be:
Strings : "product": "Pro Plan"
Numbers : "amount": 99.99
Booleans : "isFirstPurchase": true
Arrays : "tags": ["new", "featured"]
Objects : "metadata": { "source": "web" }
Using Properties in Sequences
Properties can be accessed in sequence conditions and personalization:
Condition: event.properties.amount > 100
Action: Send "high-value-purchase" email
Triggering Events
Single Event
curl -X POST "https://api.sequenzy.com/api/v1/subscribers/events" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"email": "[email protected] ",
"event": "purchase_completed",
"properties": {
"orderId": "order_123",
"amount": 99.99
}
}'
Multiple Events (Bulk)
curl -X POST "https://api.sequenzy.com/api/v1/subscribers/events/bulk" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"email": "[email protected] ",
"events": [
{
"event": "page_viewed",
"properties": { "page": "/pricing" }
},
{
"event": "feature_used",
"properties": { "feature": "calculator" }
}
]
}'
Auto-Creation
When you trigger an event:
Subscriber is created if they don’t exist
Event definition is created if it’s new
Sync rules are applied (tags added/removed)
Automations are triggered if matching
Events and Sync Rules
Events can automatically modify tags through sync rules:
Event: saas.purchase
→ Add tags: "customer"
→ Remove tags: "lead", "trial", "past-due"
Configure Sync Rules Set up automatic tagging based on events
Events in Sequences
Trigger: Event Received
Start a sequence when an event occurs:
Trigger: event_received "purchase_completed"
│
▼
┌─────────────────┐
│ Thank You Email │
└─────────────────┘
│
▼
┌─────────────────┐
│ Wait 3 days │
└─────────────────┘
│
▼
┌─────────────────┐
│ Feedback Email │
└─────────────────┘
Wait For Event
Pause execution until an event occurs:
┌─────────────────────┐
│ Send Onboarding │
│ Email #1 │
└─────────────────────┘
│
▼
┌─────────────────────┐
│ Wait for Event: │
│ "onboarding_done" │
│ Timeout: 7 days │
└─────────────────────┘
│
├── Event received ──────┐
│ │
▼ ▼
┌─────────────┐ ┌─────────────┐
│ Send Tips │ │ Send Help │
│ Email │ │ Email │
└─────────────┘ └─────────────┘
Condition: Check Event Properties
Branch based on event data:
┌─────────────────────────┐
│ Condition: │
│ event.properties.amount │
│ > 500 │
└─────────────────────────┘
│
┌────┴────┐
│ │
Yes No
│ │
▼ ▼
┌─────────┐ ┌─────────┐
│ VIP │ │ Standard│
│ Email │ │ Email │
└─────────┘ └─────────┘
Integration Examples
E-commerce Purchase
// After successful payment
await fetch ( "https://api.sequenzy.com/api/v1/subscribers/events" , {
method: "POST" ,
headers: {
Authorization: `Bearer ${ API_KEY } ` ,
"Content-Type" : "application/json" ,
},
body: JSON . stringify ({
email: order . customerEmail ,
event: "saas.purchase" ,
properties: {
orderId: order . id ,
amount: order . total ,
currency: order . currency ,
products: order . items . map (( i ) => i . name ),
isFirstOrder: customer . orderCount === 1 ,
},
customAttributes: {
lastOrderDate: new Date (). toISOString (),
totalSpent: customer . totalSpent ,
},
}),
});
Feature Activation
// When user completes onboarding
await fetch ( "https://api.sequenzy.com/api/v1/subscribers/events" , {
method: "POST" ,
headers: {
Authorization: `Bearer ${ API_KEY } ` ,
"Content-Type" : "application/json" ,
},
body: JSON . stringify ({
email: user . email ,
event: "onboarding_completed" ,
properties: {
completedSteps: [ "profile" , "integration" , "first-project" ],
timeToComplete: "2 days" ,
},
}),
});
Subscription Lifecycle
// Stripe webhook handler
switch ( event . type ) {
case "customer.subscription.created" :
await triggerEvent ( email , "saas.purchase" , {
plan: subscription . plan . nickname ,
amount: subscription . plan . amount / 100 ,
interval: subscription . plan . interval ,
});
break ;
case "customer.subscription.deleted" :
await triggerEvent ( email , "saas.cancelled" , {
reason: subscription . cancellation_details ?. reason ,
feedback: subscription . cancellation_details ?. feedback ,
});
break ;
case "invoice.payment_failed" :
await triggerEvent ( email , "saas.payment_failed" , {
invoiceId: invoice . id ,
attemptCount: invoice . attempt_count ,
});
break ;
}
Event Analytics
Events are stored and available for analysis:
Event counts : How many times an event occurred
Time series : Events over time
Subscriber timeline : All events for a subscriber
Funnel analysis : Conversion between events
Best Practices
1. Use Consistent Naming
✓ "order.placed", "order.shipped", "order.delivered"
✓ "feature.used", "feature.activated"
✗ "order_placed", "OrderShipped", "order-delivered"
2. Include Relevant Properties
✓ Event: "purchase_completed"
Properties: { orderId, amount, products, isFirstOrder }
✗ Event: "purchase_completed"
Properties: {} (missing context)
3. Don’t Over-Event
Track meaningful actions, not every click:
✓ "checkout_started", "checkout_completed"
✗ "button_clicked", "page_scrolled" (too granular)
✓ Event: "feature_used" (track usage patterns)
Tag: "power-user" (segment for campaigns)
✗ Tag: "used-feature-jan", "used-feature-feb" (tag per occurrence)