Overview

The Events endpoint provides access to detailed event data from your website analytics. Track custom events, page views, and user interactions with powerful filtering, grouping, and pagination capabilities.

Perfect for analyzing user behavior, conversion funnels, and custom event tracking across your website.

Endpoint

GET https://app.usehardal.com/api/websites/{signalId}/events

Authentication

Include your API key in the Authorization header:

Authorization: Bearer YOUR_API_KEY

Parameters

ParameterTypeRequiredDefaultDescription
signalIdstringYes-Your website signal ID (URL path)
timeframestringNocustomTime period: today, yesterday, last7days, last30days, custom
startDatestringNo-Start date for timeframe (ISO format)
endDatestringNo-End date for timeframe (ISO format)
timezonestringNoEurope/IstanbulTimezone for date calculations (e.g., Asia/Istanbul)
groupBystringNo-Group results: event, date
limitintegerNo1000Number of events to return (pagination)
offsetintegerNo0Number of events to skip (pagination)
targetSignalIdstringNosignalIdTarget signal ID for analytics data
isHybridbooleanNofalseWhether this is a hybrid/self-hosted signal
eventNamestringNo-Filter by specific event name
sessionIdstringNo-Filter by specific session ID

Quick Start

Environment Setup

Finding your signal ID: Go to your Hardal dashboard → select your project → view the signal ID.

Finding your API key: Go to your Hardal dashboard → select your signal → Settings → Security.

Start with a simple request:

Usage Examples

Response Fields

Event Object

  • id: Unique event identifier
  • website_id: Website/signal ID
  • session_id: Session identifier
  • hostname: Website hostname
  • browser: Browser name (Chrome, Safari, Firefox, etc.)
  • os: Operating system (Windows, macOS, Linux, etc.)
  • device: Device type (Desktop, Mobile, Tablet)
  • country: Country name
  • url: Page URL where event occurred
  • referrer: Referrer URL
  • page_title: Page title
  • event_type: Event type (pageview, custom, etc.)
  • event_name: Specific event name
  • created_at: Event timestamp

Pagination Object

  • total: Total number of events available
  • limit: Number of events requested
  • offset: Number of events skipped
  • hasMore: Whether there are more events available
  • totalPages: Total number of pages available
  • currentPage: Current page number (1-based)

Event Count Object (when groupBy=event)

  • name: Event name
  • count: Total number of occurrences
  • unique_visitors: Number of unique visitors who triggered this event

Pagination

The events endpoint supports pagination through limit and offset parameters:

Timeframe Options

  • today: Current day from 00:00 to now
  • yesterday: Previous day (full 24 hours)
  • last7days: Last 7 days including today
  • last30days: Last 30 days including today
  • custom: Custom date range (requires startDate and endDate)

Usage Notes

Performance: Default limit is 1000 events if not specified. For large datasets, use pagination to avoid timeouts.

Ordering: Events are ordered by created_at timestamp in descending order (newest first).

Grouping: When groupBy=event is used, individual events are not returned; only event counts.

  • The timezone parameter affects how dates are interpreted and returned
  • All timestamps in responses are formatted according to the specified timezone
  • Pagination uses 1-based page numbering in the response
  • Large datasets may require multiple paginated requests to retrieve all events