358 points · by fagnerbrack · 4y ago · 236 comments
Consequently, you can't actually expect to capture 100% of these analytics events nor even expect the percentage captured to stay the same over time since the filter lists are very regularly updated and users enable/disable different ad blockers over time.
More broadly speaking, once you have sent a webpage to the user, you should not expect anything from the user's browser. They may or may not allow whatever arbitrary JS you have on the page. They may even intentionally give you bad data (e.g. hijack the payload to give you intentionally malformed data).
edit: even more broadly speaking, there's additional reasons why you can't expect to receive these kinds of callbacks: consider what happens if a user loses connectivity between loading the page and them navigating away (e.g. their phone loses service because they went into an elevator before navigating away)
How sure are we about this? I'm pretty sure it depends on which market specifically you're in, and the data I'm about to show is of course not perfect, but it seems that not so many users actually do use adblockers today. Although I don't know a single developer who doesn't, and in some web applications I'm running, the majority of users do use adblockers as they are focused on developers.
Chrome is assumed to be the most popular browser (by a large margin last time I checked, so I won't bother to check again) and a quick search puts the user base around 2-3 billion users. Searching for "adblock" in the Chrome Web Store (https://chrome.google.com/webstore/search/adblock?hl=en&_cat...) shows that the most popular adblocker has a user base of ~300,000 users.
That makes 0.015% to 0.01% of Chrome users having the "AdBlock" extension installed. Not that substantial.
If someone has some more accurate numbers than my slightly-educated guess, I'd be happy to be proven wrong.
Edit: The above user base of the adblock extension is wrong. As Jabbles pointed out, I was seeing the number of reviews, not number of users.
So instead, the page lists "10,000,000+ users" so we can assume the true number to be above that, but below "100,000,000+ users" users.
That would put the amount of Chrome users using the "AdBlock" extension between 0.3% and 5% more of less. Closer to "substantial", but not sure if it would impact businesses choice regarding ads/tracking or not.
Can we? I can't seem to find anything that indicates if/when the next number jump is, just a lot of big name extensions at "10,000,000+". Back in 2016 ABP had a post about their extension alone having 100+ million active users https://blog.adblockplus.org/blog/100-million-users-100-mill... and that's ignoring the >50% of Chrome users on mobile which requires non-extension based blocking.
Going for someone else's numbers instead of trying to build my own I'm finding anything from 10% to near 50% with most estimates being in the range of ~25%.
> and that's ignoring the >50% of Chrome users on mobile which requires non-extension based blocking.
That might be true for Chrome users on Android, but Chrome users on iOS (which aren't as many as Android users although), there isn't a choice of any extension nor non-extension based blocking. Firefox on iOS doesn't even allow extensions, and only Safari seems to have ad-blocking. At least last time I checked, might have changed lately.
I still wanted to block them though... so I started killing all `navigator.sendBeacon` requests by replacing it with a no-op function on page load. [0]
I have the no-op function log the results to console and it's fascinating seeing all the sites attempting to use it.Some pages on Amazon will fire a sendBeacon request every second or so.
[0] With this uBlock Origin user script: https://gist.github.com/varenc/7c0c17eea480a03d7c8844d81e608...
Question about the user script. Blocking WebSockets I can understand as they can be used for exfiltrating data you don't want them to get a hold of. But why disable WASM? It can't be used for exfiltrating, and disabling it probably gives them a stronger data-point than just leaving it on, for when they are able to exfiltrate data (via CSS HTTP requests for example).
Interesting. Are there tools we can install to send malicious payloads to surveillance companies?
On the other hand, the more I read about stuff like this, the more disenchanted I am with the "modern web". When something as seemingly innocent as a link can "stealthily" do something else when it's clicked, but otherwise looks exactly the same as a benign one (and moreover, behaves entirely as expected with JS off), it really brings into question whose interests such features are designed to serve.
And for this one, you could. Native applications might seem like you'll "submit the form when you click on the submit button, but something else entirely happens" because it's a general computing environment, just like the web.
So in reality, it seems you're just against "modern" computing in general, not specifically the web. Because you can have that behavior anywhere, not just in the web platform.
Casual gaming is an excellent example of how this has changed. The whole purpose of the software is different. It used to be that you would buy a game—a piece of software purpose-built to entertain you. Now you are no longer buying a game; you are buying a value extraction device that uses a game as bait. Software just isn't built for users anymore.
This applies to a lot of things besides games nowadays. A lot of software (and certain hardware - "smart" devices, etc) are built/sold at a loss with the primary objective being to generate "engagement" and/or collect personal data. The functionality of the device is purely there as a bait to get the mark to buy/adopt the software or device and would not be there if there was a way to get the marks to "engage" anyway.
But it can feel as if the capability to act as a hypertext platform has disappeared, because you now have to worry about it doing things that are not aligned with this purpose. Remember, there is power in limitations, as type theory teaches us.
And even for use cases where more than simple hypertext is needed, there is still a vast, nuanced chasm between that and full-blown Turing completeness.
I believe the name Gemini was chosen to imply a middle-ground between Gopher and HTTP (Gemini was the NASA project between Mercury and Apollo).
A limited form of this already exists—noscript. Browse with JS off, but add exceptions for true web apps. It should be possible to expand on this to create a middle ground where certain JS operations are allowed (say, DOM manipulation) but most are not (no network requests).
I'm also against people working against my interest that only use pen and paper. Perhaps this issue is more about privacy and ethics than some judgement of being for or against some "modern" notion of computing.
Personally I'd prefer platforms that have privacy (and security) guarantees built in. Given the strong conflict of interests at play, I don't think we can expect that from any of the big players (if it's even reasonable at scale).
The biggest problem with the web is that it has been made into a general computing environment. Instead of creating another separate network - the web for docs, the app web for apps, with different url schemas etc - the web has been co-opted for this second case, thereby making it much less useful/safe for its original purpose.
In fact I run a number of VMs with no internet access to keep my tools under my control.
No need for that. Stop hoarding data!
Why do you think end-users install things like "uBlock Origin", or why do smartphone manufacturers like Apple introduce features like random MAC address generation when connecting to wireless networks? Why do people use VPNs in the first place?
Because data points are being collected without our consent to profile us, and most of us do not want that.
The type of differentiation you are talking about by definition lacks consent, because if you had consent it would be trivial, you could do it by cookies or other forms of identification that the user consented to.
How can you honestly not think that knowing an accurate count of visitors is a useful metric?
Then again that would be fun to send enough nice bogus log information... As clearly that is what they want.
If you specifically want to track when a user leaves a page, you will miss a lot of events this way.
A beacon sent for each click on links on the form's page will tell you how many users left for this or that other page, which is very useful to know and optimize by removing the link and/or bringing its contents to the page itself.
A beacon sent for each form submission attempt will tell you how many users make mistakes while filling in the form, how good the error messages are, and whether the users tend to fix their input or leave.
Bonus points for incrementing an "attempt" hidden field on each submit button click so that you can see how many attempts it takes for all fields to be filled correctly.
Tracking what works and what doesn't can drive a lot of UX improvements, for the immediate and measurable benefit of the user.
But again, no silver-bullet.
How can you tell?
> ‘Personal data’ means any information relating to an identified or identifiable natural person (‘data subject’); an identifiable natural person is one who can be identified, directly or indirectly, in particular by reference to an identifier such as a name, an identification number, location data, an online identifier or to one or more factors specific to the physical, physiological, genetic, mental, economic, cultural or social identity of that natural person.
Maybe that could be one good outcome of such an API.
Popups exchange long-term trust in your brand for short-term profits. Of course it's the case that if you pop a modal in front of everyone, your conversion stats will go up. But potential life-time customers who have faith in your brand and believe in your mission will lose trust in you quickly and probably never sign up in the first place.
For me, it always comes down to the primary rule of UX: if you wouldn't do it IRL, don't do it online.
You can ask for someone's email if they look like they're interested in something you're selling, but don't ask for it the moment they enter your store!
That could be the motto of most every modern MBA.
The lack of a Remote Strangulation Protocol (https://wiki.kluv.in/a/RemoteStrangulationProtocol) is a problem again.
Think of it this way: if the site that you have long term trust for does this, it means the previous methods weren’t working. The ‘trust’ was broken.
Would love to see your advice applied to your own life.
What you don't realise is that x number of people join the list and x number of people tolerate being spammed with 'did you know we sell stuff' emails every day for the rest of their lives. x number of those people actually do buy something; likley the thing they intended to buy originally but joined the email list in case a discount code would be the subject of the first 'welcome' email because this is what they have been trained to expect.
All this has been A/B tested and, thus, has been 'proven' to be great business practice.
I’d happily trigger their exit intent handler and juice their “this feature is a total game-changer for our business!” reporting.
Little sad that Firefox not supporting an API only downgrades that API's browser support to "good" instead of "unusable" these days
Another example is trimming referrer URLs (just keeping the domain).
As a side note, I was somehow completely unaware of that feature (and I don't think in a "heard about it and forgot" sort of way). Every day is a school day...
There's Chrome and there's Safari. Rest of browsers are rounding errors. And even those rounding errors are mostly chromiums. Sad indeed.
Anyway, the best solution is to pass any links through a redirect which is responsible for logging the visit. That's how Google tracks what search results get clicked on. And it doesn't require any JavaScript.
I'm surprised they didn't even mention it as a possibility.
Social services where users want to signal if they are online/offline
Users who want to know how much time they've spent on a platform.
Closing down sessions for things that can be expensive to just run "forever". Think VMs and similar that gets started when the user visits the page, that you want to turn off when they leave.
The use cases are many, and there are also many other alternative solutions, this is obviously not the only one. But as always, all of them come with their own tradeoffs, so this technique might be the best for some of them.
The best you can hope for is a "happy path" where you can clear up a little sooner in most cases, but you can't rely on it.
If a user being on a webpage is holding open a resource, that might be an architectural issue.
That definitely is an architectural issue. Unfortunately it is essentially a cache management matter (cache invalidation considers when something becomes useless/wasteful, as well as when it becomes incorrect) which is a hard problem to solve.
There are legitimate circumstances where a user causes a long running prices to start, that it is wasteful to continue if incomplete when they vanish (because the result isn't going to be useful to another user, or even that same user if they return).
While you can't catch everything (the user's machine losing power or all connectivity, etc.) you can catch a deliberate exit. And in the case of a long running process, if the user's exit was accidental it is more likely that they'll be back and having continued the process is useful.
Closing off cached resources when a user vanishes is a good thing, it saves resources for other users and could, if I may stretch a little, have environmental impact. Noting that sessions tend to end after a particular set of circumstances could mean spoting something in your application that is annoying people, something that particularly in an SPA you might otherwise not easily detect.
Sometimes tracking is legitimately benign. It is only when unnecessary PII is included, and kept to track each specific user over time rather than just over a session, that it gets stalky to the point of begin in my "I won't do that" list (sharing the PII around further gets you on my "you are morally wrong for doing that" list).
> surprised they didn't even mention it as a possibility
The article is focused on detecting when a user leaves. While a fair amount if that will be detectable because they've clicked a link, it doesn't cover the large case set that is closing tabs and windows.
Something I might have to investigate (or search to see if someone else has): do any of these techniques work reliably on controlled OS shutdown.
What evil things were we doing? Well, I wanted to know if people were using the links I put inside popups, like to Google Scholar. Was anyone using them? If not, they were just so much clutter and should be removed for the users' benefit. I also wanted to get a list of outbound links by popularity, so I could write summaries/annotations for the most popular unannotated links, and rank dead links by priority for fixing (there are too many unannotated or dead links to 'just fix', so a ranking would've helped a lot).
But the link tracking never worked, so, I couldn't do any of that.
at least you don't have to wait for the timeout to expire if the user properly closed the application/website, which happens most of the time
Access to client side scripts on my machine has to be earned in trust.
Most websites never get that far, because they are broken without js.
Doesn't matter, saves me a lot of time ;)
I have zero interest in "apps that can improve my life". People have different interests.
Disclaimer: I write us for a living.
I agree that it's all about trust. Why would you ever enter information on a website you don't trust? What extra information can be gathered using JS that can't be otherwise? Or what is the exact harm done if they send extra requests to a tracking API?
My point is that once you access a specific website you consent with that website sending HTML/CSS/JS to your computer and executing it. The biggest problem those days is when that website is sending your information to other entities, 3rd parties, for other purposes than improving your experience. I think having "tracking" to detect errors, loading time issues and improving the user experience is perfectly reasonable if implemented in a proper way.
Just HTML and CSS in my case.
Actually I think that's the whole reason of introducing this attribute.
The only good thing coming out of this ping attribute is that it’s a lot easier for plugins to block it rather than intercepting javascript and domains.
https://github.com/gorhill/uBlock/wiki/Dashboard:-Settings#d...
Weirdest case I've observed in the wild is a site that works perfectly without referer header, except for logout. As usual for anything requiring referer it fails without a user-readable message without referer. If referer is sent, the logout procedure switches through multiple redirects and some waiting while js is doing something, server backend probably, too.
Some sites make weird assumptions about the network, the browser, and the user.
IE11 is the last browser that can reliably send a request before the tab closes (by using synchrous).
I swear telling the business guys that we had no way to run an action when someone closed the page had them nearly running back to IE. And for that specific functionality, I find it hard to disagree.
In our case, we lock entities when someone starts working on them, but now we have no way to unlock them if they fat-finger the close button, or press one too many backspaces.
On a general level, locking is a subpar solution for distributed systems. You should try to build support for automatic resolution of (most) edit conflicts instead, and forego locking altogether. If that's not possible, try to make the locks smart, e.g. so they auto expire unless periodically renewed.
At first thought I don't like it.
But at second thought I think that I like it. Issue is, webmasters will still track you, like it or not. But with those dedicated APIs tracking will be less annoying and those who can control their browsers, can disable that kind of tracking more easily (provided that they're even aware of those features).
Anyway I don't like the direction web standards are evolving. Why have so many custom APIs and attributes? There's already fetch priority flag, that should be enough. This is exponential explosion of APIs. Modern API designers don't know about concept of orthogonal APIs (or I don't know something).
Also <a ping attribute seems to track user even if he disabled JavaScript. Bad bad thing.
Oh wait, not on mobile, unless you're willing to deviate from stable releases or download a fork.
I feel tempted to write an addon that will catch tracking like this and just repeat every ping a thousand times across the rest of the day, perhaps with some permutations of the data these sites are trying to collect. If I can't stop you from collecting my data, I'll make my data useless to you instead.
I realize there are a lot of different strategies for addressing this situation, and I'd be curious to hear how others have solved this problem.
In the specific case of using sendBeacon, it is a little disheartening that once a basic programming tool gets abused by the analytics/advertising/tracking behemoths then the ad blockers' only recourse at times is to disable it completely. I completely support the efforts made by the ad blockers, but also find it sad how legitimate uses of certain tools end up getting blocked in the process.
A client browser can crash, the computer can lose power, the network can be unplugged, the router can crash, the internet connection can go down.
It doesn't matter why, there are many common reasons why you can't rely on an unlock signal, so must be able to deal with that situation. If you realize that from the beginning and design accordingly, it's usually easier to handle than realizing it later and trying to add special cases to catch it later.
For example, if you know the above is a problem, you might just opt to make a lock for a record the I'd of the locking user and the last lock update time, and update the lock every few seconds during normal operation when locked. If there's a problem, that user can pick up the lock without problem when reconnecting, but if any other user attempts to lock the record and the lock hasn't been updated in a minute or two, then consider it invalid and let the new user lock. Anyone attempting to edit a record with a lock that isn't too old is told it's actively locked and to try back in a few minutes. All of a sudden your lock release problems are automatically cleaned up by normal use, can be easiest found as needed by searching for old timestamps, and the person that has to deal with problems is the person with the behavior/system causing the problem.
There are obviously more complicated (and for some cases better) solutions, but the takeaway is to look at the problem and constraints as a whole and find a solution with the right trade offs given your needs, and not let the constant accretion of small features lead you to a suboptimal solution what doesn't work.
Other people have recommended CRDTs and Optimistic Concurrency control, which is great if you are designing an app from the ground up. If you have an existing large app that just needs locks, though, I recommend following the Chubby paper: https://research.google.com/archive/chubby-osdi06.pdf
Section 2.4 Locks addresses how Chubby thinks about locking in a distributed system:
It is costly to introduce sequence numbers into all the interactions in an existing complex system. Instead, Chubby provides a means by which sequence numbers can be introduced into only those interactions that make use of locks. At any time, a lock holder may request a sequencer, an opaque byte-string that describes the state of the lock immediately after acquisition. It contains the name of the lock, the mode in which it was acquired (exclusive or shared), and the lock generation number. The client passes the sequencer to servers (such as file servers) if it expects the operation to be protected by the lock. The recipient server is expected to test whether the sequencer is still valid and has the appropriate mode; if not, it should reject the request. The validity of a sequencer can be checked against the server’s Chubby cache or, if the server does not wish to maintain a session with Chubby, against the most recent sequencer that the server has observed. The sequencer mechanism requires only the addition of a string to affected messages, and is easily explained to our developers.
Although we find sequencers simple to use, important protocols evolve slowly. Chubby therefore provides an imperfect but easier mechanism to reduce the risk of delayed or re-ordered requests to servers that do not sup- port sequencers. If a client releases a lock in the normal way, it is immediately available for other clients to claim, as one would expect. However, if a lock becomes free because the holder has failed or become inaccessible, the lock server will prevent other clients from claiming the lock for a period called the lock-delay. Clients may specify any lock-delay up to some bound, currently one minute; this limit prevents a faulty client from making a lock (and thus some resource) unavailable for an arbitrarily long time. While imperfect, the lock-delay protects unmodified servers and clients from everyday problems caused by message delays and restarts
Check here: https://developer.mozilla.org/en-US/docs/Web/API/Navigator/s...
> However, this is extremely unreliable. In many situations, especially on mobile, the browser will not fire the unload, beforeunload, or pagehide events.
From my casual observation of Firefox (I use the network debugging tools in Firefox frequently) there isn't a column for priority. Firefox also does not show a status of pending, rather it just omits a pending status until a status becomes available.
navigator.sendBeacon = undefined
before any JS has a chance to run. You can also trap "beforeunload" listeners, or just delete them document.body.onbeforeunload=null document.onbeforeunload=nullAt a minimum, this kind of information is relevant to the people creating products like Heap or Amplitude.
I work at Heap and am just curious why you would still want to implement manually coded tracking.
I think there’s some utility in a company owning an abstraction away from a third party.
Supposing if Amplitude (or Heap) were to ever go under, or if we were to want to change Analytics providers for whatever reason, it would be extremely helpful if the code didn’t depend directly on these third parties.
On a smaller app, I would mostly likely directly use the Heap or Amplitude APIs.
(Late reply, apologies)
You get incomplete, inaccurate data.
It's also fun and good for curiosity to do something on your own rathern than rely on a service and never think about what browsers can do.
Mammon is the only thing that matters to a lot of primates.
There will never be market pushback as long as those externalities aren’t priced in. And Imho the only for that to happen is for governments to introduce regulation, e.g. by taxing the externalities so that “free” service providers are forced to be more upfront about the actual cost of their service.
Typically the reason is, that they don't know how to do it any other way.
We are rich in compute and we don't feel the need to optimize anymore. Optimization is an afterthought or a never thought and features run the world.
0: https://spcodex.wiki/wiki/Billy_Corgan_2022-02-06_(early_sho...
We have competent design tools running in the browser now… we’re doing fine.
[1] https://support.microsoft.com/en-us/office/turn-off-office-a...
[2] https://docs.microsoft.com/en-us/troubleshoot/windows-server...
https://www.extremetech.com/computing/261148-modern-computer....
Going through dozens upon dozens of layers (ever increasing) just to draw a rectangular box with some text inside is creeping complexity.
So, yes, I am fine on my beast machine, still the direction is wrong for me.
20 years ago software was running locally. Now, it must communicate with mothership for every action you make. Tools running in the browser are slow, because they use the browser to get user input or to display information.
In particular, this image offers a nice comparison of some newer and older pieces of software: https://pavelfatin.com/images/typing/editor-latency-windows-...
That said, typing isn't everything, but there are stark differences even in something so basic.
People noticed that the windows built-in terminal app has noticeable latency, and when the WSL1 team implemented their own terminal app, they ended up with much better latency [1]. I wonder if this input lag test was done using the built-in terminal or this WSL1 terminal.
In what world was anything faster 20 years ago? Do these readers not remember waiting minutes for their computer to start up?
reader-view doesn't show the images, and for me the webdesign is too hostile to read the content without reader-mode.
Please don't build websites that are attention-expensive to consume, everything about it is terrible.
If your content is text, ship it on a neutral background, everything else is not acceptable.
You can't expect everyone to reverse engineer your browser to make your reader mode experience better. Reader mode is explicitly a client side algorithm, parsing and displaying a document for you, the user. If reader mode doesn't work right for you, you should file an issue with your browser maker. After all, they're the ones that designed the algorithm to partially hide the contents of the web page for you.
For what it's worth, I have no issue viewing the images in Firefox's reader mode.
I can't see any super distracting content on this page anyway. There's a black side bar and the text is almost black on white. Perhaps you're referring to the header, but even that's mostly white and black. There are definitely some places where accessibility can be improved, but this is hardly "not acceptable".
This kind of thinking is what got us brutalism. I think I prefer the embellished versions.
The person who made this website apparently prefers something different to you and me.