Custom Events
Track custom events to measure conversions, user engagement, and chatbot effectiveness.
What Are Custom Events?
Custom events let you track specific user actions and outcomes beyond standard metrics:
Purchase completed
E-commerce conversions
Demo scheduled
Lead qualification
Feature explored
Product discovery
Support resolved
Customer success
Document downloaded
Content engagement
Pricing viewed
Sales intent signals
JavaScript API
Track Event
// Basic event
window.Chatmefy.track('button_clicked', {
button_name: 'Schedule Demo',
page: '/pricing'
});
// Conversion event with value
window.Chatmefy.track('purchase_completed', {
order_id: 'ORD-12345',
value: 299.00,
currency: 'USD',
items: ['Pro Plan']
});
// Lead qualification event
window.Chatmefy.track('demo_scheduled', {
meeting_date: '2024-01-20',
attendees: 3,
company_size: '50-100'
});Method Signature
Chatmefy.track(eventName: string, properties?: object): voideventName Required. Event identifier (snake_case recommended)
properties Optional. Key-value pairs with event data
Server-Side Events
Track events from your backend for sensitive or server-triggered actions:
POST /v1/events
curl -X POST "https://api.chatmefy.com/v1/events" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"event": "subscription_upgraded",
"conversation_id": "conv_abc123",
"visitor_id": "vis_xyz789",
"properties": {
"plan": "enterprise",
"mrr": 499,
"previous_plan": "pro"
},
"timestamp": "2024-01-15T14:30:00Z"
}'Built-in Events
These events are tracked automatically by Chatmefy:
| Event | Triggered When | Properties |
|---|
Creating Event Funnels
Combine events to create conversion funnels and measure drop-off:
1 widget_opened 100%
2 pricing_viewed 45%
3 demo_scheduled 12%
4 purchase_completed 8%
Configure funnels in Dashboard → Analytics → Custom Funnels
Best Practices
Use consistent naming
Stick to snake_case: purchase_completed, not PurchaseCompleted
Include context
Add relevant properties like page, source, user_segment
Track meaningful events
Focus on business outcomes, not every click
Set monetary values
Include value and currency for revenue events
Use visitor IDs
Associate events with visitors for journey analysis