统计google广告是否被点击次数
2012-10-28 12:53
453 查看
/*其实就是统计iframe中的链接被点击的次数*/
<html>
<head>
<title>统计点击计数</title>
<script language="javascript">
<!--
function keyDown(e)
{
//浏览器的X坐标
document.getElementById("xxx").innerHTML = event.clientX;
//浏览器的Y坐标
yyy.innerHTML = event.clientY;
/*
//event.srcElement就是指向触发事件的元素,他是什么就有什么的属性 srcElement 是事件初始目标的html元素对象引用,因为事件通过元素容器层次冒泡,可以在任一层进行处理,所以由一个属性指向产生初始事件的元素是很有帮助的.有了元素的引用,就可以读/写改元素的属性,并调用他的任何方法.
*/
se.innerHTML = event.srcElement.tagName;
/*
//属性,srcElement 产生事件的节点(DHTML对象) 当当前事件有移动成分时,如onmouseover、onmouseout等 fromElement、toElement 表示移动事件的两个端点
*/
fe.innerHTML = event.fromElement;
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;
}
}
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> <div id="xxx">x坐标</div><div id="yyy">y坐标</div><div id="se">来自</div><div id="fe">来自</div>
<iframe name='ad_click' marginwidth="0"
marginheight="0" frameborder="0" scrolling="no"
src='http://www.9core.com/' width="100"
height="100" style="width: 616px; height: 171px">
</iframe>
<br />
<br />
<a href="http://www.aili8.com/" target="_blank">8网</a>
</body>
</html>
<html>
<head>
<title>统计点击计数</title>
<script language="javascript">
<!--
function keyDown(e)
{
//浏览器的X坐标
document.getElementById("xxx").innerHTML = event.clientX;
//浏览器的Y坐标
yyy.innerHTML = event.clientY;
/*
//event.srcElement就是指向触发事件的元素,他是什么就有什么的属性 srcElement 是事件初始目标的html元素对象引用,因为事件通过元素容器层次冒泡,可以在任一层进行处理,所以由一个属性指向产生初始事件的元素是很有帮助的.有了元素的引用,就可以读/写改元素的属性,并调用他的任何方法.
*/
se.innerHTML = event.srcElement.tagName;
/*
//属性,srcElement 产生事件的节点(DHTML对象) 当当前事件有移动成分时,如onmouseover、onmouseout等 fromElement、toElement 表示移动事件的两个端点
*/
fe.innerHTML = event.fromElement;
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;
}
}
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> <div id="xxx">x坐标</div><div id="yyy">y坐标</div><div id="se">来自</div><div id="fe">来自</div>
<iframe name='ad_click' marginwidth="0"
marginheight="0" frameborder="0" scrolling="no"
src='http://www.9core.com/' width="100"
height="100" style="width: 616px; height: 171px">
</iframe>
<br />
<br />
<a href="http://www.aili8.com/" target="_blank">8网</a>
</body>
</html>
相关文章推荐
- 统计Google广告点击次数的方法
- 如何统计Google广告点击次数
- 统计Google广告点击次数的方法
- 实现:判断某个元素是否在集合中,统计一段时间内的点击UV数(亿级别)
- 刚刚发现不能支持Google广告代码和统计了
- Java编程练习之判断Java文件名是否正确,判断邮箱格式是否正确和统计指定字符串中某字符现的次数
- 链接,广告点击次数记录
- 统计键盘输入和鼠标点击的次数
- AdSense 收入 = 广告展示次数 x 点击率 x 点击单价 x 智能定价因素(转载)
- Google推出新措施打击广告欺诈点击
- 统计整个App 的每个按钮点击次数
- 学着用map统计字符出现的次数,也可以用来标记字符是否出现过
- Google 搜寻的广告效果,是否被过度放大?未完,待续…..
- php 广告点击统计代码(php+mysql)
- 鼠标移动距离点击次数及键盘敲击次数每日统计帖(看看老板是怎么剥削我们的手指),每日更新
- 第110讲: Spark Streaming电商广告点击综合案例通过updateStateByKey等实现广告点击流量的在线更新统计
- 咪咕笔试题目:统计键盘写入一个字符串的按键点击次数
- 点击出现图片与统计点击次数
- JS实现在线统计一个页面内鼠标点击次数的方法
- google广告的单价与点击-智能价格系统