Getting Started
URL
Make requests to this URL to use the API:
https://track.crazyegg.com/api/v1
Authentication
You’ll need to enable the API for your site and generate a site API key. All API requests must include an Authorization
header, with a value in this format:
Authorization: key
For example:
Authorization: key 2YolaLxq2Uucziitirao4DijtluVtSEnDiFKyL5PY8A
(Note: the key in the above example is not real. Any requests made with that key will do nothing or return an error response.)
Sending Events
You can send events to the API by making HTTP POST requests to the API. The body of the request must be a JSON object. Currently, you can only send one kind of event: goal conversions.
Here is an example of sending a goal conversion from the command line with the curl
command.
curl \
--data-binary '{"goalConversions":[{"goalName":"my goal","userIdentifier":"user@example.com"}]}' \
--header 'Authorization: key 2YolaLxq2Uucziitirao4DijtluVtSEnDiFKyL5PY8A' \
https://track.crazyegg.com/api/v1
Goal Conversion Events
The goal conversion events you send to the API can have many different properties. Most of these properties are optional. You can send multiple conversions in one request.
object – top-level container object
{
array with at least 1 item and no more than 25 items
“goalConversions”:
[
object – A goal conversion event
{
string (required) – The name of the goal.
“goalName”: “added item to cart”,
string (required) – A string that uniquely identifies the user that triggered the goal conversion. This could be an account ID, an email address or anything else.
“userIdentifier”: “uid-54321”,
URL string (optional) – The page URL that the conversion occurred on.
“url”: “https://example.com/about”,
number (optional) – The monetary value of the conversion
“value”: 1.23,
string (optional) – The currency denomination of the conversion’s monetary value
“currency”: “USD”,
Allowed string values: any one of “AED”, “AFN”, “ALL”, “AMD”, “ANG”, “AOA”, “ARS”, “AUD”, “AWG”, “AZN”, “BAM”, “BBD”, “BDT”, “BGN”, “BHD”, “BIF”, “BMD”, “BND”, “BOB”, “BRL”, “BSD”, “BTN”, “BWP”, “BYR”, “BZD”, “CAD”, “CDF”, “CHF”, “CLP”, “CNY”, “COP”, “CRC”, “CUC”, “CVE”, “CZK”, “DJF”, “DKK”, “DOP”, “DZD”, “EEK”, “EGP”, “ERN”, “ETB”, “EUR”, “FJD”, “FKP”, “GBP”, “GEL”, “GHS”, “GIP”, “GMD”, “GNF”, “GQE”, “GTQ”, “GYD”, “HKD”, “HNL”, “HRK”, “HTG”, “HUF”, “IDR”, “ILS”, “INR”, “IQD”, “IRR”, “ISK”, “JMD”, “JOD”, “JPY”, “KES”, “KGS”, “KHR”, “KMF”, “KPW”, “KRW”, “KWD”, “KYD”, “KZT”, “LAK”, “LBP”, “LKR”, “LRD”, “LSL”, “LTL”, “LVL”, “LYD”, “MAD”, “MDL”, “MGA”, “MKD”, “MMK”, “MNT”, “MOP”, “MRO”, “MUR”, “MVR”, “MWK”, “MXN”, “MYR”, “MZM”, “NAD”, “NGN”, “NIO”, “NOK”, “NPR”, “NZD”, “OMR”, “PAB”, “PEN”, “PGK”, “PHP”, “PKR”, “PLN”, “PYG”, “QAR”, “RON”, “RSD”, “RUB”, “SAR”, “SBD”, “SCR”, “SDG”, “SEK”, “SGD”, “SHP”, “SLL”, “SOS”, “SRD”, “SYP”, “SZL”, “THB”, “TJS”, “TMT”, “TND”, “TRY”, “TTD”, “TWD”, “TZS”, “UAH”, “UGX”, “USD”, “UYU”, “UZS”, “VEB”, “VND”, “VUV”, “WST”, “XAF”, “XCD”, “XDR”, “XOF”, “XPF”, “YER”, “ZAR”, “ZMK”, “ZWR”
integer (optional) – Number of pages the user visited on the site before triggering the goal conversion.
“visitCount”: 3,
URL string (optional) – The first page the user visited on the site before triggering the goal conversion.
“landingPage”: “https://example.com/”,
URL string (optional) – The referrer URL that the user arrived at the site from.
“referrer”: “https://referrer.com/page”,
string (optional) – The two-character ISO country code associated with the user triggering the conversion.
“country”: “US”,
string (optional) – The user agent string of the user’s browser.
“userAgent”: “Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36”,
object (optional) – Google Analytics UTM parameters associated with the goal conversion
“utmParams”:
{
string
“source”: “utm source”,
string
“medium”: “utm medium”,
string
“term”: “utm term”,
string
“content”: “utm content”,
string
“campaign”: “utm campaign”
},
object (optional) – Up to five string values associated with the user or goal conversion
“customData”:
{
string
“1”: “any string value”,
string
“2”: “any string value”,
string
“3”: “any string value”,
string
“4”: “any string value”,
string
“5”: “any string value”
},
timestamp string in ISO 8601 format (optional) – Date and time that the goal conversion occurred.
“timestamp”: “2025-04-09T12:34:56-07:00”
}
]
}