Bots are programs created by humans to automate repetitive tasks in the Internet. In the widest sense, the emergence of bots is a manifestation of the process of worldwide automatization that we currently experience in our modern times.

Some Examples of Bots:

  1. Sometimes bots only scrape Google or Amazon search engine results pages
  2. Some bots buy highly sought after Nike sneakers immediately after release
  3. Other bots purchase PlayStation5 consoles from official vendor stores as soon as they are restocked. This happens before legitimate users have a change to buy a PS5 console (Scalping).
  4. Other bots automate banking transactions in order to disintermediate online banks

My conjecture is: Automated programs behave not the same as real human beings.

What to I mean with that from a technical perspective?

Before we can classify behavioral data as either bot-like or human, we have to record and collect it.

The idea is to record the following JavaScript events from every website user:

Each of the above events is assigned a timestamp obtained with

The above process yields a time series of behavioral interaction data such as for example:



  1. s stands for scroll event
  2. m stands for mousemove
  3. dcl is the domcontentloaded event
  4. vc is the visibilitychange event
  5. The last array element is always the timestamp obtained with So for example in the frame ["s",0,3561,1,1062.775], 1062.775 is the timestamp.

How to Detect Bots with Behavioral Analysis?

Humans behave like a chaotic systems.

Humans move their mouse, keyboard, touch screen and scrolling wheel in an organic fashion. Bots still have a hard time to mimic mouse movements and touchscreen taps like real humans.

A simple process to distinguish bots from real humans based on behavioral data could look like the following:

  1. The first step is to collect and extract certain features from a huge set of recorded behavioral data samples.
  2. The next (and way harder) step is to label the data set as either human or bot-like. This requires to have enough samples from both categories.
  3. The last step requires to train a neuronal network. This allows us to accurately classify live behavior samples just in time.

That is way easier said than done. However, there are some companies such as biocatch and perimeterx that are already using this approach since years.

But what exactly makes mouse or touch event interaction in a browser human? What are features that are extremely hard to emulate mechanically? Some rough ideas (replace mouse with touch events in case of mobile devices):

  • The mouse is used as a reading aid (observe yourself right now)
  • The start and stop speed of the mouse between points of interest
  • The trajectory of mouse movements
  • The distribution of events over time. Humans look at the screen, process the information visually and react physically. This pattern repeats all the time. The latency in such reaction patterns is intrinsically human.
  • Time interval between mousedown and mouseup events
  • The interval between keydown and keyup events depends heavily on the writing skills of the human
  • Timing statistics when typing: Pressing two identical letters almost always is faster in the second letter.
  • Mouse follows the eye focus point
  • Scrolling speed correlates with reading speed
  • spikes in behavioral data when a website requires interaction
  • mouse moves to the top (tabs) when navigating away (not in mobile)
  • mobile only: sometimes screen dimensions plummets 180 degrees on auto-rotate
  • on disinterest, mouse races very fast to the "close tab" button
  • Areas of interest in text are highlighted
  • ...?

The established method to distinguish humans from bots is the good old captcha. However, we are approaching an age where captchas can be solved better by AI than by real humans.

Limitations of Behavioral Bot Detection

There are some limitations regarding bot detection with behavioral analysis:

  1. Behavioral analysis takes some sampling time before there is enough data to properly classify the recorded behavior. Put differently: When only considering behavioral analysis, bots can wreak havoc in the first initial seconds after page load (Let's say 0 - 5 seconds).

  2. What happens when a bot injects behavioral data that was recorded somewhere else (for example on the attackers own website)? Without knowing the intent of the behavioral data, it is impossible to detect that the recorded behavior is human but from somewhere else.

  3. Sometimes there just is no behavioral data to analyze. Sometimes Internet users open a web page for later (for example with the middle pointer of the mouse) but never chose to interact with the website.