Events API
Send events to Grometrics from servers, workers, or custom clients.
Last updated June 3, 2026
Use the Events API when the browser or mobile SDK is not the right place to send an event. Server-side events are useful for purchases, refunds, renewals, backend conversions, and trusted custom events.
Replace YOUR_SITE_ID with your site ID from Settings > Tracking.
POST /api/events
1curl https://api.usegrometrics.com/events \2-H "Authorization: Bearer YOUR_API_KEY" \3-H "Content-Type: application/json" \4-d '{5"websiteId": "YOUR_SITE_ID",6"type": "revenue",7"visitorId": "vis_8kF3mNx92pL",8"amount": 14900,9"currency": "USD",10"timestamp": "2026-06-03T10:00:00Z"11}'
Options / Configuration
| Option | Type | Required | Description |
|---|---|---|---|
| websiteId | string | ✓ | Your Grometrics site ID |
| type | string | ✓ | pageview, custom_event, revenue, refund, renewal, screen_view, or push_opened |
| visitorId | string | no | Visitor identity to attach the event to |
| sessionId | string | no | Session identity when known |
| timestamp | string | ✓ | ISO timestamp for when the event occurred |
| properties | object | no | Extra event fields for filtering and context |
What happens next
Send one test event, then open Realtime and confirm the event arrives with the expected timestamp and visitor context.
Troubleshooting
Event is rejected
Check the API key, websiteId, event type, and timestamp format.
Event appears unattributed
Include visitorId or sessionId so the event can connect to a known journey.
Was this page helpful?