seline-logo
Public API
Endpoints
Data over time
Visits and pageviews
Charges
Counts and totals
Stats
Metrics
Custom events
Ingest data
Events

Ingest events

Currently we only support ingesting single events via our public script endpoint. It's the endpoint that our script uses to track page views and custom events from your website. It needs a project token instead of an API token.

POST
https://api.seline.com/s/e
Click anywhere to copy

Headers are as important as the request body. Make sure to send them exactly as described below for the event to be tracked correctly.

Headers

Origin
Required
A valid Origin header. Use your project's domain name here.
Seline-IP
Required
Client IP address. Used to identify the location the event happened on.
Seline-User-Agent
Required
Client User-Agent header. It's used to identify the device and browser the event happened on.
User-Agent
Required
Set this exactly to Seline v1, otherwise the request might be blocked by our security system.

Parameters

token
stringRequired
Project token. Could be found at General settings at the dashboard.
pathname
stringRequired if no name is provided
Tracked page pathname in a /support/getting-started format. UTM parameters, if present, will be extracted and added to the event data.
name
stringRequired if no pathname is provided
Custom event name. If pathanme is also provided, we'll use it as a page where the event happened. If `name` is provided, event type will be set to custom.
data
object
Custom event data. Needs to be a JSON object.
visitorId
string
Could be our internal visitor ID, which this request returns as a response, or your own User ID if it was previously set via .setUser() method.
referrer
string
Referrer URL. Needs to be a valid URL in a https://www.google.com format.
Example request
curl -X POST "https://api.seline.com/s/e" \
-H "Origin: https://www.example.com" \
-H "Seline-IP: 192.1.0.2" \
-H "Seline-User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36" \
-H "User-Agent: Seline v1" \
-d '{
"token": "PROJECT_TOKEN",
"pathname": "/support/getting-started",
"referrer": "https://www.google.com"
}'
Click anywhere to copy
Response
{
"visitorId": "1234567890", // our internal visitor ID
}
Click anywhere to copy