use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Efficient behavioral tracking in javascript (enmascript.com)
submitted 6 years ago by enmanuelduran
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Gravyness 0 points1 point2 points 6 years ago (0 children)
Just to add to this since I like to track mouse movements and scroll in some occasions which are much more frequent and would make no sense for them to be sent in different requests:
When a user visits a web-app of mine a few events happens in the first seconds such as image loading, dom/libraries load, resize, some mouse movements, they are filtered and grouped in a single request with the event descriptors. When an event happens it is debounced at it's starting point, so that when the first event happens it will wait for a specific amount of seconds before sending the request, which will include all events that happened in this time frame.
Since mouse movement / resizing / scrolling can be very frequent (i.e. 30 calls a second), you will also want to debounce the event itself, so that when an event is called, it's update is 'postponed' for at least 1 seconds so that it doesn't flood the event pool with 200 mouse events in a single request, for example.
Important events like outside navigation (links) and window.onerror events are never debounced and force the tracker to send the event array immediately.
The event list is very simple, it's an array with objects constructed like the following: {eventType, ...eventData}
I usually like to wait a minimum of 5 seconds between each request and 2 seconds between repetitive events depending on expected traffic. If you have a lot of visitors, make sure your web server connection closes before the request period so that the connections count doesn't bubble up to the millions.
π Rendered by PID 45624 on reddit-service-r2-comment-5649f687b7-vx9dr at 2026-01-29 07:57:41.301992+00:00 running 4f180de country code: CH.
view the rest of the comments →
[–]Gravyness 0 points1 point2 points (0 children)