追踪Google Adsense点击的代码

Spread the love

Google Adsense 广告点击追踪的代码,亲测有效。

<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>& m4 {) ^6 B i
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ />$ A. L% `: q6 y4 l9 h
<title> Afilter Tracker Google 广告点击追踪演示</title>
<script src=”https://code.jquery.com/jquery-3.3.1.min.js”></script>’ N8 _’ {7 j, U4 T1 o. J1 P
<script type=”text/javascript”>

var isOverGoogleAd = false;
var ad = /adsbygoogle/;

$(document).ready(function()7 a8 o+ Y& e$ _, s
{
$(‘ins’).on(‘mouseover’, function () {” D! [4 _$ Y8 h3 `’ e
if(ad.test($(this).attr(‘class’))){6 g, }. v6 Z5 r O* c) O1 \
isOverGoogleAd = true;
}
});9 v” I; v% ` K; _! N0 U# G, K
$(‘ins’).on(‘mouseout’, function () {
if(ad.test($(this).attr(‘class’))){
isOverGoogleAd = false;
}
});
});
( Q’ S6 e5 d5 G
$(window).blur(function(e){
if(isOverGoogleAd){
//检测到点击。- R- Y, }! }5 L: _: ^
}5 _! f1 |) f4 \
});, P’ D! V- t* J$ g
</script>: ~6 e” W& l b” C4 U& i$ k9 r
</head>
<body>

<script async src=’//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js’></script>
<!– qym –>
<ins class=’adsbygoogle’5 _, T2 \; A) V
style=’display:inline-block;width:970px;height:90px” l) K) m’ I! ]0 a6 \, `; l0 t0 g9 p
data-ad-client=’ca-pub-111111111111111’7 t# o’ _! x- S1 b% o
data-ad-slot=’1111111111′></ins>5 x3 o% C. ~- Q. _
<script>
(adsbygoogle = window.adsbygoogle || []).push({});” ?; z+ L3 k. O
</script>
” D) {6 F* C0 M9 i9 H9 ~
</body>
</html>

credit:adzon

advertising

發表迴響

你的電子郵件位址並不會被公開。 必要欄位標記為 *