Kntnt Engagement Metrics

How Do You Know If Anyone Actually Reads What You Publish?

Every analytics tool tells you how many people opened a page. None of them tells you how many people read it. Kntnt Engagement Metrics, a small open-source library, estimates how long a visitor read and how much of the text, and it is measuring you on this page right now.


What you see on this page

This page runs the library with its default settings, together with its overlay, a tool for developers that shows the measurement as it happens. Press Ctrl+Shift+D to hide or show it.

  • The blue band across the window is the reading zone. Only text inside it can earn reading time.
  • Each piece of text has an orange outline. The parts of it that turn green have been credited: they have earned their reading time.
  • Red hatching marks covered text, which the page shows under something else, such as a banner. This page has none, so you will not see it here.
  • The panel in the corner shows the three numbers the library measures, whether the clock is running and why it is stopped, and the latest reports. Its sliders change the reading speed, the top and bottom of the reading zone, and the speed at which scrolling counts as fast.

Read on at your usual pace and watch the text turn green. Then try scrolling fast, or switch to another tab and come back, and watch the clock stop.

What page views measure

Web analytics tools are built around one event: a page was loaded. From it they derive page views, visitors, sessions, bounce rates and time on page. These numbers describe traffic well, but they say nothing about what happened after the page appeared on the screen.

Time on page is a poor stand-in for reading. A visitor who reads for eight minutes and then closes the tab may be recorded with no time at all, and a visitor who opens a page and walks away may be recorded with half an hour. Being on a page is not the same as reading it.

Scroll depth gets a little closer. But a visitor can flick to the bottom of a long article in two seconds without reading a word, and a reader of a short page may read every word without scrolling at all.

Measuring the text, not the page

The library asks a different question: how much of the text could the visitor have read, given what was on the screen and for how long? It cannot see where anyone is looking, so it never tries to say which paragraphs were read. Instead it gives an estimate with a ceiling: it never counts more than the text the visitor could have read.

Text can only be read while it is on the screen, and a person can only read so fast.

Three rules carry the model. Only text in the reading zone can earn reading time. Every letter earns it at most once, at the reading speed. And the clock runs only while the visitor is present, is not scrolling fast, and has text in the zone that has not yet earned its time.

The reading zone

The reading zone runs from 10 % to 80 % of the window's height, where the reader in the library's rough check started and stopped reading before he scrolled. At the top of the page the zone reaches the top edge of the window, and at the bottom of the page it reaches the bottom edge, because otherwise a title at the very top or the last lines at the very bottom could never be read.

Within the zone, reading time goes to the text that has not yet earned it, from the top down. When all the text in the zone has been credited, the clock stops, and it starts again when new text enters the zone. A visitor who opens an article and walks away is therefore credited with at most one zone of text, about 20 to 50 seconds depending on the screen, not with the whole article.

The cap is deliberately cautious. A reader who is slower than the reading speed is under-counted. An inflated number would be worse than a cautious one.

Letters and the reading speed

Text is measured in letters: letters and digits, but not spaces or punctuation. A letter with an accent counts as one, and so does a Korean syllable block. Each letter earns its reading time once, at the reading speed.

The default reading speed is 1100 letters per minute. It comes from Brysbaert’s review of 190 studies, which found that adults read English non-fiction silently at about 238 words per minute, with 4.6 letters per word. The same value fits other languages in Latin, Cyrillic and Greek script within about 20 %, which is no more than the difference between readers.

Other scripts are read at other rates per letter. A site in Chinese, Japanese, Korean, Arabic or Hebrew sets its own reading speed with one attribute on the script tag. The project’s README has a table of typical rates per script, with sources.

When the clock stops

The clock runs only while the visitor is present. That means the page is visible, and the window either has focus or has been used since it lost focus. Many people keep an article in a window beside their work, and scroll it without clicking it first, so using the page counts as being there.

The clock also stops while the visitor scrolls fast: at 400 pixels per second or more, averaged over at least 200 milliseconds. It starts again half a second after the last fast scroll. Slow scrolling does not stop it, because many people read while they scroll slowly.

There is no idle timeout. A visitor who sits still is not assumed to be gone; the reading zone is what stops the clock once its text has been read.

Covered text

Text under something else on the page cannot be read. Typical examples are a fixed header that the text slides under, a banner at the bottom of the window, a cookie notice or a pop-up. The library asks the browser what is on top at points every 20 pixels down the middle of each piece of text in the zone. Where the answer is not the text itself, that strip counts as covered and earns nothing.

The check runs when a scroll ends, when the window changes size, and every three seconds while the clock runs or while covered text is all that stops it. So text under a closed pop-up starts to earn reading time a moment after the pop-up is gone.

