Overview
The Silktide Analytics script is designed to monitor user behavior on websites. The script must be present on a website to allow for analytics or heatmaps in the Silktide platform.
The script records data on user interactions, such as clicks, scroll depth, idle time, and reading behavior. The script detects "dead clicks," JavaScript errors, and downloads of specific file types such as PDFs.
Key Functionality
Dead Click Tracking
Detect "dead clicks," where users click on elements but no meaningful interaction occurs. This is used to report on user frustration.
Idle Detection
Tracks user inactivity (e.g., no mouse movement, keypresses, or scrolling) and marks them as idle after a timeout period.
Error Monitoring
Captures JavaScript errors and links them to potential user interactions (e.g., clicks) that may have caused the error.
Scroll Tracking
Monitors how far users scroll on a page and records the maximum scroll depth.
Interaction Tracking
Records whether mouse, touch, and keyboard interactions are used, as a pure binary distinction (e.g. keyboard is yes or no).
Page Reading Behavior
Approximates the number of words read on a page, and tracks how far down the page users have read. To do this, the total word count is calculated (and updated, if the page mutates dynamically), and the word count that is shown within the current viewport is measured.
Consent Events
Listens to
consent
orunconsent
events, to manage user tracking preferences.Data Flushing
Periodically sends collected data (events like clicks, scrolls, errors, etc.) to the server using either
navigator.sendBeacon
or an XMLHttpRequest.Visibility State
Tracks when the page is hidden or visible, stopping tracking activities when the page is hidden to conserve resources.
Initialization
The script initializes tracking by setting up event listeners and starting periodic data flushing. It checks for various conditions (e.g., bots, "Do Not Track" settings) to decide whether to activate tracking.
Privacy
The Silktide Analytics script does not use cookies, or local storage, or any other persistent form of state by design.
Silktide takes effort not to record information which might inadvertently hint at the identity of a visitor. For example, we scrub known query parameters like fbclid
(Facebook) from recorded URLs. We also do not record specific keystrokes, or data typed into forms.
Where is data sent?
The analytics script sends selected data to the region of your Silktide account. At the time of writing, this will be either the EU or US; you can tell which by looking at the URL of Silktide after you log in (e.g. app.eu.silktide.com is the EU).