基于cookie隐藏Adsense
我不想使用 javascript 并基于 cookie 为登录会员显示 Adsense。两种类型的成员都会看到相同的 html,因为它是从服务器缓存的。我知道我可以隐藏包含的 div,但我相信这违反了 TOS,并且也会被视为错误的印象。实际的谷歌脚本无法更改。我想我只需要以某种方式阻止它在谷歌代码之前或之后使用一些javascript加载show_ads.js。
<script type="text/javascript"><!--
google_ad_client = "ca-pub-555";
google_ad_slot = "555";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
I'd like to not show Adsense for logged in members, using javascript and based on a cookie. Both types of members see the same html, as it's cached from the server. I know I could just hide the containing div, but I believe that is against the TOS and would also count as a false impression. The actual google script cannot be changed. I think I just need to somehow stop it loading the show_ads.js using some javascript before or after the google code.
<script type="text/javascript"><!--
google_ad_client = "ca-pub-555";
google_ad_slot = "555";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最好的办法是使用服务器端脚本(PHP、ASP 等)删除 adsense 代码。这是一些 PHP 的伪代码:
The best bet would be to remove the adsense code using server-side scripting (PHP, ASP, etc). Here's some pseudo code for PHP: