统计Google广告点击次数的方法
象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"
sr