Some commentators originally suggested that affiliate links work best in the context of the information contained within the website itself. For instance, if a website contains information pertaining to publishing a website, an affiliate link leading to a merchant's internet service provider (ISP) within that website's content would be appropriate. If a website contains information pertaining to sports, an affiliate link leading to a sporting goods website may work well within the context of the articles and information about sports. The goal, in this case, is to publish quality information on the website and provide context-oriented links to related merchant's websites.
Always disclose your affiliate relationship. Most visitors will probably understand that graphic ad will lead to your getting paid, but if you write a review or use an in-text link as a recommendation, you want your readers to know that may lead to compensation as well. This ensures you retain transparency and trust with your readers, but also, it's required by the FTC's endorsement rules.