API Reference

Complete API documentation with examples

Event Types
All supported event types and their properties
pageview
All Plans

Automatically tracked when a page loads. Includes URL, title, and referrer.

Properties: pageUrl, pageTitle, referrer
click
All Plans

User clicks on elements. Captures element details, position, and attributes.

Properties: element, position, attributes
form_submit
All Plans

Form submission events with form name and field information (PII filtered).

Properties: formName, fields
scroll
All Plans

Scroll depth tracking at 25%, 50%, 75%, and 100%.

Properties: depth, element
performance
All Plans

Web Vitals: FCP, LCP, FID, CLS, TTFB, load time, and more.

Properties: lcp, fid, cls, fcp, ttfb
custom
Standard+

Custom events with your own event names and properties.

Properties: name, properties
goal
Standard+

Goal tracking events from data-ed-goal attributes or JavaScript SDK.

Properties: name, properties
error
Standard+

JavaScript error tracking with stack traces and context.

Properties: message, stack, context
heartbeat
All Plans

Presence detection - sent every 30 seconds while page is visible.

REST API Endpoints

POST /api/events

Submit events to EventDash. Supports batch submission.

curl -X POST https://www.eventda.sh/api/events \
  -H "Content-Type: application/json" \
  -H "X-API-Key: ed_your_api_key" \
  -d '{
    "id": "batch_123",
    "sessionId": "session_abc",
    "anonymousId": "anon_xyz",
    "timestamp": 1234567890000,
    "compressed": false,
    "events": [...]
  }'

GET /api/validate

Validate an API key and check quota status.

curl -X GET https://www.eventda.sh/api/validate \
  -H "X-API-Key: ed_your_api_key"
Response Codes
200
Success - Events processed
400
Bad Request - Invalid request format
401
Unauthorized - Invalid API key
429
Too Many Requests - Rate limit exceeded
500
Internal Server Error
JavaScript SDK Methods
track(eventName, properties?)

Track a custom event with optional properties

trackPageView(url?, title?)

Optional: track a virtual page view (auto-tracked by default)

identify(userId, traits?)

Identify a user and associate traits

trackError(error, context?)

Manually track an error with optional context

flush()

Flush all pending events immediately