Get started
Events
A pageview is recorded for you. An event is something you decide to record, such as a signup, a download or an upgrade.
From the browser
The tracking script exposes a track function on the window. Call it after the action happens, with the name of the event and, if it helps, a small set of properties.
window.aback.track("signup_completed", { plan: "pro" });The script batches events and sends them a moment later, so calling track in a click handler does not slow the click down. Every event carries an identifier of its own and the server stores each identifier once, so the same event is never counted twice.
From your server
Use the server-side event API for anything that happens on your backend: a signup that completes in a webhook, a trial that starts, a job that finishes. The request needs an API key with the events:write scope, sent as a bearer token, and the website id in the body.
curl -X POST https://abackanalytics.com/api/v1/events \
-H "Authorization: Bearer abk_xxxxxxxx.secret" \
-H "content-type: application/json" \
-d '{
"websiteId": "abk_xxxxxxxxxxxxxxxx",
"event": "signup_completed",
"properties": { "plan": "pro" }
}'{
"ok": true,
"data": {
"eventId": "evt_9f2c41b7ac0d4e6f8a1b",
"status": "accepted"
}
}The status is accepted for a new event. A repeated event id comes back as duplicate and is not counted twice. The full contract is in the API reference.
Event names
- Between 1 and 64 characters long.
- Start with a letter or a number. After that, letters, numbers, dot, underscore, colon and dash are allowed.
- Names are case sensitive, so Signup and signup are two different events.
- Use a consistent convention. Snake case with a verb first reads well in reports.
- A name that starts with a double underscore is rejected.
Reserved names
These names belong to the product. A custom event may not use them, so a customer event can never be mistaken for a billing event:
payment
revenue
subscription
refund
chargeback
__aback_internalProperties
- At most 20 properties per event.
- A property key is at most 40 characters long.
- A string value is at most 256 characters long. Longer values are truncated.
- A value must be a string, a number, a boolean or null. Objects and arrays are dropped rather than stored.
- The whole property payload is at most 4096 bytes.
- Properties are stored as they are. They are never executed or evaluated.
Sensitive keys are dropped
A property whose key looks sensitive is removed before the event is stored. The comparison ignores case and separators, so api_key, apiKey and API-KEY all match. The list is:
password
passwd
secret
token
access token
refresh token
id token
api key
authorization
auth header
cookie
session id
credit card
card number
cvv
cvc
pin
ssn
social security number
email
email address
phone number
dob
date of birthKeys that start with a double underscore are dropped as well. If a property you expect to see in a report is missing, check the key first.
Turning an event into a goal
A goal is a name for an event name or a page path. Once the goal exists, the dashboard reports the conversions, the converting visitors and the conversion rate for it, and the goal can be broken down by source, landing page, device and country.