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,
, is His slave and Messenger.
If the affiliates’ work is limited only to advertising your company or products and charge you, then this act is permissible since it is called brokerage which is permissible in the Sharee'ah. But the majority of the Muslim scholars are of the opinion that the percentage of the charges from the profit should be known, or that a known amount should be specified beforehand. However, some scholars are of the opinion that brokerage is permissible even if the charges are not specified.
On the other hand, putting your ads or banners beside other forbidden ads on wine and intoxicants and the like, does not harm you since you have no relation to those ads, hence you are not responsible for them.
Allaah Knows best.