Overview
The Session Activity endpoint provides detailed insights into individual user sessions, showing the complete timeline of events, page views, and interactions. Perfect for analyzing user behavior flows, debugging tracking issues, and understanding the customer journey within specific sessions.
Track every action a user takes during their visit - from page views and clicks to custom events and conversions - with full event properties and timestamps.
Endpoint
GET https://app.usehardal.com/api/websites/{signalId}/sessions/{sessionId}/activity
Authentication
Include your API key in the Authorization header:
Authorization: Bearer YOUR_API_KEY
Parameters
Parameter Type Required Default Description signalId
string Yes - Your website signal ID (URL path) sessionId
string Yes - Unique session identifier (URL path) targetSignalId
string No signalId Target signal ID for analytics data isHybrid
boolean No false Whether this is a hybrid/self-hosted signal orderBy
string No timestamp Field to order by: timestamp
, name
, type
order
string No desc Sort order: desc
, asc
timezone
string No Europe/Istanbul Timezone for date calculations page
integer No 1 Page number for pagination (1-based) limit
integer No 50 Number of events to return per page
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.
Getting session IDs: Use the Sessions endpoint to retrieve session IDs, then drill down into individual sessions.
Start with analyzing a specific session:
Get all events for a specific session ordered by timestamp.
curl -X GET \
"https://app.usehardal.com/api/websites/${ SIGNAL_ID }/sessions/${ SESSION_ID }/activity?targetSignalId=${ SIGNAL_ID }&isHybrid=false&orderBy=timestamp&order=desc&timezone=Europe%2FIstanbul" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"
Response:
{
"events" : [
{
"id" : "evt_abc123456" ,
"type" : "pageview" ,
"name" : "page_view" ,
"timestamp" : "2024-01-15T10:35:00+03:00" ,
"url" : "https://example.com/products/item-1" ,
"path" : "/products/item-1" ,
"title" : "Product Details - Item 1" ,
"referrer" : "https://google.com/search" ,
"properties" : {
"utm_source" : "google" ,
"utm_medium" : "cpc" ,
"utm_campaign" : "summer_sale"
}
},
{
"id" : "evt_def789012" ,
"type" : "custom" ,
"name" : "add_to_cart" ,
"timestamp" : "2024-01-15T10:36:15+03:00" ,
"url" : "https://example.com/products/item-1" ,
"path" : "/products/item-1" ,
"title" : "Product Details - Item 1" ,
"referrer" : "" ,
"properties" : {
"product_id" : "item-1" ,
"product_name" : "Wireless Headphones" ,
"price" : 99.99 ,
"currency" : "USD" ,
"quantity" : 1
}
}
],
"totalCount" : 15 ,
"page" : 1 ,
"pageSize" : 50 ,
"hasMore" : false
}
Usage Examples
Complete Session Timeline
Get the full event timeline for a session to understand user behavior flow.
curl -X GET \
"https://app.usehardal.com/api/websites/${ SIGNAL_ID }/sessions/${ SESSION_ID }/activity?targetSignalId=${ SIGNAL_ID }&isHybrid=false&orderBy=timestamp&order=desc&timezone=Asia%2FIstanbul" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"
Response:
{
"events" : [
{
"id" : "evt_abc123456" ,
"type" : "pageview" ,
"name" : "page_view" ,
"timestamp" : "2024-01-15T10:35:00+03:00" ,
"url" : "https://example.com/products/item-1" ,
"path" : "/products/item-1" ,
"title" : "Product Details - Item 1" ,
"referrer" : "https://google.com/search" ,
"properties" : {
"utm_source" : "google" ,
"utm_medium" : "cpc" ,
"utm_campaign" : "summer_sale"
}
},
{
"id" : "evt_def789012" ,
"type" : "custom" ,
"name" : "add_to_cart" ,
"timestamp" : "2024-01-15T10:36:15+03:00" ,
"url" : "https://example.com/products/item-1" ,
"path" : "/products/item-1" ,
"title" : "Product Details - Item 1" ,
"referrer" : "" ,
"properties" : {
"product_id" : "item-1" ,
"product_name" : "Wireless Headphones" ,
"price" : 99.99 ,
"currency" : "USD" ,
"quantity" : 1
}
},
{
"id" : "evt_ghi345678" ,
"type" : "custom" ,
"name" : "purchase" ,
"timestamp" : "2024-01-15T10:42:30+03:00" ,
"url" : "https://example.com/checkout/success" ,
"path" : "/checkout/success" ,
"title" : "Order Confirmed" ,
"referrer" : "/checkout" ,
"properties" : {
"transaction_id" : "txn_789456123" ,
"total_amount" : 99.99 ,
"currency" : "USD" ,
"payment_method" : "credit_card" ,
"items" : [
{
"product_id" : "item-1" ,
"quantity" : 1 ,
"price" : 99.99
}
]
}
}
],
"totalCount" : 3 ,
"page" : 1 ,
"pageSize" : 50 ,
"hasMore" : false
}
Use Case: Complete user journey analysis, conversion funnel tracking
Get events with pagination for sessions with many interactions.
curl -X GET \
"https://app.usehardal.com/api/websites/${ SIGNAL_ID }/sessions/${ SESSION_ID }/activity?targetSignalId=${ SIGNAL_ID }&isHybrid=false&page=1&limit=20&timezone=Asia%2FIstanbul" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"
Response:
{
"events" : [
{
"id" : "evt_abc123456" ,
"type" : "pageview" ,
"name" : "page_view" ,
"timestamp" : "2024-01-15T10:35:00+03:00" ,
"url" : "https://example.com/home" ,
"path" : "/" ,
"title" : "Home Page" ,
"referrer" : "https://google.com/search" ,
"properties" : {
"utm_source" : "google" ,
"utm_medium" : "organic"
}
},
{
"id" : "evt_def789012" ,
"type" : "custom" ,
"name" : "click" ,
"timestamp" : "2024-01-15T10:35:30+03:00" ,
"url" : "https://example.com/home" ,
"path" : "/" ,
"title" : "Home Page" ,
"referrer" : "" ,
"properties" : {
"element" : "navigation-menu" ,
"text" : "Products" ,
"position" : "header"
}
}
],
"totalCount" : 45 ,
"page" : 1 ,
"pageSize" : 20 ,
"hasMore" : true
}
Use Case: High-activity sessions, detailed interaction analysis
Analyze session events in a specific timezone for accurate temporal analysis.
curl -X GET \
"https://app.usehardal.com/api/websites/${ SIGNAL_ID }/sessions/${ SESSION_ID }/activity?targetSignalId=${ SIGNAL_ID }&isHybrid=false&orderBy=timestamp&order=asc&timezone=America%2FNew_York" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"
Response:
{
"events" : [
{
"id" : "evt_abc123456" ,
"type" : "pageview" ,
"name" : "page_view" ,
"timestamp" : "2024-01-15T05:35:00-05:00" ,
"url" : "https://example.com/landing" ,
"path" : "/landing" ,
"title" : "Landing Page" ,
"referrer" : "https://facebook.com" ,
"properties" : {
"utm_source" : "facebook" ,
"utm_medium" : "social" ,
"utm_campaign" : "winter_promo"
}
}
],
"totalCount" : 8 ,
"page" : 1 ,
"pageSize" : 50 ,
"hasMore" : false
}
Use Case: Multi-timezone businesses, regional user behavior analysis
Order events by type to group similar interactions together.
curl -X GET \
"https://app.usehardal.com/api/websites/${ SIGNAL_ID }/sessions/${ SESSION_ID }/activity?targetSignalId=${ SIGNAL_ID }&isHybrid=false&orderBy=type&order=asc&timezone=Asia%2FIstanbul" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"
Response:
{
"events" : [
{
"id" : "evt_custom001" ,
"type" : "custom" ,
"name" : "form_submit" ,
"timestamp" : "2024-01-15T10:40:00+03:00" ,
"url" : "https://example.com/contact" ,
"path" : "/contact" ,
"title" : "Contact Us" ,
"referrer" : "/about" ,
"properties" : {
"form_name" : "contact_form" ,
"email" : "user@example.com" ,
"message_length" : 150
}
},
{
"id" : "evt_pageview001" ,
"type" : "pageview" ,
"name" : "page_view" ,
"timestamp" : "2024-01-15T10:35:00+03:00" ,
"url" : "https://example.com/home" ,
"path" : "/" ,
"title" : "Home Page" ,
"referrer" : "https://google.com" ,
"properties" : {
"utm_source" : "google"
}
}
],
"totalCount" : 12 ,
"page" : 1 ,
"pageSize" : 50 ,
"hasMore" : false
}
Use Case: Event type analysis, debugging specific interaction types
Response Fields
Main Data
events
: Array of event objects representing all activities in the session
totalCount
: Total number of events in this session
page
: Current page number (1-based)
pageSize
: Number of events per page
hasMore
: Whether there are more events available
Event Object
id
: Unique event identifier
type
: Event category (pageview, custom, click, form, etc.)
name
: Specific event name (page_view, purchase, add_to_cart, etc.)
timestamp
: Event occurrence time formatted in specified timezone
url
: Complete URL where the event occurred
path
: URL path where the event occurred
title
: Page title at the time of the event
referrer
: Referrer URL for this specific event
properties
: Custom event properties and tracking data
Event Properties
Event properties can include various types of data:
E-commerce Properties:
product_id
: Product identifier
price
: Product price
currency
: Currency code
quantity
: Item quantity
transaction_id
: Order identifier
Marketing Properties:
utm_source
: Traffic source
utm_medium
: Marketing medium
utm_campaign
: Campaign name
utm_content
: Ad content
utm_term
: Search terms
Custom Properties:
user_id
: Authenticated user ID
email
: User email address
form_name
: Form identifier
element
: Clicked element
category
: Event category
Any custom properties you send with events
The endpoint supports page-based pagination for sessions with many events:
# Get first page (events 1-20)
curl -X GET \
"https://app.usehardal.com/api/websites/${ SIGNAL_ID }/sessions/${ SESSION_ID }/activity?page=1&limit=20" \
-H "Authorization: Bearer YOUR_API_KEY"
# Get second page (events 21-40)
curl -X GET \
"https://app.usehardal.com/api/websites/${ SIGNAL_ID }/sessions/${ SESSION_ID }/activity?page=2&limit=20" \
-H "Authorization: Bearer YOUR_API_KEY"
# Get third page (events 41-60)
curl -X GET \
"https://app.usehardal.com/api/websites/${ SIGNAL_ID }/sessions/${ SESSION_ID }/activity?page=3&limit=20" \
-H "Authorization: Bearer YOUR_API_KEY"
Session activity queries are optimized for sessions with up to 1000 events
For very active sessions, use pagination with smaller page sizes (10-20 events)
Default page size of 50 events provides good balance between performance and completeness
Events are indexed by timestamp for fast chronological ordering
Consider filtering by event type when analyzing specific interactions