Custom Events
Create and configure custom events tailored to your business needs.
Overview
Custom events allow you to track specific actions unique to your application or business model.
Creating Custom Events
Define custom events in your Deepns dashboard:
- Go to Settings > Custom Events
- Click “New Custom Event”
- Configure event properties
- Save and deploy
Event Configuration
Event Schema
Define the structure of your custom events:
{
"name": "trial_started",
"display_name": "Trial Started",
"category": "conversion",
"properties": [
{
"name": "plan_type",
"type": "string",
"required": true
},
{
"name": "trial_days",
"type": "number",
"required": false
}
]
}
Property Types
Supported property types:
string- Text valuesnumber- Numeric valuesboolean- True/false valuesdatetime- Timestampsurl- Web addresses
Implementation
Track Custom Events
deepns.track('trial_started', {
plan_type: 'premium',
trial_days: 14
});
Server-Side Tracking
Use the REST API for server-side event tracking:
curl -X POST https://api.deepns.com/events \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"event": "trial_started",
"visitor_id": "visitor_123",
"properties": {
"plan_type": "premium",
"trial_days": 14
}
}'
Event Goals
Set up goals based on custom events:
Create a Goal
- Navigate to Goals in dashboard
- Click “New Goal”
- Select trigger event
- Define success criteria
- Activate goal
Goal Types
- Event occurrence - Triggered when event happens
- Event value - Triggered when event value meets threshold
- Event sequence - Triggered by series of events
Analytics & Reporting
Event Funnels
Create conversion funnels with custom events:
// Step 1: View pricing
deepns.track('pricing_viewed');
// Step 2: Start trial
deepns.track('trial_started', { plan: 'premium' });
// Step 3: Complete onboarding
deepns.track('onboarding_completed');
Dashboard will show conversion rates between steps.
Event Segmentation
Segment users based on event properties:
- Users who started premium trials
- Users with high engagement scores
- Users who completed specific actions
Examples
SaaS Application
// Feature usage tracking
deepns.track('feature_used', {
feature_name: 'advanced_analytics',
user_plan: 'enterprise'
});
// User milestone
deepns.track('milestone_reached', {
milestone: '100_sites_created',
account_age_days: 45
});
E-commerce
// Product viewed
deepns.track('product_viewed', {
product_id: 'SKU-123',
category: 'electronics',
price: 299.99
});
// Cart abandoned
deepns.track('cart_abandoned', {
cart_value: 450.00,
items_count: 3
});
Content Platform
// Article engagement
deepns.track('article_read', {
article_id: 'blog-post-42',
read_percentage: 75,
time_spent: 240
});
// Subscription action
deepns.track('newsletter_subscribed', {
source: 'article_footer',
topics: ['tech', 'analytics']
});
Best Practices
- Plan your events - Map business objectives to events
- Use consistent naming - Follow a naming convention
- Document events - Maintain event documentation
- Test thoroughly - Verify events fire correctly
- Monitor regularly - Check event data quality
Next Steps
- View Analytics Dashboard
- Explore Events API
- Learn about Rate Limits