Skip to content

Collector reference

The collector receives events in Snowplow’s tracker protocol. Its payload fields, the payload_data envelope, self-describing events and entities are Snowplow’s, so any Snowplow tracker can send to it. For the fields, see Snowplow’s atomic event properties and example requests. This page covers EdgeKit’s paths and answers, and where EdgeKit reads the protocol differently.

The collector answers under /edgekit/, on your own domain through your mount and on your tenant host alike:

Path Sent by
/edgekit/a/t EdgeKit’s tracker, by default
/edgekit/a/i A pixel request, in EdgeKit’s spelling
/edgekit/com.snowplowanalytics.snowplow/tp2 A Snowplow tracker with no path configured
/edgekit/i A Snowplow pixel request

On your tenant host, the same four paths also answer without /edgekit, for trackers already pointed at a bare collector host.

The method decides how a request is read, on any of the four paths:

Method Request Answer
POST A JSON payload_data envelope holding 1 to 200 payloads 200, body ok
GET One payload in the query string 200, a 1×1 transparent GIF, Cache-Control: no-store
HEAD Nothing 200, no body. No event is recorded
OPTIONS A CORS preflight 204
Any other 400, method_not_supported
Status Means The tracker
200 Received Counts the event as sent
400 The request can never succeed Drops the event
503 The collector cannot judge events yet. Retry-After: 5 Sends it again later

A 400 or a 503 on these paths has an empty body and an x-edgekit-reason header. The one 400 with a body is a refused content telemetry document, on /edgekit/ctel only.

Reason Status Cause
unparseable 400 The body is not a JSON object, its data is not an array, or an element is not an object
wrong_envelope 400 The body cites no schema, or a schema other than Snowplow’s payload_data
empty 400 The envelope or the query string carries no payload
oversize 400 The body is larger than 1,000,000 bytes, or carries more than 200 payloads
unknown_path 400 A path that reaches the collector but is not one of the four above
method_not_supported 400 A method from none of the rows above
no_document 503 Your organization has no deployment yet
bundle_mismatch 503 The collector’s schemas do not match its own release
internal_error 503 A fault in the collector

Any other 503 reason is also a fault on EdgeKit’s side. The tracker resends the events once it clears.

An unknown path answers 400 rather than 404 so that the tracker drops the event instead of resending it forever. On these paths the collector never answers 401, 403, 404, 410 or 422. Its one 404 is the content telemetry manifest for a host that names none of your sites.

A 200 says the collector read the request. It does not say every event in it was valid: an event that fails its schema is kept as a bad row, and the other events in the same request are stored as normal. See Bad rows. The collector stores events after it answers.

Every 200 the collector sends to a POST or a GET has a body: ok, or the GIF. An empty 200 on an analytics path came from something else, such as a proxy or a cache.

EdgeKit’s tracker, like every Snowplow tracker, never retries an event answered 400, 401, 403, 410 or 422, and retries every other failure. The collector relies on that: it answers a listed code only when sending the same bytes again cannot succeed. Leave the tracker’s retryStatusCodes and dontRetryStatusCodes at their defaults.

The tracker applies the same rule to an answer from anything between it and the collector. A proxy that answers 403 makes the tracker drop the event, and one that answers 404 makes it resend the event forever.

  • aid is the site. Each event’s site_id, in the cloud.edgekit/tenant entity, is the payload’s aid as sent, with surrounding spaces trimmed. A payload with no aid is filed under _unresolved. app_id holds the same trimmed aid, or an empty string when there is none.
  • The id is never checked. The collector does not look the id up among your sites, and does not read a site’s status. An event naming an unknown site is collected under that id, and is not a bad row. A typo in siteId shows up as a new site_id in your data.
  • Site settings come from the first payload. The device cookie settings and the consent basis for a whole request come from the site its first payload names. An unknown site gets the defaults.

Ingest takes no API key and no sign-in session, and does not check Origin. Your site’s allowed origins apply to /edgekit/v1/ paths, not to analytics. Any client that can reach the host can send events under any site id, a server or an app with no Origin included.

The preflight grants any well-formed origin, for POST, GET and OPTIONS with a content-type header, and a browser may reuse it for a day. A request with an Origin gets it back in Access-Control-Allow-Origin, with Access-Control-Allow-Credentials: true.

The collector accepts every event and never checks consent. It stamps the consent basis declared for the site the request’s first payload names on each event, in the cloud.edgekit/request entity. Holding events until a user agrees is the tracker’s job. See Record consent.

  • The answer sets the device cookies, which identify the browser on its next request.
  • A request with the SP-Anonymous header sets no device cookie, and clears one the browser already holds. Its events carry network_userid 00000000-0000-0000-0000-000000000000, user_ipaddress unknown, no location and no network. An ip in the payload is still recorded.
  • Other cookies are not recorded. EdgeKit can set your site to record up to 10 named cookies as an entity on each event. It is off by default.

Where EdgeKit reads the protocol differently

Section titled “Where EdgeKit reads the protocol differently”
  • event_id: eid is lowercased. A payload with no eid, or a malformed one, gets an id derived from the payload, so a resent payload gets the same id.
  • e must be an event type the protocol defines. Any other value makes the payload a bad row.
  • p is not checked, and a malformed dtm, stm or ttm is stored as null rather than refused.
  • cv, the collector version parameter, is ignored.
  • ua replaces the User-Agent header for the browser, operating system and device fields.
  • ip replaces the connecting address in user_ipaddress. Location still comes from the connection.
  • EdgeKit’s own entities cannot be sent by a tracker. An entity under a schema EdgeKit attaches itself, such as cloud.edgekit/request, is removed from the event, and EdgeKit’s own copy is kept.
  • user_id is the tracker’s uid, unchanged. No event creates a user.
Limit Value
Body of a POST 1,000,000 bytes, else 400 oversize
Payloads in one POST 200, else 400 oversize
One event, once processed About 128 KB, else an event_too_large bad row

A page view, posted to the tenant host:

Terminal window
curl -i https://<tenant>.edgekit.ai/edgekit/a/t \
-H 'Content-Type: application/json' \
-d '{
"schema": "iglu:com.snowplowanalytics.snowplow/payload_data/jsonschema/1-0-4",
"data": [
{
"e": "pv",
"aid": "site_example",
"p": "web",
"tv": "curl",
"url": "https://www.example.com/news/article"
}
]
}'

The same event as a pixel request:

Terminal window
curl -i 'https://<tenant>.edgekit.ai/edgekit/a/i?e=pv&aid=site_example&p=web&tv=curl&url=https%3A%2F%2Fwww.example.com%2Fnews%2Farticle'

A self-describing event from TypeScript, with its data in ue_pr. Its schema must be deployed in your schema registry, or the event becomes a schema_not_found bad row:

const event = {
schema: 'iglu:com.snowplowanalytics.snowplow/unstruct_event/jsonschema/1-0-0',
data: {
schema: 'iglu:com.example/article_read/jsonschema/1-0-0',
data: { article_id: 'a-123' },
},
};
const response = await fetch('https://<tenant>.edgekit.ai/edgekit/a/t', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
schema: 'iglu:com.snowplowanalytics.snowplow/payload_data/jsonschema/1-0-4',
data: [
{
e: 'ue',
aid: 'site_example',
p: 'srv',
tv: 'my-server-1.0',
ue_pr: JSON.stringify(event),
},
],
}),
});
console.log(response.status, await response.text()); // 200 ok

edgekit.ai