Digg users and Adsense

Digg users and Adsense

It is a popular theory that users coming to your website from Digg and other social media websites, are usually blind to ads and therefore aren’t likely to click them.

This is one reason why many publishers prefer to display Google Adsense (or other forms of advertisement) only to users coming in via search engines.

Some people have argued that doing this won’t hurt your overall earnings and you may just be wasting ad space that could have earned something, even if the click-through rate (CTR) went way down.

However, think about it from an advertiser’s point of view. If I’m paying for ads on your website and getting only a few or no clicks in return, either there is something wrong with my ad or I need to find another website.

By that rationale, my preference as a publisher would be to have a higher CTR to attract higher-paying ads. This is the code I use to check for the referring website and hide my ads from Diggers:

<?php
# Let publish_ads be TRUE to start off with
$publish_ads = TRUE;
# Check that we have an HTTP_REFERER header
if(isset($_SERVER['HTTP_REFERER'])) {
    # See if the header contains "digg.com"
    if (strpos($_SERVER['HTTP_REFERER'], 'digg.com')) {
        # It does, so set publish_ads to FALSE
        $publish_ads = FALSE;
    }
}
?>

We could use a similar approach to do the opposite. i.e. display ads only to search users (users coming in from Google searches, for example).

<?php
# Let publish_ads be FALSE to start off with
$publish_ads = FALSE;
# Check that we have an HTTP_REFERER header
if(isset($_SERVER['HTTP_REFERER'])) {
    # See if the header contains "google.co"
    if (strpos($_SERVER['HTTP_REFERER'], 'google.co')) {
        # It does, so set publish_ads to TRUE
        $publish_ads = TRUE;
    }
}
?>

Now you can check for $publish_ads any place you want to display or suppress the ads:

<?php
# Check if $publish_ads is set to TRUE and display the adsense code if it is
if ($publish_ads == TRUE) {
?>
<script type="text/javascript"><!--
google_ad_client = "pub-0000000000000000";
/* css, 468x60, inline-banner, created 1/1/01 */
google_ad_slot = "0000000000";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<?php
#Now we close the if
}
?>

There you have it.

1,583 Comments

  1. I would be carefull with the G+ button. Some of my collegues have experienced big SERP drops if used as a SEO objective. Google may interprete manipulation & punish. As always, natural & common sense build-up… Cheers

Leave a Reply