Every event is sent to the server with a POST request to https://<server><pathPrefix>/<urlMark>/t4k.json
with a JSON body. The page, sess, user, char, browser, and lib blocks are the same for all events,
data depends on the event, and perf and scroll are not added to every event.
{
"service": "track",
"name": "page",
"data": { "type": "content", "name": "Контакты" },
"projectId": 1617632140,
"uid": "6410748586712844288",
"user": {
"td": 0,
"id": "42",
"plan": "pro",
"ga4ClientId": "2039255293.1537236640",
"ymId": "1537242943246737376",
"ts": 1757960000000,
"tz": "Europe/Moscow",
"tzo": 10800000
},
"page": {
"title": "Rockstat",
"path": "/contacts",
"ref": "https://www.google.com/",
"url": "https://example.com/contacts?utm_source=g",
"query": { "utm_source": "g" },
"domain": "example.com",
"scheme": "https"
},
"sess": {
"pageNum": 3,
"eventNum": 17,
"num": 2,
"type": "campaign",
"engine": "google",
"refhost": "google.com",
"marks": { "utm_source": "g" },
"hasMarks": true,
"marksHash": 123456,
"start": 1757960000000
},
"char": { "ls": true, "ae": true, "pr": true, "sb": true, "ab": true, "wp": true },
"browser": {
"if1": 0, "if2": 0,
"w": 1440, "h": 415, "tw": 1440, "th": 900, "aw": 1440, "ah": 836,
"sopr": 2000, "soa": 0, "sot": "landscape-primary",
"plt": "MacIntel", "prd": "Gecko",
"uad": { "platform": "macOS", "platformVersion": "14.5.0", "mobile": false },
"nc": { "effectiveType": "4g", "rtt": 50 },
"ne": { "hc": 8, "dm": 8, "sq": 296630877388, "su": 12345 },
"nb": { "a": 1, "ch": 1, "l": 100, "ct": 0, "dt": -1 }
},
"perf": { "cs": 0, "ce": 0, "scs": -1, "rqs": 211, "rss": 1549, "rse": 1560, "dl": 1581, "di": 1812, "dc": -1 },
"scroll": { "dh": 1148, "ch": 326, "to": 479, "cs": 100, "ms": 100 },
"lib": { "id": "web-sdk", "v": 5002001, "sv": 5002001, "st": 1757960000000 }
}
The query string carries dig — the body hash (cyrb53) — and td_trans — the transport used
(b — beacon, f — fetch). More in the Transport section.
Message blocks#
| Block | Content |
|---|
name, data | The event name and its data. The list of automatic events and their data is in the Automatic events section |
projectId | Project identifier from the configuration or the domain hash |
uid | Visitor identifier. Stored in a cookie and localStorage |
user | id and traits from identify; ga4ClientId and ymId from automatic synchronizations with GA4 and Yandex Metrica; ts, tz, tzo — the client's time and time zone; td — the clock offset from the server |
page | url, path, query (the parsed query string, including UTM, gclid, yclid), ref, title, domain, scheme |
sess | Session: number, start, counters, source type, marks. More in the Sessions section |
char | Browser capabilities: ls localStorage, ae addEventListener, pr Promise, sb sendBeacon, ab atob, wp web push |
browser | w/h — viewport, tw/th — screen, aw/ah — available area, sopr — devicePixelRatio × 1000, soa/sot — orientation, if1/if2 — iframe flags, plt/prd — platform and engine, uad — Client Hints, nc — network, ne — cores, memory, and storage quota, nb — battery |
perf | Navigation Timing: cs connectStart, ce connectEnd, scs secureConnectionStart, rqs requestStart, rss/rse responseStart/End, dl domLoading, di domInteractive, dc domComplete. Only on page and page_loaded |
scroll | dh — document height, ch — viewport height, to — offset from the top, cs — current scroll in percent, ms — maximum scroll on the page. On all events except session, page, page_loaded, user_params, rec_start, rec_batch |
lib | id, v — the library version as the number major × 1e6 + minor × 1e3 + patch, sv — the snippet version, st — the library start time |
The values in browser.uad, browser.nc, browser.ne.sq/su, and browser.nb are collected asynchronously
and may be absent in the first messages of the page. Missing battery estimates are sent as -1.
Full event schema#
A dot in the keys marks a move to the next nesting level: page.title means
{ page: { title } }. The type {[string]:string} is a plain object with string keys and values.
The JavaScript column describes what the browser sends; fields without it are added by the server.
| Property | JavaScript | ClickHouse | Description |
|---|
| id | | UInt64 | unique event id (server) |
| uid | string | UInt64 | rockstat visitor id, stored in cookie and localStorage |
| projectId | number | UInt32 | rockstat project id (received with event) |
| name | string | String | event name |
| service | string | String | target service, always "track" for events |
| channel | | String | received via |
| date | | Date | event date (UTC, server time) |
| dateTime | | DateTime | event datetime (UTC, server time) |
| timestamp | | UInt64 | event timestamp (server time) |
| data | {[string]:any} | | event payload, depends on event |
| data.extra.key | | Array(String) | extra data fields keys |
| data.extra.value | | Array(String) | extra data fields values |
| page.url | string | String | page full url |
| page.path | string | | page path (pathname) |
| page.ref | string | String | page referrer |
| page.title | string | String | page title |
| page.domain | string | String | domain/hostname of browsed page |
| page.scheme | string | String | http/https |
| page.query | {[string]:string} | | parsed query params, including utm_*, gclid, yclid |
| page.query.utm_source | string | String | marketing marks source |
| page.query.utm_campaign | string | String | marketing marks campaign |
| page.query.utm_medium | string | String | marketing marks channel |
| page.query.utm_content | string | String | marketing marks ad content |
| page.query.utm_term | string | String | marketing marks ad show criteria |
| page.query.gclid | string | String | google click id |
| page.query.yclid | string | String | yandex click id |
| page.query.extra.key | | Array(String) | extra query params keys |
| page.query.extra.value | | Array(String) | extra query params values |
| sess.type | string | String | session type: campaign/organic/social/partner/referral/internal/direct/webview |
| sess.engine | string | String | search engine or social network: google/yandex/fb/vk/tiktok/telegram/etc |
| sess.num | number | UInt16 | visitor session number |
| sess.start | number | UInt64 | session start timestamp |
| sess.hasMarks | boolean | UInt8 | marks flag |
| sess.pageNum | number | UInt16 | page number in current session |
| sess.eventNum | number | UInt16 | event number in current session |
| sess.refhost | string | String | referrer hostname (without www) |
| sess.keyword | string | | search keyword when the engine passes it in the referrer |
| sess.marks | {[string]:string} | | session marks |
| sess.marks.utm_source | string | String | marketing marks source |
| sess.marks.utm_campaign | string | String | marketing marks campaign |
| sess.marks.utm_medium | string | String | marketing marks channel |
| sess.marks.utm_content | string | String | marketing marks ad content |
| sess.marks.utm_term | string | String | marketing marks ad show criteria |
| sess.marks.has_gclid | number | Int8 DEFAULT -1 | google click id present |
| sess.marks.has_yclid | number | Int8 DEFAULT -1 | yandex click id present |
| sess.marks.has_fbclid | number | | facebook click id present (does not force campaign type) |
| sess.marks.pid, cid, sub1…sub5 | string | | partner marks, force the "partner" session type |
| sess.marks.extra.key | | Array(String) | extra marks keys |
| sess.marks.extra.value | | Array(String) | extra marks values |
| sess.marksHash | number | | hash of campaign or partner marks set, used to detect a new campaign |
| user | {[string]:string} | | user id, traits and synced ids |
| user.id | string | String | user id assigned by your website via identify |
| user.td | number | | clock skew between client and server, ms |
| user.ts | number | UInt64 | client timestamp |
| user.tz | string | String | timezone name |
| user.tzo | number | Int32 | timezone offset, ms |
| user.ga4ClientId | string | | google analytics 4 client id (synced automatically) |
| user.ymId | string | String | yandex metrika client id (synced automatically) |
| user.extra.key | | Array(String) | custom user traits keys |
| user.extra.value | | Array(String) | custom user traits values |
| char.ls | boolean | Int16 DEFAULT -1 | browser localStorage support |
| char.ae | boolean | Int16 DEFAULT -1 | browser addEventListener support |
| char.pr | boolean | Int16 DEFAULT -1 | browser Promise support |
| char.sb | boolean | Int16 DEFAULT -1 | browser sendBeacon support |
| char.ab | boolean | Int16 DEFAULT -1 | browser atob/btoa support |
| char.wp | boolean | Int16 DEFAULT -1 | browser web push support |
| browser.if1 | number | Int8 | iframe detect #1 (window !== top) |
| browser.if2 | number | Int8 | iframe detect #2 (parent has frames) |
| browser.w | number | Int16 | viewport width |
| browser.h | number | Int16 | viewport height |
| browser.tw | number | Int16 | screen width |
| browser.th | number | Int16 | screen height |
| browser.aw | number | Int16 | screen available width |
| browser.ah | number | Int16 | screen available height |
| browser.sopr | number | Int16 | devicePixelRatio * 1000 |
| browser.soa | number | Int16 | screen.orientation.angle |
| browser.sot | string | String | screen.orientation.type |
| browser.plt | string | String | navigator.platform |
| browser.prd | string | String | navigator.product |
| browser.uad | {[string]:string} | | User-Agent Client Hints: architecture, bitness, mobile, model, platform, platformVersion, uaFullVersion |
| browser.nc | {[string]:string} | | network: type, effectiveType, downlinkMax, rtt (navigator.connection) |
| browser.ne.hc | number | | CPU cores (hardwareConcurrency) |
| browser.ne.dm | number | | RAM in GB (deviceMemory) |
| browser.ne.sq | number | | origin storage quota, bytes (navigator.storage.estimate) |
| browser.ne.su | number | | origin storage usage, bytes |
| browser.nb.a | number | | battery API available |
| browser.nb.ch | number | | battery charging (0/1) |
| browser.nb.l | number | | battery level, percent |
| browser.nb.ct | number | | seconds until fully charged, -1 when unknown |
| browser.nb.dt | number | | seconds until fully discharged, -1 when unknown |
| perf | {[string]:number} | | Navigation Timing, only on "page" and "page_loaded" |
| perf.cs | number | Int16 | timing.connectStart (reference point, always 0) |
| perf.ce | number | Int16 | timing.connectEnd |
| perf.scs | number | Int16 | timing.secureConnectionStart (num / -1) |
| perf.rqs | number | Int16 | timing.requestStart |
| perf.rss | number | Int16 | timing.responseStart |
| perf.rse | number | Int16 | timing.responseEnd |
| perf.dl | number | Int16 | timing.domLoading |
| perf.di | number | Int16 | timing.domInteractive |
| perf.dc | number | Int16 | timing.domComplete (num / -1) |
| scroll | {[string]:number} | | Viewport position. On all events except "session", "page", "page_loaded", "user_params", "rec_start", "rec_batch" |
| scroll.dh | number | UInt16 | document height |
| scroll.ch | number | UInt16 | viewport height |
| scroll.to | number | Int32 | top offset, pixels |
| scroll.cs | number | UInt16 | current scroll, percent |
| scroll.ms | number | UInt16 | max scroll on current page, percent |
| lib.id | string | String | library identifier: "web-sdk" |
| lib.v | number | Float32 | library version packed as number: major*1e6 + minor*1e3 + patch (5.2.1 → 5002001) |
| lib.sv | number | Float32 | snippet version, packed the same way |
| lib.st | number | | library start timestamp |
| sxgeo.country.iso | | String | sypex geo country |
| sxgeo.country.ru | | String | sypex geo country |
| sxgeo.country.en | | String | sypex geo country |
| sxgeo.region.iso | | String | sypex geo region |
| sxgeo.region.ru | | String | sypex geo region |
| sxgeo.region.en | | String | sypex geo region |
| sxgeo.city.ru | | String | sypex geo city |
| sxgeo.city.en | | String | sypex geo city |
| mmgeo.country.iso | | String | maxmind geo country |
| mmgeo.country.ru | | String | maxmind geo country |
| mmgeo.country.en | | String | maxmind geo country |
| mmgeo.region.iso | | String | maxmind geo region |
| mmgeo.region.ru | | String | maxmind geo region |
| mmgeo.region.en | | String | maxmind geo region |
| mmgeo.city.ru | | String | maxmind geo city |
| mmgeo.city.en | | String | maxmind geo city |
| uaparser.is_bot | | Int8 | uaparser props |
| uaparser.is_mob | | Int8 | |
| uaparser.is_tablet | | Int8 | |
| uaparser.is_pc | | Int8 | |
| uaparser.browser.family | | String | |
| uaparser.browser.version | | Array(Int16) | |
| uaparser.os.family | | String | |
| uaparser.os.version | | Array(Int16) | |
| uaparser.device.family | | String | |
| uaparser.device.brand | | String | |
| uaparser.device.model | | String | |
| td.ip | | String | transport data ip |
| td.ua | | String | transport data user agent |
| td.fpid | | UInt64 | simple fingerprint based on IP and UserAgent |
| td.ref | | String | referer given from http transport layer |
| td.extra.key | | Array(String) | extra transport data |
| td.extra.value | | Array(String) | |