The Overcentric HTTP API allows you to send events directly from your server-side environment. This is particularly useful for tracking sensitive events, critical business logic, or for ensuring data is captured reliably without being affected by ad blockers or browser issues.
Events are sent as a POST request to the following endpoint:
https://app.overcentric.com/api/v1/event
The request body should be a single JSON object with the event
and optional identity
objects at the top level.
JSON
{ "event": { "name": "event_name", "properties": { "key": "value" }, "project_id": "your-project-id", "device_id": "unique-device-id", "session_id": "current-session-id", "context": "website", "url": "current-page-url", "hostname": "current-hostname" }, "identity": { "unique_identifier": "their_unique_id", "email": "email@example.com", "name": "Name Lastname", "project_id": "project_id" }}
name
: The name of the event you are tracking. Please refer to "Custom Event Tracking & Reserved Names" section in this article for a list of reserved names and "Naming Your Custom Events" for event naming best practices in the same article.
properties
: A flexible JSON object to include any custom data you want to associate with the event.
project_id
: Your unique Project ID. You can find this value in your Overcentric dashboard.
device_id
: The unique identifier for the user's device. For a complete user journey, this value should be retrieved from the browser using window.overcentricDeviceId
and passed to your backend.
session_id
: The unique identifier for the user's current session. Similar to the device_id
, you should pass this from the browser, where it can be retrieved using window.overcentricSessionId
.
context
: The environment where the event is being tracked. This should be either "website"
or "product"
.
url
: The URL of the page where the event occurred.
hostname
: The hostname of the page where the event occurred.
If a user has been identified, you can send their information along with the server-side event for a complete view of their activity. The identity
object is optional and should be included at the top level of the request body, alongside the event
object.
unique_identifier
: A unique ID for the user. This is a required field within the identity
object.
email
: The user's email address.
name
: The user's name.
project_id
: Your project's ID, which should match the project_id
in the event
object.
This example shows a server-side event for a subscription purchase, including both the event
and identity
objects.
curl --location 'https://app.overcentric.com/api/v1/event' \--header 'Content-Type: application/json' \--data '{ "event": { "name": "$subscription_purchase", "properties": { "plan": "premium", "price": 9.99 }, "project_id": "your-project-id", "device_id": "grab-from-client", "session_id": "grab-from-client", "context": "product", "url": "https://app.example.com/checkout/success", "hostname": "app.example.com" }, "identity": { "unique_identifier": "user_123", "email": "user@example.com", "name": "Name Lastname", "project_id": "your-project-id" }}'