Timeonsite
Timeonsite Tracker for the Web | |
| Other names | TimeonsiteTracker.js |
|---|---|
| Original author(s) | Saleem |
| Developer(s) | saleemkce |
| Initial release | April 18, 2018 |
| Stable release | 1.2.1
/ August 21, 2022 |
| Repository | github |
| Written in | JavaScript |
| Engine | |
| Platform | See § Browser support |
| Size | 32.7 KB; minimized |
| Website | saleemkce |
Search Timeonsite on Amazon.
TimeOnSite.js or TimeOnSiteTracker.js[1] is a JavaScript snippet that, when included in a web page or website, will track how much time a user spends on a site by session. It is a web project intended for improving web analytics. It was developed by computer programmer Saleem[2] from Chennai in the mid-year of 2016. It aims to track user's time-on-site accurately and transparently. When included in web pages, it works in both desktop and mobile browsers. The goal of this web project is to build a modern, accurate, and consistent analytics snippet to track time-on-page and time-on-site for web projects[3]. It is licensed as commercial software but is also free to use in non-production servers, personal blogs, and for non-profit organizations. One noticeable sub-product of the tracked data is the capability to perform advanced querying over user engagement data using normal SQL queries called "Timeonsite Analytics[4]". The tracker advocates the use of modern Javascript APIs like sendBeacon over XMLHttpRequests for capturing critical data.
History
The idea to build a Timeonsite tracker arose when he worked for Pearson PLC in 2016; it was a challenge to capture and save the time-on-page[5] parameter in a database successfully since closing a web page or reloading a browser tab generally resulted in loss of user logs and analytics data at the moment of browser page unload actions. Web trackers have used all techniques like pinging, polling, and time-synchronizing to avoid data loss at that time, thus overloading the backend server with repetitive analytics data. To optimize it and prevent unnecessary server hits, with the help of various inbuilt browser facilities like cookie, local-storage, and session-storage combined with new JavaScript API features, a draft version of the tracker was experimented with in the mid-year of 2016[6] and a working version was released to the public in the year 2018.[7] This project was considered highly challenging and experimental but has been proven to be workable, viable, and constantly improving.
Features
- Real-time and offline capture of time-on-page and time-on-site
- Multi-tab browser session accuracy and page-view capture
- Supports blacklisting specific URLs from tracking time on site
- Cross-browser & seamless across multiple desktop and mobile browsers
- Capability to capture user activity along with time-on-site
- User session-wise capture either as "anonymous" or by User Id
- Stable APIs and is designed to be both backward-compatible and forward-compatible
- Optional "DeveloperMode" setting for developers to inspect a massive amount of logs generated in real-time transparently
Visual: Integrated Reporting & Analytic tools
There is a free backend server officially supported by timeonsite.js called Visual[8] to save and view time-on-site data in detailed view as part of reporting and analytic purposes. It is available in both PHP and NodeJs which can be used by paid and non-paid users alike because it is offered as free and not part of domain-based license provided for the tracker for websites. There are two interactive views provided by the tool for administrators using the tool: 1. Chart view(analytics), 2. Data View(reporting).
Chart view:
This is a high-level analytic view for a web application comprising of various report types like overall pageviews, pageviews by title, user sessions(anonymous vs authenticated), time-on-site for recent 75 sessions, page popularity table etc. The tool fetches a limited data set like recent 10k records from the DB table to populate the chart view to prevent the page from hanging or unwanted load times; this parameter is configurable and can be increased or decreased by admins. There is a date filter at the top of the page that the user can adjust by giving "start date" and "end date" parameters to view recent data, last 3 month data, or historical data. Actually, this is the most powerful control for site admins to view user engagement data over time of any range. As mentioned, "Page popularity table" is great for site admins to quickly learn about the number of pageviews, large sessions, and short sessions by page titles. It's primarily built using d3.js and Jquery.
Data view:
This is a granular view of time-on-site data by user sessions. By default, it is showing a limited set of data to prevent unwanted load times. It is built using popular Jquery DataTables. It shows the total number of records found in the time-on-site DB table at the bottom of the DataTable for quick reporting. Each record pertains to a pageview. There is a date picker at the top of the page to filter data over any time period just like the chart view. The DataTable's column usually include TOSSessionKey, page title, URL, page entry time, top, tos etc. whereas "top" stands for time-on-page and "tos" stands for time-on-site. At the bottom of the DataTable, each column contains a search box for viewing any specific session in a detailed manner.
One common way to use this Data view is,
1, Pickup any TOSSessionKey from the DataTable or from the DB tos table.
2, Enter the TOSSessionKey inside the search box pertaining to the TOSSessionKey column at the bottom of the DataTable
When the TOSSessionKey is entered, the "Data View" immediately sends a POST request to the backend server and populates the reporting view. The column Duration(tos) is generally highlighted to help the admin or user viewing the reports to understand the time-on-site generated for that particular session. The column can be toggled to show or hide, and sorting can be applied on it by just clicking the column header. The value for Duration(tos) should be lesser at the top and greater at the bottom during the search and sort should be applied in that manner.
Browser Support
Mozilla Firefox, Google Chrome, Opera, Edge, Safari, SeaMonkey, Maxthon, UC Browser, and a wide range of mobile browsers. Modern browsers result in greater accuracy while older versions of browsers result in less accuracy of this metric.
CDN Accessibility
The tracker can be accessed directly and is available from the following CDNs in case of non-production and personal uses[9]
Release history
| Version | Initial release | Additional notes |
|---|---|---|
| 1.0.0 | April 18, 2018 | First stable release[10][11] |
| 1.1.0 | July 10, 2020 | Major rewrite for IOS. Added tracking support for IOS browsers and IPad devices. Single tab time-on-site tracking added. |
| 1.2.0 | November 24, 2021 | Added tracking support for multi-tab sessions for IOS and IPad devices. |
| 1.2.1 | August 21, 2022 | Internal enhancements for inactive browser tabs to avoid cookie or session crash |
References
- ↑ "Timeonsite Tracker for the Web". Github. April 18, 2018. Retrieved April 18, 2018.
- ↑ "Saleem, the programmer's bio and user page in Github.com". Github. January 6, 2014. Retrieved January 6, 2014.
- ↑ "Time On Site tracker for web analytics -timeonsitetracker.js". Medium_(website). April 21, 2018. pp. 1–2. Retrieved April 21, 2018.
- ↑ "Introducing time-on-site Analytics For Businesses And High-end Applications". Medium_(website). June 12, 2018. pp. 2–3. Retrieved June 12, 2018.
- ↑ "The business case for web performance". MDN_Web_Docs. March 14, 2022. Retrieved March 14, 2022.
- ↑ "I found it interesting to derive insights with time-on-site metrics alone from this article". Reddit. March 27, 2021. Retrieved March 27, 2021.
- ↑ "ELI5:How do they measure time on site on websites accurately?". Reddit. April 11, 2021. Retrieved April 11, 2021.
- ↑ "Visual - Visualization and Reporting for timeonsite.js". Github. August 27, 2018. Retrieved August 27, 2018.
- ↑ "Timeonsite - Libraries- CDN.JS". Cdnjs.
- ↑ "Releases - saleemkce/timeonsite". Github. April 18, 2018. Retrieved April 28, 2018.
- ↑ "Time on site tracker for web analytics released. The Unprecedented?". Hacker News. April 21, 2018. p. 1. Retrieved April 21, 2018.
External links
- Project source from https://github.com/saleemkce/timeonsite
- Releases of Timeonsite tracker - https://saleemkce.github.io/timeonsite/docs/releases.html
- Demo of the tracker as seen in Github project page https://saleemkce.github.io/timeonsite
This article "Timeonsite" is from Wikipedia. The list of its authors can be seen in its historical and/or the page Edithistory:Timeonsite. Articles copied from Draft Namespace on Wikipedia could be seen on the Draft Namespace of Wikipedia and not main one.
