文章分类 | 软件分类 | 最新软件 | 杀毒软件 | 实用软件  | MTV下载  | 设为首页 |
  | 下载分类 | 最近更新
您的位置: 首页 >> 文章首页 >> 精文荟萃 >> Google排名 >>  
Google排名点击TOP10
·红牌罚下 Google大规模封杀中文作弊网站纪实2006-2-9 16:24:49
·GOOGLE正式在上海成立办公室 并购百度提速2006-2-10 14:19:27
·Google新增多种实用功能 狙击雅虎一搜2006-2-9 17:41:36
·Google又一次让世人震惊2006-2-6 8:43:06
·SEO:链接质量漏损问题2006-2-9 18:01:08
·在google上排第几名比较爽2006-2-9 12:42:02
·Google双重列表(Double-Listing)探析2006-2-8 19:33:56
·在网站上实现 Google Reader 一键订阅2006-2-10 13:00:48
·Google首次详解中国攻略 启动SEO黑名单计划2006-2-10 12:24:06
·Google推出新搜索新服务—Google学者2006-2-10 12:01:17
精文荟萃点击TOP10
·轻松打造一个漂亮又专业的Flash屏保2006-2-5 13:34:29
·DIY初学者必读 解读CRT显示器的性能参数2006-2-8 18:28:40
·WAP网大全2006-2-9 19:02:47
·“3.15”网站打假专题——中国大陆TOP500网站排行榜(Alexa过滤版)2006-2-9 10:29:26
·DOS教学2006-2-5 13:07:32
·硬盘分区全攻略2006-2-9 10:20:26
·平面设计常用制作尺寸2006-2-5 12:25:24
·2005八种必死网站探密 ----你的网站有这毛病么2006-2-9 20:45:20
·红牌罚下 Google大规模封杀中文作弊网站纪实2006-2-9 16:24:49
·只修改config中一个值 DOOM3速度就提升?2006-2-5 16:40:03

 

统计Google广告点击次数的方法
作者:我去下载           时间:2006-2-10 16:15:09


象Google的广告,展示啥内容,都是由Google自己控制的,使用普通的页面提交连接的方式,我们是无法统计我们页面上的Google广告被点击了多少次,被谁点击了。因为这些页面都不受我们控制。
  下面介绍一个可以统计Google那样广告点击次数的方法。

<html>
<head>
    <title>点击计数</title>
    <script language="javascript">
    <!--
    function keyDown(e)
   {
        if (event.srcElement.tagName=='IFRAME'
        && event.clientX==-1
        && event.clientY==-1
        && event.fromElement=='[object]'){
            // 如果需要向其他页面提交
            //document.adform.submit();
            var num = parseInt(shownum.innerHTML);
            shownum.innerHTML = num + 1;
        }
        return false;
    }
document.onmousemove=keyDown;
document.onmouseover=keyDown ;
document.onmouseout=keyDown ;
document.onblur=keyDown;
    //-->
    </script>
</head>
<body>
<!-- 如果需要向另外一个页面传递参数,可以用下面的方式//-->
    <form name="adform" method="post" action="ad_click.php" target='ad_click'>
        <input name="uid" value='1922' type="hidden" id="uid">
        <input name="keyid" type="hidden"
            value='1119342517' id="keyid">
            <input name="aid" type="hidden" id="aid">
            </form>
    <iframe name='ad_click' marginwidth="0"
    marginheight="0" frameborder="0" scrolling="no"
        src='about:blank' width="0" height="0">
        </iframe>
<!--页面提交代码结束//-->       

    点击IFrame中的次数:<div id="shownum">
        0</div>
    <iframe name='ad_click' marginwidth="0"
     marginheight="0" frameborder="0" scrolling="no"
        src='http://www.yesky.net/' width="100"
        height="100" style="width: 616px; height: 171px">
    </iframe>
    <br />
    <br />
    <a href="http://blog.joycode.com/" target="_blank">本页其它连接</a>
</body>
</html>
  上述代码中,我们在点击、移动等事件中,判断用户点击的是不是某个需要的范围内。然后进行计数,如果我们需要额外的记录,可以在这些事件函数中,向一个我们可控的页面进行提交。为了不影响页面的展示,这个页面被提交的页面,是在一个隐含的IFrame中实现的,具体看上述代码就明白了。
通过以上的方法,我们就可以实现不论点本网站的自己广告,还是Google广告,每点击一次,增加多少可用分这类的逻辑了。(当然这个逻辑可以更复杂)

分页:
相关文章:
Copyright© 2005-2006 wqxz.com, All Rights Reserved. 购买虚拟主机请与本站联系