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:

  1. Go to Settings > Custom Events
  2. Click “New Custom Event”
  3. Configure event properties
  4. 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 values
  • number - Numeric values
  • boolean - True/false values
  • datetime - Timestamps
  • url - 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

  1. Navigate to Goals in dashboard
  2. Click “New Goal”
  3. Select trigger event
  4. Define success criteria
  5. 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

  1. Plan your events - Map business objectives to events
  2. Use consistent naming - Follow a naming convention
  3. Document events - Maintain event documentation
  4. Test thoroughly - Verify events fire correctly
  5. Monitor regularly - Check event data quality

Next Steps

Documentation