Hardal Analytics stores event data across three core tables using ClickHouse for high-performance analytics.
Core Tables
website_event
event_data
session_data
Primary event table - stores all user interactions and page viewsUser session identifier (cookieless)
Domain name where event occurred
Browser name (Chrome, Firefox, Safari)
Operating system (Windows, macOS, Linux)
Device type: desktop, mobile, tablet
Screen resolution (1920x1080)
Browser viewport dimensions
Browser language (en-US, fr-FR)
Country code (ISO 3166-1)
User timezone (America/New_York)
Event type: pageview or event
Event name (page_view, click, form_submit)
Table is partitioned by month for optimal query performance
Custom event properties - flexible schema for event attributesUnique data entry identifier
References main event in website_event table
Path where event occurred
Value type: 1 = string, 2 = number, 3 = date
Use this table to store custom event properties without schema changes
Session attributes - user properties that persist across eventsUnique session data identifier
Value type: 1 = string, 2 = number, 3 = date
Engine: ReplacingMergeTree - automatically handles session data updates
Data Relationships
Event Creation
Each user interaction creates a record in website_event with a unique event_id
Custom Properties
Additional event properties are stored in event_data linked by event_id
Session Attributes
User session properties are stored in session_data linked by session_id
Sessions are cookieless and identified using server-side fingerprinting techniques
Query Examples
Event Query
Custom Properties
Session Analysis
SELECT
event_name,
url_path,
COUNT ( * ) as event_count
FROM website_event
WHERE website_id = 'your_website_id'
AND created_at >= '2024-01-01'
GROUP BY event_name, url_path
ORDER BY event_count DESC ;