Create custom goals
POST https://datafa.st/api/v1/goals
Create a custom goal for a specific visitor. Requires Bearer Token authentication.
Request body
Send a JSON object with the following fields:
visitorId
(String, required): The unique ID of the visitor. It is stored in the visitor's browser cookies asdatafast_visitor_id
, making it accessible in your backend API endpoints.name
(String, required): Name for the goal (lowercase letters, numbers, underscores, max 32 chars). Spaces are converted to underscores.description
(String, optional): Description for the event.
A visitor needs to have at least one pageview before the goal can be created.
Response
- Success (200 OK): Returns a confirmation message and the ID of the created event.
- Errors: See API Introduction. A 400 occurs if the visitor is a bot. A 404 occurs if the visitor has no prior pageviews.