Базовая структура событий WebSDK
События, генерируемые SDK, имеют следующий вид
{
"service": "track",
"name": "page",
"projectId": 1617632140,
"uid": "6410748586712844288",
"data": {},
"user": {
"gaId": "2039255293.1537236640",
"ymId": "1537242943246737376",
"hybridPid": "59943dc57bc79f20d8fa53c5",
"ts": 1537243840171,
"tz": "Moscow Standard Time",
"tzo": 180000
},
"page": {
"title": "Rockstat platform",
"ref": "",
"url": "https://rock.st/docs/reference/web-sdk/auto-track"
},
"sess": {
"pageNum": 14,
"eventNum": 90,
"type": "direct",
"marks": {},
"hasMarks": false,
"num": 2,
"start": 1537242940499
},
"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": -1,
"sot": "landscape-primary",
"plt": "MacIntel",
"prd": "Gecko"
},
"lib": {
"id": "rst-sdk-web",
"v": "3.14.4",
"sv": "3.14.0"
},
"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
}
}
Полная схема событий
Точками в ключах помечен переход на следующий уровень вложености page.title: abc означают {..., page { title: abc, .....
Тип данных {[string]:string} означает обычный JavaScript объект, ключами и значениями которого являются строки.
Обратите внимание, что у некоторых значений указан список событий, в которых они присутствуют.
| Property | JavaScript | Description |
|---|
| id | string | unique event id |
| uid | string | rockstat user id |
| projectId | number | rockstat project id (receives from with event) |
| name | string | event name |
| service | string | event dependend service |
| page.url | string | page full url |
| page.ref | string | page referrer |
| page.title | string | page title |
| page.query | {[string]:string} | query params |
| page.query.utm_source | string | marketing marks source |
| page.query.utm_campaign | string | marketing marks campaign |
| page.query.utm_medium | string | marketing marks channel |
| page.query.utm_content | string | marketing marks ad content |
| page.query.utm_term | string | marketing marks ad show criteria |
| page.query.gclid | string | marketing marks has google click id |
| page.query.yclid | string | marketing marks has yandex click id |
| sess.type | string | session type: campaign/organic/referral/direct/internal/social |
| sess.engine | string | engine: yandex/google/fb/vk/etc |
| sess.num | number | user session number |
| sess.hasMarks | boolean | marks flag |
| sess.pageNum | number | page number in current session |
| sess.eventNum | number | event number in current session |
| sess.marks | {[string]:string} | session marks |
| sess.marks.utm_source | string | marketing marks source |
| sess.marks.utm_campaign | string | marketing marks campaign |
| sess.marks.utm_medium | string | marketing marks channel |
| sess.marks.utm_content | string | marketing marks ad content |
| sess.marks.utm_term | string | marketing marks ad show criteria |
| sess.marks.has_gclid | string | marketing marks has google click id |
| sess.marks.has_yclid | string | marketing marks has yandex click id |
| sess.start | number | session start timestamp |
| sess.refhost | string | referrer hostname (without www) |
| lib.id | string | library indentificator |
| lib.v | string | library version |
| lib.sv | string | library snippet version |
| scroll | {[string]:string} | Browser visible zone position. On all events, except "session", "page", "page_loaded", "user_params", "identify" |
| scroll.dh | number | Document height |
| scroll.ch | number | Client (browser) height |
| scroll.to | number | Top offset, pixels |
| scroll.cs | number | Current scroll, persents |
| scroll.ms | number | Max scroll on current page, persents |
| browser.if1 | boolean | iframe detect #1 |
| browser.if2 | boolean | iframe detect #2 |
| browser.w | number | browser width |
| browser.h | number | browser height |
| browser.tw | number | browser total width |
| browser.th | number | browser total height |
| browser.aw | number | browser available width |
| browser.ah | number | browser available height |
| browser.sopr | number | screen.orientation.devicePixelRatio |
| browser.soa | number | screen.orientation.angle |
| browser.sot | string | screen.orientation.type |
| browser.plt | number | navigator.platform |
| browser.prd | number | navigator.product |
| user | {[string]:string} | custom user traits |
| user.tz | string | timezone name |
| user.ts | number | timestamp |
| user.tzo | number | timezone offset * 1000 |
| user.id | string | user id assigned by your website |
| user.gaId | string | google analytics client id |
| user.ymId | string | yandex metrika client id |
| data | {[string]:string} | extra data fields |
| char.ls | boolean | Browser LocalStorage support |
| char.ae | boolean | Browser document.addEventListener support |
| char.pr | boolean | Browser Promise support |
| char.sb | boolean | Browser sendBeacon support |
| char.ab | boolean | Browser atob support |
| char.wp | boolean | Browser web-push support |
| perf | {[string]:string} | Browser performance timings. Available only on "page" and "page_loaded" events. More info at https://goo.gl/c9Dbnr |
| perf.cs | number | timing.connectStart (reference point, always 0) |
| perf.scs | number | timing.secureConnectionStart (num / -1) |
| perf.dl | number | timing.domLoading |
| perf.dc | number | timing.domComplete (num / -1) |
| perf.di | number | timing.domInteractive |
| perf.rqs | number | timing.requestStart |
| perf.rss | number | timing.responseStart |
| perf.rse | number | timing.responseEnd |
| perf.ce | number | timing.connectEnd |