In the previously posted we try to secure an adsense ads by redirecting user with the same ip to another blog or another website. And now for a second way is to hide your adsense ads if the user’s IP address same as with the IP address that you use. <SCRIPT LANGUAGE=”JavaScript” SRC=”http://www.searchnc.com/cgi-bin/myip.pl”></SCRIPT> <SCRIPT LANGUAGE=”JavaScript”> Second, add the following code under the tag of <body> <SCRIPT LANGUAGE=”JavaScript”> Third, add the following code under the tag of </ body> <script>
First, login to your blogger account, then get into the HTML Edit menu, do not forget to tick the check box of Expand Widget Templates. After all Add the following code under the tag of <head>
function Hide(name) {
if (document.layers)
document[name].visibility = ‘hide’;
else {
var g = document.all ? document.all[name] : document.getElementById(name);
g.style.visibility = ‘hidden’;
g.style.display = ‘none’;
}
}
var ndx=IP.lastIndexOf(”.”);
var cblock=IP.substr(0,ndx);
</SCRIPT>
document.writeln(”Your IP: <B>”+IP+”</B>”);
</SCRIPT>
/*Hiding the ads:*/
if(cblock==”Your Ip address”) Hide(”location of id where an adsense code placed”);
</script>
Note :
IP address filled with your IP Address which you create an adsense activity. id is a name of location where your adsense script code placed. Example: the location of your adsense code is on widget of “id = ‘HTML2′ locked = ‘false’ title = ’sponsor’ type = ‘HTML’”, then you can replace the id with HTML2. Then save as the template. See the results , your ads will disappear!
Good Luck.
0 comments:
Post a Comment