Text that is not shown

Pages often hold text that the visitor sees only after asking for it: the answers in a list of questions, a closed accordion, the rest of a story behind “Read more”. Text that is not shown cannot be read, so it earns nothing until it is shown, and the reading ratio leaves it out until then. If it is hidden again, it keeps what it has earned.

Try it on the questions below. A closed answer earns nothing: only the question turns green. Open an answer, and the orange outline grows to take it in. The question stays green, and the answer starts out uncredited. Watch the reading ratio in the panel: it falls, because the text has grown by letters you have not read yet. Read the answer: it turns green as well, and the reading ratio rises again. Then close it and open it again. It is still green, and the clock does not start for it, because no letter earns its reading time twice.

  • Does the library know which words I have read?

    No. It cannot see where anyone is looking. It estimates how much of the text could have been read, from what was in the reading zone and for how long, and it never counts more than that.

  • Why does a closed answer earn nothing?

    Because nobody can read it. The library counts only the letters that are shown on the page. A closed answer, a hidden tab and the text behind “Read more” are left out until they are shown.

  • What if I close an answer I have read?

    The answer keeps its credit while it is closed. When you open it again, it is still credited, so the clock does not run for it a second time.

Three numbers

From all this the library keeps three numbers for each page view:

  • Reading time: the seconds the clock has run, that is the time the visitor is estimated to have spent reading the text.
  • Reading ratio: the share of the text’s letters that have been credited. Text that is not shown, such as a closed answer, is left out until it is shown, so the reading ratio falls a little when an answer opens.
  • Scroll depth: how far down the text the visitor has seen, as the share of the text’s letters above the lowest point that has been inside the window.

All three are measured on the text alone. A long header, a comment section or a large footer changes none of them. A visitor with a scroll depth of 95 % and a reading ratio of 3 % scrolled through the article without reading it. One with 50 % and 45 % read the first half carefully and left.

From numbers to reports

Nothing is reported until the visitor has read for 10 seconds. In Matomo every event counts as an interaction, so without this rule hardly any visit would be a bounce. With it, a bounce still means that the visitor did not read.

After that the library reports milestones, each once per page view: 10, 30, 60, 120 and 300 seconds of reading time; 25, 50, 75 and 90 % reading ratio; and 25, 50, 75 and 100 % scroll depth. Each time the page is hidden, for example when the visitor switches tabs or leaves, it also reports a summary: the whole seconds of reading time added since the previous summary. Summed, the summaries give the page view’s exact reading time, even when the visitor leaves and comes back.

The library itself sends nothing anywhere. It hands its reports to add-ons and dispatches them as events on the page. The add-ons for Matomo and Google Analytics 4 pass them on to the analytics tool already on the page, with names such as read 30s and scroll 75% in Matomo and read_30s and scroll_75pct in GA4. A few lines of script are enough to send them to any other tool.

Installed with a script tag

A site installs the library with script tags and nothing else. Settings, such as the reading speed, are attributes on the tag, so a site with a strict Content Security Policy needs no inline script. Sites that use a bundler can import the packages from npm instead.

This page has exactly two tags: one for the library and one for the overlay. The overlay is a developer tool. It belongs on a page like this one, or on a staging site, and never in production.

Small, cheap and harmless

The library is under 5 KB compressed and has no dependencies. It runs no loop. Between events, reading time simply grows, so the library works out when the next thing will happen, such as the text in the zone running out or a milestone being reached, and sets a single timer for it. On a long article where nobody does anything, it may use at most 10 milliseconds of processor time in the first half minute, and every change to the code is checked against that limit. While the page is hidden it does nothing at all.

It reads the positions of the text in one batch, when sizes change, and asks what covers the text only in its covered-text check. Its scroll listener only does arithmetic, and every listener is passive, so it cannot make scrolling stutter.

It defines one global name, never throws an error into the page, writes no styles, makes no network requests and stores nothing: no cookies and no local storage. The add-ons never load an analytics tool and never touch consent; that is left to the analytics tool. What reaches the tool is a handful of numbers per page view, and in Matomo the page’s title as the event name.

In browsers older than about two years it measures nothing and raises no error. The analytics tool still counts the visit; only the reading data is missing.

Where to find it

The source, the documentation and the specification are at github.com/Kntnt/kntnt-engagement-metrics, and the packages are on npm under the @kntnt scope. The library is open source under the MIT licence and used at your own risk.

If you have read this far at your usual pace, the panel in the corner should show a reading ratio near 100 %. If it is much lower, you read faster than 1100 letters a minute, or you skimmed. Telling those apart from careful reading is what the library is for.