Hi all,
Thanks for your reporting on several issues in other time tracking JS libraries. I've seen that most of the issues raised by users like you haven't been addressed for years & years. It's time to check out a modern, user-friendly and more accurate tracker. Given below are several issues that you have reported and their statuses given here:
Issue: IOS device is not supported properly or due to absence of window unload events
Tracker's current status: yes, it had been a big challenge to support IOS devices properly for many analytics providers (they fallbacked to old polling technique) due to absence of window unload events in IOS devices and mobile safari. We had written a major patch last year to support all IOS devices like IPad, Iphone and mobile safari. It's supported elegantly in this tracker since the year (2020) from the month of July.
Issue: Timer is not reset on several occasions thus leading to incorrect time being recorded or set the timer to zero
Tracker's current status: There is nothing to set or reset in Timeonsite tracker. Everything is handled by tracker itself starting from capturing time on user entering the page till the user closes the browser tab/window. Since it's automatic, time-aware and there is no manual intervention, capture of time-on-site data is consistent and accurate as well. The behavior is consistent across single-page and normal websites. The only thing to note is, you need to specify in init config parameter in case the given website is single-page website.
When a page is closed, reloaded or refreshed, generally following data is sent to tracker table automatically if the URL (endpoint to save data in DB table) is given.
{
"TOSId": 5968225443454776,
"TOSSessionKey": "9289163773130862762620",
"TOSUserId": "anonymous",
"URL": "https://saleemkce.github.io/timeonsite/",
"title": "Timeonsite Tracker | Real-time demo",
"entryTime": "2021-11-25 07:05:00.595",
"currentTime": "2021-11-25 07:05:23.595",
"exitTime": "2021-11-25 07:05:23.595",
"timeOnPage": 23,
"timeOnPageTrackedBy": "second",
"timeOnSite": 23,
"timeOnPageByDuration": "0d 00h 00m 23s",
"timeOnSiteByDuration": "0d 00h 00m 23s",
"trackingType": "tos"
}
Issue: Time on site data should be attached with Google Analytics or Adobe analytics for cross reporting
Tracker's current status: This is one of the most expected features from users involved in analytics for viewing & analyzing combined reporting data. This tracker provides a session key with the help of built-in API Tos.getTimeOnPage().TOSSessionKey; You can call this session key anytime and attach it in GA, Adobe, Piwik Analytics or anything and enjoy the 365°(deg.) reporting comfortably. Since your current visitor's GA session & TimeOnSite tracker's session are linked, it's quite easy to view enhanced & advanced level reporting.
Issue: Time on site tracking behavior when multiple pages are opened by user in the browser
Tracker's current status: This is supported out-of-the-box. And this is the reason it calls itself state-of-the-art, accurate & transparent time-on-site tracker. This behavior is consistent in IOS as well. Latest version(v1.2.0) was intended for multi-tab sessions time on site accuracy in IOS devices while on the other hand, support for this capability for leading browsers like Chrome, Firefox or Edge etc. has been naive since the beginning.
Issue: Save time on page/site along with custom (e.g username, IP, country, application data etc.) data to DB table
Tracker's current status: Yes, it's provided out of the box with built-in API Tos.setCustomData({name:'John',age:25}); you need to do nothing else. It should be available in your DB table (MongoDB). For MariaDB/Mysql/other RDBMS, you just need to adjust the schema slightly; you are done. You can capture any custom or critical data very comfortably but it shouldn't be too large since it's not a drawback in TimeonsiteTracker.js itself but the capability of unload events in all modern browser vendors.
Issue: Timer sometimes track huge time output issue (large time on page or time on site in unexpected manner)
Tracker's current status: Generally, it tracks data in transparent & accurate way. We've been improving a great deal since 2018, first release in this very huge top/tos data due to sleep/hibernate or unexpectedly large user inactivity. This issue should be mitigated to a great extent in near future with the improving support in browser vendors & tracker itself.
Issue: Handling idle timeout in tracker
Tracker's current status: This should be handled by tracker itself. You don't need to bother about timeout issues since the time-on-site data is a continuous stream of time and tracker carefully captures the active time and the rest is ignored. There is no external API to control time in or time out; everything is automatically handled by itself.
Issue: Using web-socket receiver to handle time on site data
Tracker's current status: Since we use sendBeacon/XMLHttpRequest APIs to capture the data on page close, using web sockets to handle the time on site data is mostly not required. But, upserting the data in our table at any given time with web sockets is also a good option; We'll be calling the Tos.getTimeOnPage() anytime and get the current status and update the table with web sockets but this option is also mostly not recommended. But, if you got special use cases and you need to update now and then with web sockets, then you can freely consider it with using page visibility APIs or pagehide events.
Issue: Blur & focus events are utilized overly yet no window beforeunload/unload event support
Tracker's current status: This tracker primarily depends on the beforeunload/unload events only; that's the reason it doesn't require polling/pinging or persistent web-socket connections to keep updating the time-on-site tracker table. Blur & focus events are internally handled very well with page visibility APIs, so you need not even think of it. You just visit the web page and then on closing the browser tab/browser shutdown itself, you are expected to receive data consistently (that's the goal of the project as well)
Issue: Tracking any activity like video, music or tracking the activity of courses/exams online
Tracker's current status: This feature is available out of the box and it's handled with Tos.startActivity({name: "Toy show episode 1", city: "Old Trafford", country: "UK"}); & Tos.endActivity({watchedFully: true}) API. The best thing about it is, current session is mapped with the activity. So, you can track in which session each activity like watching video, playing music or taking a course/exam/activity actually happened and this data can be shared with external providers like GA, Adobe or Piwik analytics as well.
I'd like you to take a look at the demo in your browser and experience it: https://saleemkce.github.io/timeonsite
Your data is private & secure here; you own the whole time on site data yourself in your preferable DB tables (unlike other 3rd party services where the analytics data is stored in public cloud) and so your data privacy is fully guaranteed.
It's for demo purposes only and the data won't be saved or persistent in your next session. It's my invitation for you to test & experience this transparent tracker. If you'd like to see how it works really for your website, just set it up in your non-prod website and test it today!
@kalimerre @martyf @yoderjen @essteffan @amitkoth @arthruwelkin @thegreenarrow @Julioocz @paulopmx @malikmalhan @yorzi @xTRiM @mewis @firstsightmedia @sburkett @enmanuelr @javatechy @redaxmedia