Documentation Index
Fetch the complete documentation index at: https://mintlify.com/vemetric/vemetric/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The Event Ingestion API allows you to track events and pageviews from your backend services, mobile apps, or any environment where the JavaScript SDK cannot be used.Base URL
All event ingestion requests should be made to the Hub service:Authentication
Event ingestion uses your project token (not an API key). The project token is included in the request body.Your project token can be safely used in client-side code - it only allows sending events, not reading analytics data. Find your project token in Settings > Project Settings in the dashboard.
Track Event
Request Headers
Must be
application/jsonSet to
"true" to enable cookie-based user tracking. Defaults to "false".When making requests from a backend, set this to
"false" or omit it. Cookie-based tracking is primarily for browser environments.Request Body
Your project token (found in project settings).
Event name. Use
"$pageview" for pageviews or any custom event name.Examples: "signup", "purchase", "$pageview"Page URL. Required for pageview events (
$pageview) and outbound link events.Example: "https://example.com/blog/article"User identifier to associate this event with a specific user. Use this for server-side tracking of identified users.Example:
"user_123"User display name (e.g., name or email). Used to identify users in the dashboard.Example:
"John Doe" or "john@example.com"Custom event properties as key-value pairs. All values are converted to strings.Example:
Update user properties along with the event.
Context identifier for grouping related events (e.g., a page load context).
Response
Returns200 status code with an empty body on success.
Examples
Track Pageview
Track Custom Event
cURL
Track with User Properties
cURL
Identify User
Request Body
Your project token.
Unique user identifier.
User display name.
Example
cURL
Update User Properties
Request Body
Your project token.
Update user display name.
Update user avatar URL.
User properties to update.
Example
cURL
Special Events
Pageview Event
Event name:"$pageview"
Required fields:
url- The page URL
Outbound Link Event
Event name:"$outbound_link"
Required fields:
url- The current page URLcustomData.href- The outbound link URL
Error Handling
The event ingestion API returns different status codes:200- Success (event tracked)202- Accepted (identification in progress)400- Invalid request (missing required fields or validation errors)500- Server error
Validation Errors
If required fields are missing or invalid, the API returns400 with the text "Invalid!".
Example:
Best Practices
Always include user identifier - For backend tracking, include the
identifier field to associate events with usersUse consistent identifiers - Use the same identifier across all events for a user (e.g., user ID from your database)
Include display name - Set
displayName to make it easier to identify users in the dashboardUse descriptive event names - Name events clearly (e.g.,
"purchase_completed" instead of "event1")Server-Side SDKs
For easier integration, consider using the official server-side SDKs:- Node.js:
npm install @vemetric/node - Python:
pip install vemetric - PHP:
composer require vemetric/php - Ruby:
gem install vemetric
Related Documentation
JavaScript SDK
Client-side event tracking for web applications
Analytics Query API
Query your tracked events and analytics data