Overview

Event endpoints provide access to detailed event data, allowing you to analyze user interactions, custom events, and conversion tracking.

Event Endpoints

Usage Examples

Get All Events for a Time Period

GET /api/websites/abc123/events?startDate=2023-05-01&endDate=2023-05-15&limit=100

Get Events by Type

GET /api/websites/abc123/events?eventName=purchase&limit=50

Get Event Counts Grouped by Event Name

GET /api/websites/abc123/events?groupBy=event

Get E-commerce Purchase Data

GET /api/websites/abc123/event-data?eventName=purchase&sortBy=created_at&sortDir=desc

Extract Transaction IDs from Purchase Events

GET /api/websites/abc123/event-data/fields?eventName=purchase&groupBy=transaction_id

Get Revenue Data with Value Filtering

GET /api/websites/abc123/event-data?eventName=purchase&minValue=50&maxValue=500&currency=USD

Get Unique Currency Values

GET /api/websites/abc123/event-data/values?eventName=purchase&property=currency

Event Property Filtering

You can filter events by their custom properties:

Filter by Simple Property

GET /api/websites/abc123/event-data?property=button_text&propertyValue=Sign%20Up

Filter by Nested Property

Use dot notation for nested properties:

GET /api/websites/abc123/event-data/fields?groupBy=items_item_0_item_id

Filter by Value Range

For numeric properties:

GET /api/websites/abc123/event-data?eventName=purchase&minValue=100&maxValue=1000

Sorting Options

Sort events by various fields:

  • created_at: Event timestamp (default)
  • event_name: Event name alphabetically
  • value: Numeric value (for e-commerce events)
  • session_id: Session identifier

Sort Direction:

  • asc: Ascending order
  • desc: Descending order (default)

Common Event Analysis Patterns

Conversion Funnel Analysis

# Step 1: Get page views
GET /api/websites/abc123/events?eventName=page_view&url=/product

# Step 2: Get add to cart events
GET /api/websites/abc123/events?eventName=add_to_cart

# Step 3: Get purchase events
GET /api/websites/abc123/events?eventName=purchase

User Journey Analysis

# Get all events for a specific session
GET /api/websites/abc123/events?sessionId=session123&sortBy=created_at&sortDir=asc

Revenue Analysis

# Get total revenue by extracting values
GET /api/websites/abc123/event-data/fields?eventName=purchase&groupBy=value

# Get revenue by product
GET /api/websites/abc123/event-data/fields?eventName=purchase&groupBy=items_item_0_item_name