This page looks best with JavaScript enabled

GrowingIO Data Collection Field Analysis

 ·  ☕ 1 min read

1. Field Meanings

1.1 u, User ID

1
2
3
4
5
6
if cookie.has(gr_user_id){
    //使用 cookie 中的 gr_user_id 有效期十年
}
else {
    //按照 "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 格式,随机生成一个 gr_user_id
}

1.2 s, Session ID

1
2
3
4
5
6
7
if cookie.has(gr_session_id_){
    //使用 cookie 中的 gr_session_id_
    //gr_session_id_,的有效期为 100 分钟
}
else {
    //按照 "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" 格式,随机生成一个 gr_session_id_
}

1.3 t, Event Type

  • imp, display
  • vst, visit
  • clck, click
  • chng, change
  • sbmt, submit

1.4 tm, Current Time

1
+Date.now();

The browser’s current time when the data is sent.

1.5 ptm, Page Load Time

1
+Date.now();

The browser’s current time when the current page loaded. It is refreshed on navigation or reload.

1.6 d, Current Domain

1
window.location.host;

1.7 p, Current Relative Path

The URI with the domain and the parameter part removed, excluding anything after the ?

1.8 rf, Referrer

1
document.referrer;

1.9 sh, Screen Height

1
window.screen.height;

1.10 sw, Screen Width

1
window.screen.width;

1.11 l, Browser Language

1
zh - cn;

1.12 e, Triggered Events

  • e.x, xpath
  • e.h, href
  • e.v, element text content

2. How It Works

The original http://dn-growing.qbox.me/vds-gate.js collects data that is not readable. This is because vds-gate.js encodes the data before sending it. Before reading the code, you must first strip out the encoding.

MutationObserver: Mutation Observer is an interface for monitoring DOM changes. Whenever anything changes in the DOM object tree, the Mutation Observer is notified.

Events fall mainly into two categories:

  • DOM changes: the GrowingIO collection JS embeds Google’s MutationObserver wrapper. It provides data collection when the DOM changes.
  • Behavior triggers: mainly the page’s visit, impression, click, submit, and so on.

On the first visit, the API returns information about the application and the user’s device, producing visit data and an event stream of DOM changes during page load. There are two rounds of data collection:

  • The first collects device-related information: client, screen size, language, and so on.
  • The second collects the event stream of DOM changes during page load.

Without refreshing the page, every DOM change and every click or similar behavior on the current page results in data being submitted.

The format of the data collected for clicks and similar behaviors

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
[
  {
    "u": "7ddbc39e-8861-482d-bba6-b9e00f4607e7",
    "s": "da237b25-6a7f-4e37-beba-5d1e7255ff88",
    "t": "clck",
    "tm": 1502335934576,
    "ptm": 1502335904058,
    "d": "domain.com",
    "p": "/overview",
    "e": [
      {
        "v": "2016",
        "x": "/div#wrapper/div#page-wrapper.page-wrapper/div.content"
      }
    ]
  }
]

3. References


WeChat Official Account
WRITTEN BY
WeChat Official Account