It is permissible to market products in return for a known commission or fee, on condition that the products are permissible and the marketing is done by showing pictures of the products and links on social media websites or elsewhere.
As for the method described, it is unlawful, because it is cheating those who visit the trader’s website and is deceiving them by showing them that there are purchases and that the products are popular, when it is all a pretence, and cheating and deceiving are prohibited.
Muslim (102) narrated from Abu Hurayrah that the Messenger of Allah (blessings and peace of Allah be upon him) said: “Whoever deceives is not of me.”
And it was narrated that `Abdullah ibn Mas`ud (may Allah be pleased with him) said: The Messenger of Allah (blessings and peace of Allah be upon him said: “Beware of lying, for lying leads to wickedness and wickedness leads to Hell. A man may tell lies until he is recorded with Allah as a liar.” Narrated by al-Bukhari, 5743; Muslim, 2607.
And he (blessings and peace of Allah be upon him) said: “Scheming and cheating lead to the Fire.” Narrated by al-Bayhaqi in Shu`ab al-Iman; classed as authentic by al-Albani in Sahih al-Jami`. Al-Bukhari narrated it in his Sahih in a mu`allaq report as follows: “Cheating leads to the Fire, and whoever does an action that is not in accordance with our matter, it will be rejected.”
Whoever acquired some of these unlawful earnings before knowing that they are prohibited, there is nothing wrong with him making use of them, but whatever he acquired after coming to know, he must get rid of it by giving it to the poor and needy or spending it on public interests.
Allah, may He be Exalted, says: {So whoever has received an admonition from his Lord and desists may have what is past} [al-Baqarah 2:275].
Shaykh Ibn `Uthaymin (may Allah have mercy on him) said: What we learn from this verse is that what a person received of riba before coming to know of the prohibition on it is permissible for him to keep, on condition that he repents and stops engaging in such transactions.
End quote from Tafsir Surat al-Baqarah, 3/377.
And things other than riba come under similar rulings.
And he does not have to return it to the trader who gave it to him, because the trader has got the service for which he paid that commission, and it is not possible to retract it from him. So he should not let him have both things, namely benefiting from the market then getting his commission back.
Shaykh al-Islam Ibn Taymiyah (may Allah have mercy on him) said: Whoever was paid for selling an unlawful item or doing an unlawful service such as carrying wine, or who received a fee for making a cross or a fee for prostitution and the like should give it in charity and repent from that unlawful action, and his giving in charity what he had earned thereby will be an expiation for what he did, because it is not permissible for him to make use of it, as it is unlawful earnings. And it should not be given back to the one who paid him, because he has benefited from the service in question; rather he should give it in charity as some of the scholars stated, and as Imam Ahmad stated in a similar case of one who carried wine, and as the companions of Malik and others also stated.
End quote from Majmu` al-Fatawa, 22/142.
And Allah knows best.