More specifically, how do I hide ads? I pose this question after reading this:
coding horror entry
In it, he states
As a courtesy, turn off ads for Digg, Reddit, and other popular
referring URLs. This audience doesn’t appreciate ads, and they’re the
least likely to click them anyway.
I agree with what he says. So how do I do this?
I’d use PHP for this, as JavaScript code to hide ads will make you look like you’re hiding the ads for everyone and just gaining revenue from them (Google is smart, so they’ll find you for doing something like that).
With PHP, however, you can modify the page before it reaches the user, eliminating that problem. Basically, you conditionally check where the browser came from:
You’ll have to make your site run PHP code (it’ll be dynamic) to conditionally display your ads. This code won’t work, though, as
redditisn’t a URL, but you get the idea; check the URL forreddit.com.