All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
A judgment on a given matter derives from the conceptualization of it. The clarity of the answer can only correspond to that of the question. The Prophet, sallallaahu ‘alayhi wa sallam, said: “I am only human! You people present your cases to me, and as some of you may be more articulate and persuasive in presenting his argument, I might make a judgment in his favor. So, if I give a Muslim's right to another, I am really giving him a piece of fire; so he should not take it.” [Al-Bukhari]
What you have mentioned in your question about the methods of advertising is ambiguous. If what you mean by purchasing space on the website is that the fee for renting space depends on the number of people who like it, then this is not permissible because it involves indeterminacy and risk.
As regards agreeing that the website receives a commission for every visitor that the website brings, then there is nothing wrong with it provided that it does not involve dishonesty or fraud by the site's owners or anyone else as clarified in Fataawa 292810 and 98851.
If however you meant something else, then please clarify it for us so we can answer accordingly.
Allaah Knows best.