Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.ghostlyx.com/llms.txt

Use this file to discover all available pages before exploring further.

When to use server-side tracking

Use the Events API when:
  • You need to record a conversion that happens entirely on the server (for example, a payment confirmation received via webhook)
  • You are building a server-rendered application without a browser front-end
  • You want to guarantee an event is recorded even if the visitor’s browser blocks JavaScript

Endpoint

POST https://ghostlyx.com/api/event

Headers

HeaderValue
Content-Typeapplication/json
User-AgentThe visitor’s original User-Agent string

Request body

{
  "domain": "yourdomain.com",
  "name": "Purchase",
  "url": "https://yourdomain.com/checkout/success",
  "props": {
    "plan": "pro",
    "revenue": 49.99
  }
}
FieldRequiredDescription
domainYesThe domain as configured in GhostlyX
nameYesThe event name. Use pageview to record a pageview.
urlYesThe full URL where the event occurred
propsNoObject of string or number properties

Response

202 Accepted on success. No response body.

Example: cURL

curl -X POST https://ghostlyx.com/api/event \
  -H "Content-Type: application/json" \
  -H "User-Agent: Mozilla/5.0 ..." \
  -d '{
    "domain": "yourdomain.com",
    "name": "Purchase",
    "url": "https://yourdomain.com/checkout/success",
    "props": { "plan": "pro", "revenue": 49.99 }
  }'

Connecting to goals

Server-side events are matched to Custom event goals by event name, the same as client-side events.