What is an Event
An event represents a single user action at a specific point in time. Every event includes: Event Name What happened (e.g.,page_view, purchase, button_clicked)
Timestamp
When it happened (ISO 8601 format)
User Identifier
Who did it (visitor ID, user ID, or both)
Properties
Additional data about the event (e.g., product ID, price, page URL)
Attribution Data
Marketing source information (UTM parameters, click IDs, referrer)
Event Structure
Every event DATALYR captures has this structure:Event Types
Automatic Events
DATALYR automatically tracks these events without code: page_view Fired when a user views a page. Captured automatically on every page load. session_start Fired when a new session begins (first visit or after 30 minutes of inactivity). session_end Fired when a session ends (user closes tab or 30 minutes of inactivity).Custom Events
Track specific user actions with custom events: Web:Conversion Events
Special events that represent business goals: purchase User completes a purchase (e-commerce). signup User creates an account. lead User submits contact information. subscribe User subscribes to a service or newsletter. add_to_cart User adds item to shopping cart. begin_checkout User starts checkout process.Event Properties
Properties add context to events. They can be anything relevant to the action:Standard Properties
Revenue Events:revenueoramount: Dollar amountcurrency: Three-letter code (USD, EUR, GBP)order_id: Unique order identifieritems: Array of products purchased
product_id: Product SKU or IDproduct_name: Product nameproduct_category: Category or typeproduct_price: Unit pricequantity: Number of items
page_url: Full page URLpage_path: URL path onlypage_title: Document titlereferrer: Previous page URL
email: User email addressname: User full nameuser_id: Internal user identifierplan: Subscription plan level
Custom Properties
Add any properties relevant to your business:- Use snake_case for property names
- Keep property names descriptive
- Use consistent naming across events
- Don’t include sensitive data (passwords, SSNs)
- Limit to 50 properties per event
Event Naming Conventions
Follow these conventions for consistent tracking:Use snake_case
Use past tense
Be specific
Standard Event Names
Use these standard names for common events: E-commerce:view_item: User views productadd_to_cart: Add item to cartremove_from_cart: Remove from cartbegin_checkout: Start checkoutadd_payment_info: Enter payment detailspurchase: Complete purchase
button_clicked: Any button clicklink_clicked: Link clickform_submitted: Form submissionsearch: Search queryshare: Content shared
video_played: Video playvideo_completed: Video finisheddownload: File downloadscroll_depth: Scroll milestone
Event Priority
DATALYR processes events with different priorities:Critical Events (Highest Priority)
Sent immediately, bypass batching:purchasesignupsubscribeleadconversion
High Priority Events
Sent in small batches (1-3 events):add_to_cartbegin_checkoutview_itemsearch
Standard Events
Batched for efficiency (up to 10 events):page_viewbutton_clickedscroll_depth- All other custom events
Event Processing
Client-Side Flow
- Event Captured User action triggers event (page view, button click, etc.)
- Properties Collected SDK gathers event properties, device info, page data
- Attribution Added UTM parameters, click IDs, and computed source/medium attached
- Queued Event added to batch queue (or sent immediately if critical)
- Sent to API Batch sent to ingest endpoint via POST request
- Confirmed Client receives 200 OK response
Server-Side Processing
- Event Received Ingest worker receives event batch
- Validated Schema validation, workspace verification
- Enriched Geo-IP data, device parsing, user agent parsing
- Attribution Computed Attribution models applied (first-click, last-click, hybrid)
- Stored Written to Tinybird data warehouse
- Indexed Made available for queries and reports
Event Deduplication
DATALYR automatically deduplicates events using: Event ID Unique identifier for each event (automatically generated or provided). Timestamp Window Events with same name, user, and timestamp within 1 second are deduplicated. Property Matching Events with identical properties within the time window are merged. Provide Event IDs for Server-Side Tracking:Offline Events
Events are queued when offline and sent when connection restores: Automatic Queue Events saved to localStorage when offline. Auto-Retry Queue processed when online status detected. Max Queue Size 100 events max (oldest dropped if exceeded). Manual FlushEvent Validation
Events are validated before sending: Required Fields:event_name(string, 1-255 chars)timestamp(ISO 8601 string or Unix milliseconds)visitor_idoruser_id(at least one required)
- Max 50 properties per event
- Property names: 255 chars max
- Property values: 10KB max
- Total event size: 50KB max
Next Steps
Visitor Identification
Learn how DATALYR identifies users
Identity Calls
Link users across devices
Properties and Metadata
Add context to events
Attribution Models
How conversions are attributed