【发布时间】:2012-09-07 08:19:19
【问题描述】:
在我的网站上我有 AdSense 广告。我受到点击繁荣的攻击。基本上我想检测用户何时点击广告,以便我可以在我的数据库中记录 IP,然后我将能够禁止点击次数最多的用户。现在我知道大多数 adsense 广告都是通过 iframe 标签运行的,但我还能做我想做的事吗? 任何想法将不胜感激。
【问题讨论】:
标签: php javascript adsense
在我的网站上我有 AdSense 广告。我受到点击繁荣的攻击。基本上我想检测用户何时点击广告,以便我可以在我的数据库中记录 IP,然后我将能够禁止点击次数最多的用户。现在我知道大多数 adsense 广告都是通过 iframe 标签运行的,但我还能做我想做的事吗? 任何想法将不胜感激。
【问题讨论】:
标签: php javascript adsense
尚未对此进行测试,但它应该可以工作。它基本上检查在触发模糊事件之前鼠标是否在广告上。
jQuery(function( $ ){
var isOverGoogleAd = false;
$( "iframe[ id *= google ]" ).mouseover(
function(){
isOverGoogleAd = true;
}
)
.mouseout(
function(){
isOverGoogleAd = false;
}
);
$( window ).blur(
function(){
if (isOverGoogleAd){
$.ajax({
type: "post",
url: "track.php",
data: {
adUrl: window.location.href
}
});
}
})
.focus();
});
取自here。
【讨论】: