Documentation · Getting started

Talk to your dataover HTTP

One script tag to collect, one API key to read. Everything the dashboard shows is available as JSON, so your own tools and AI agents can ask the same questions.

Install the script

Include this code in the <head> or <body> section of your website. It loads asynchronously and never blocks rendering.

HTML
<script data-host="https://anltcs.com" data-dnt="false" src="https://anltcs.com/js/script.js" id="anltcs-tracker" async defer></script>
data-host Where the script sends data. Already set to this installation.
data-dnt Set to true to respect the browser's Do Not Track signal and skip those visitors.
Single-page apps Route changes that update the URL are tracked automatically as new pageviews.

Custom events

Events can be tracked using the anltcs.track() JavaScript function. The anltcs.track() function accepts an object as the argument. Values with a unit are summed in the Events report, so revenue and conversions land next to your traffic.

Simple event
anltcs.track({name: 'Subscription'})
Event with a value
anltcs.track({name: 'Payment', value: 5, unit: 'USD'})
Parameter
Type
Description
name
required string
Event name, for example Subscription or Add to cart.
value
optional number
Numeric value attached to the event.
unit
optional string
Unit of the value, for example a currency code.

Authentication

The API key should be sent as a Bearer token in the Authorization header of the request. Every request must also accept JSON. Log in to get your API key.

BASEhttps://anltcs.com/api/v1
Request example
curl 'https://anltcs.com/api/v1/account' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {api_key}'
Keys are per accountOne key gives access to every website in the account. Rotate it from the dashboard if it leaks.
HTTPS onlyRequests over plain HTTP are redirected and the key in them should be considered exposed.

Errors & limits

Errors come back as JSON with a message and the HTTP status. The API is limited to 60 requests per minute per key; when you hit the limit the response is 429 and the Retry-After header tells you how long to wait.

Not found404
{
    "message": "Resource not found.",
    "status": 404
}
No API access on this plan403
{
    "message": "You don't have access to this feature.",
    "status": 403
}
200Success
401Missing or invalid API key
403Your plan does not include API access
404Resource not found
422Validation failed, see errors in the body
429Too many requests