如何在不损失广告收入的情况下更快地加载 iframe 内包含广告的页面(例如 ad.doubleclick)?
如何更快地加载 iframe 内包含广告的加载页面(例如 ad.doubleclick
)而不损失广告收入?
解决方案建议:
使用 jQuery 在 document.ready
/document.load
上动态插入 iframe 到页面。
示例:
<div>
<iframe style="display:none;" src='...' />
<noscript><iframe src='...' /></noscript>
</div>
<script>
$(document).ready(function(){
$('iframe').css('display','block');
});
</script>
此解决方案的问题:由于用户看到广告的时间减少或将转到其他页面而损失收入。
还存在哪些其他解决方案以及哪种解决方案更好?
仅当您在大型网站上遇到此类问题且其大部分收入来自广告或者您可以展示提供解决方案的大型网站时,请回答。
How do I load load page with ads inside iframes (like ad.doubleclick
) faster without losing income from ads?
Solution suggestion:
Insert dynamically iframe on document.ready
/document.load
with jQuery to the page.
Example:
<div>
<iframe style="display:none;" src='...' />
<noscript><iframe src='...' /></noscript>
</div>
<script>
$(document).ready(function(){
$('iframe').css('display','block');
});
</script>
The problem of thissolution: lose income because user will see ad less time or will go to other page.
Which other solutions exists and which solution better?
Please answer only if you have such problem in big website that a lot of his income coming from ads or you can show big websites that making your solution.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您应该在
body
之后创建iframe
作为静态元素。文档准备好后,您可以将其移动到带有 css 的容器或位置中。您可以静态设置其 src(这将是最快的),也可以在文档准备好之前使用 jQuery 设置,因此iframe
的内容将在页面其余部分加载时异步加载。编辑:为了避免误解,我会重复一遍:使用 jQuery 设置 src 会更慢,并且只有在使用 ajax 动态加载 url 时才应该这样做。由于 Yosef 没有指定这些 url 的来源,我想当然地认为它们是从外部源加载的,这就是他首先使用 jQuery 添加 iframe 的原因。
You should create the
iframe
right afterbody
as a static element. You can then move it into a container or position with css once the document is ready. You can either set its src statically (which will be the fastest) or with jQuery before the document is ready, and therefor the content of theiframe
will load asynchronously while the rest of the page loads.Edit: Just so there's no misunderstandings I will repeat myself: setting src with jQuery will be slower, and should only be done if you are loading the urls dynamically with ajax. Since Yosef didn't specify the source of these urls I took it for granted that they were loaded from an external source which was the reason he was using jQuery to add the iframe to begin with.
广告通常基于它们是否被加载和点击,而不是他们查看广告的时间。
所以:
1)这并不是一个真正的问题
2)当从大的角度来看时,你做出的决定是核心设计而不是广告设计。所以问题确实是,我是否支持禁用 javascript 的用户?如果您这样做,那么您的广告还应该支持禁用 JavaScript。
考虑到这一点,我个人会选择在网站之后使用 JavaScript 加载框架,因为广告确实会减慢网站加载时间,这对用户来说非常烦人,并且可能会影响 SEO 排名
Ads are usually based on whether they are loaded, and clicked through rather than how long they have been looking at them.
so:
1) Isn't really a problem
2) When looking on the big scale, you make a decision as core design rather than design of ads. So the question really is, do I support users with javascript disabled? If you do then your ads should also support javascript disabled.
With this in mind, I personally would go for the javascript loading the frame after your website, as adverts do tend to slow website loading times which is highly annoying for the user and probably effects SEO rankings