Analytics & Reports
Analytics & Reporting
Track user behavior and generate reports with the analytics API.
POST/analytics/log
Logs an analytics event for tracking user behavior.
Request Body
{
"event": "page_view",
"userID": 123,
"sessionID": "session_abc123",
"properties": {
"page": "/products/wireless-headphones",
"referrer": "https://google.com",
"device": "mobile",
"browser": "Chrome"
},
"timestamp": "2024-01-01T12:00:00Z"
}
Success Response (200 OK)
{
"status": "Success",
"message": "Event logged successfully"
}
GET/report/eventBookings/:id
Generates a report of event bookings.
URL Parameters
-
id
number
required
Event ID for the booking report.
Query Parameters
-
startDate
string
Start date for the report (ISO 8601 format).
-
endDate
string
End date for the report (ISO 8601 format).
Success Response (200 OK)
{
"status": "Success",
"data": {
"eventID": 1,
"eventName": "Annual Conference 2024",
"totalBookings": 450,
"totalRevenue": 45000.00,
"bookings": [
{
"bookingID": 1001,
"customerName": "John Doe",
"ticketType": "VIP",
"amount": 150.00,
"bookingDate": "2024-01-01T10:00:00Z"
}
]
}
}