优化 Google AdSense 提高你的收入

February 3rd, 2009 | Categories: 猫言猫语 | Tags: , ,

我们都知道:经常访问你的博客的人是不会点击你网页上的广告的,而往往是通过搜索引擎来到你的博客的人才点击你的广告的,通过 Google Analytics 我知道我的博客有93.02% 的新访客是通过搜索引擎进来的.

所以我们的广告只对来自搜索引擎的用户显示就可以了..

操作方法:
1. 用文本编辑器(不要用记事本!)打开你的主题文件夹下的functions.php文件
2. 在该文件里加上下述代码:

function scratch99_fromasearchengine(){
$ref = $_SERVER['HTTP_REFERER'];
$SE = array('/search?', 'images.google.', 'baidu.com', 'search.', 'del.icio.us/search', 'soso.com', '/search/', '.yahoo.');
foreach ($SE as $source) {
if (strpos($ref,$source)!==false) return true;
}
return false;
}

3.接下来,在你想显示广告的地方加入以下代码。

if (function_exists('scratch99_fromasearchengine')) {
if (scratch99_fromasearchengine()) {
INSERT YOUR CODE HERE // 这里插入你的广告代码
}
}

经过以上设置,我这个小小的博客,日Google AdSense从每天0.5到1,上升到1到1.5.
上个月才拿100刀~

Related posts:

  1. 17 个 Google Adsense 相关的 WordPress 插件
  2. Google Adsense 西联汇款热点问题的说明
  3. Google 提供的翻译Widget
  4. Google Toolbar for Firefox3
  5. 将留言区分显示Comments和Trackbacks
  1. April 14th, 2009 at 23:25

    这样做允许吗?会不会被 喀嚓? 可以的话 我也去试试!

  2. April 18th, 2009 at 23:42

    喜欢你这篇文章~

  3. April 18th, 2009 at 23:45

    这个代码的作用是什么?

  4. April 19th, 2009 at 09:06

    @断峰狼 只对搜索引擎来的访客显示广告~

    @Love Blog Earn 暂时还是没问题~

Comment pages