Google AdSense 和 AdBlock
我的网站上有 Google AdSense 广告,AdBlock 会阻止它们,这很好。当它们被阻止时,我想显示替代内容。问题是,当广告被拦截时,可能会发生两种情况:
1)广告被AdBlock完全抑制,AdSense广告的高度和宽度均为0,并且大部分AdSense代码不会生成。
2)AdSense广告内容被屏蔽,但设置了高度和宽度并生成了AdSense代码。
选项 1 非常完美,因为它允许我检查容器的高度或 AdSense 呈现的标记,并在高度为 0 或特定 AdSense 标记不存在时显示我的替代内容。但是,当选项 2 发生时,我不知道如何显示我的替代内容,并且 AdSense 广告占据了所需的高度和宽度,但不显示任何内容,使我的网站看起来很糟糕。
还有其他人有过这个问题的经验吗?我的网站采用 .net 4.0,到目前为止我只在 Chrome v12 中测试了 AdBlock。
I have Google AdSense ads on my site, and AdBlock blocks them, which is fine. When they are blocked, I would like to display alternate content. The problem is that when the ads are blocked, there are two things that can happen:
1) The ad is complete suppressed by AdBlock, the height and width of the AdSense ad are 0, and most of the AdSense code is not generated.
2) The AdSense ad content is blocked, but the height and width are set and the AdSense code is generated.
Option 1 is perfect because it allows me to check the height of the container, or for tags that AdSense renders, and show my alternate content if the height is 0, or if a specific AdSense tag doesn't exist. However, when option 2 occurs, I don't know what I can do to display my alternate content, and the AdSense ads take up their required height and width, but don't display any content, making my site look broken.
Has anyone else had any experience with this issue? My site is in .net 4.0 and I've only tested AdBlock in Chrome v12 so far.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
听起来您已经涵盖了选项 1(如果高度为 0,则在您自己的广告中使用 ajax)。
对于选项2,这不是添加空白区域或隐藏区域吗?
所以也许这样的事情会起作用:
Sounds like you have option 1 covered (if height is 0, ajax in your own ads).
For option 2, isn't that add area blank or hidden?
So maybe something like this would work:
设置最小高度/宽度,并将框的背景设置为图像/替代内容(我认为这将是一条消息,表示请将我们列入白名单)
将图像设置为不重复,并将背景颜色设置为与图像的背景相匹配。
无论现在的盒子有多大,您都会在其中收到您的信息。
我希望我说得有道理。
Set a min-height/width and have the background of the box be an image / alt content (I assume it will be a message saying please whitelist us)
Set the image to no-repeat and background color to match the background of the image.
No matter the size of the box now, you'll have your message there.
I hope I made sense.