javascript - How do I hide certain elements on my page, based on referral traffic? -
javascript - How do I hide certain elements on my page, based on referral traffic? -
more specifically, how hide ads? pose question after reading this: coding horror entry
in it, states
as courtesy, turn off ads digg, reddit, , other popular referring urls. audience doesn't appreciate ads, , they're to the lowest degree click them anyway.
i agree says. how do this?
i'd utilize php this, javascript code hide ads create you're hiding ads , gaining revenue them (google smart, they'll find doing that).
with php, however, can modify page before reaches user, eliminating problem. basically, conditionally check browser came from:
<?php $sites = array("reddit.com", "digg.com"); if (!in_array(parse_url($_server['http_referer'], php_url_host), $sites)) : ?> <div>your ads</div> <?php else:?> <div>hello reddit person</div> <?php endif; ?>
you'll have create site run php code (it'll dynamic) conditionally display ads. code won't work, though, reddit
isn't url, idea; check url reddit.com
.
javascript
Comments
Post a Comment