【问题标题】:Track IP Address of Users Clicking on Adsense Ads [closed]跟踪点击 Adsense 广告的用户的 IP 地址 [关闭]
【发布时间】:2012-09-07 08:19:19
【问题描述】:

在我的网站上我有 AdSense 广告。我受到点击繁荣的攻击。基本上我想检测用户何时点击广告,以便我可以在我的数据库中记录 IP,然后我将能够禁止点击次数最多的用户。现在我知道大多数 adsense 广告都是通过 iframe 标签运行的,但我还能做我想做的事吗? 任何想法将不胜感激。

【问题讨论】:

    标签: php javascript adsense


    【解决方案1】:

    尚未对此进行测试,但它应该可以工作。它基本上检查在触发模糊事件之前鼠标是否在广告上。

    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

    【讨论】:

      猜你喜欢
      • 2010-11-27
      • 1970-01-01
      • 2010-09-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-03-13
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多