Skip to content

External and override trackers(for developers)

Allexin edited this page Feb 20, 2016 · 7 revisions

External tracker - mechanism which allow collect additional information about user interactions. Typical example: sites in browser. App can't collect information about visited sites. But if we create browser extension, we can send this information to app.

#External tracker protocol
External tracker send info to App vai UDP(port 25855) or HTTP(port 25856)
Data is string with '&' seperator. each part - key\value pairs separated by '='
if we send data via udp - all udp package content is data string
if we send data via http - we place data content inside get request:
127.0.0.1:25856?KEY1=VALUE1&KEY2=VALUE2

There are two types of external trackers:

  1. Additional info trackers
  2. Override trackers

#Additional info trackers:
This type of trackers collect more detailed information about activity inside app. Like browser. This additional information not override information collected by App, but clarify it.
Message format:PREFIX=TYTET&VERSION=1&APP_1=[APP_NAME]&APP_2=[APPNAME]&APP_N=[APPNAME]&STATE=[APPSTATE]
PREFIX=TYTET - type of tracker TYTET(TrackYourTime External Tracker)
VERSION=1 - set protocol version for resolve future changes
APP_1,...,APP_N - list of applications with detailed info. e.g. for chrome browser this will be chrome.exe(windows file name), google-chrome(linux class name), Google-chrome-stable(mac os x file name)
STATE - detailed information. e.g. for browser if we visit youtube STATE=youtube.com

Additional info tracker must send info in loop every 1-5 seconds even if state not changed.
App check if current active application in OS is one of APP_1,...,APP_N then write STATE into app info and counter time for state.
If current app is not one of APP_1,..,APP_N - then STATE will be ignored while user not interacted with APP_1,...,APP_N

#Override trackers
This type of trackers do not send additional info. Override tracker totally disable main App info collecting. In fact when override info received - app check if it more fresh then local info - use if otherwise use local info. Typically override trackers is low level feature and no need to use it. Really, DO NOT USE OVERRIDE TRACKERS!
Message format:PREFIX=TYTOT&VERSION=1&APP_FILENAME=[FILENAME]&APP_STATE=[STATE]&USER_INACTIVE_TIME=[TIME_IN_SECONDS]&USER_NAME=[OS_USER_NAME]

PREFIX=TYTOT - type of tracker TYTOT(TrackYourTime Override Tracker)
VERSION=1 - set protocol version for resolve future changes
APP_FILE_NAME=[FILENAME] - file name or class. or any other uniq info which identify current activity
APP_STATE=[STATE] - additional info about activity. e.g. site domain for browser, or user name for skype. optional parameter. do not set it if no additional info available.
USER_INACTIVE_TIME=[TIME_IN_SECONDS] - time from last user interaction. App use this time to select actual source of information.
USER_NAME=[OS_USER_NAME] - current user name in system