Tuesday, December 7, 2021

Are 14 people looking at that product?

I know you’re probably distracted by the fact that it says, in bold, uppercase letters: “Innovation at it’s finest,” rather than the grammatically correct “its,” but I want you to look at the piece of text that reads: “14 people are currently looking at this product.”

Screenshot from dafnihair.com taken on 2020–06–11.

While you can’t tell from a still image, this number stood out for me as it changed drastically every few seconds. I decided to take a look at the source code to examine what method they use to update the number.

In case you’re not aware, in order for developers to update elements on a website after it has first been loaded, they generally have to use a client-side language. These languages are run in your web browser, and as such, you can view it yourself. By simply right-clicking just about anywhere on a page and selecting something akin to “View source,” you can examine what code is being run to update elements such as the number of people currently viewing products.

In this particular e-commerce, I found this code:

A method found in the source code for dafnihair.com. The image itself was made by the author.

This is an exact copy of the code. Yes, it says “prodiutc” in the source code. But more interestingly, this code clearly shows that the number of people presented as viewing the product is blatantly random.

I translated the code into human language:

The Javascript code translated into human language. The image is made by the author.

The number of people viewing the article is thus a complete fabrication. The code simply generates a random number every five seconds. This makes it appear as though people are constantly browsing the website, making it seem lively and busy. It’s probably supposed to make the website look more trustworthy, as many other people appear to be browsing. It can also encourage customers to checkout as quickly as possible, as the product they are interested in might be in high demand.

In the event that you are reading this in the far future and the website has since been updated, you might be happy to know that the website was indexed by the web archives crawlers on May 16th, 2020 — and this code is saved in it. You can find an indexed version of the website here.

If you find something similar when you’re out exploring the world wild web, don’t be afraid to view the source code and see if you can find something fishy lurking beneath the interface.

Website owners may lie, but the code never does.



from Hacker News https://ift.tt/3rI44cF

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.