我们怎样才能阻止OpenX阻止页面加载? [英] How can we keep OpenX from blocking page load?

查看:120
本文介绍了我们怎样才能阻止OpenX阻止页面加载?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用OpenX在多个网站上投放广告。但是,如果OpenX服务器出现问题,它会阻止这些站点上的页面加载。我宁愿让网站优雅地失败,即加载没有广告的网页,并在它们可用时填写。

We're using OpenX to serve ads on a number of sites. If the OpenX server has problems, however, it blocks page loads on these sites. I'd rather have the sites fail gracefully, i.e. load the pages without the ads and fill them in when they become available.

我们正在使用OpenX的单页呼叫,我们在CSS中给div显式大小,这样他们就可以了可以在没有内容的情况下布局,但仍然加载脚本块页面加载。是否还有其他使用OpenX加速页面的最佳实践?

We're using OpenX's single page call, and we're giving divs explicit size in CSS so they can be laid out without their contents, but still loading the script blocks page load. Are there other best practices for speeding up pages with OpenX?

推荐答案

OpenX有一些关于如何异步加载标记的文档:
http://docs.openx.com/ad_server/adtagguide_synchjs_implementing_async.html

OpenX has some documentation on how to make their tags load asynchronously: http://docs.openx.com/ad_server/adtagguide_synchjs_implementing_async.html

我测试了它,它在当前的Chrome / Firefox中运行良好。

I've tested it, and it works well in current Chrome/Firefox.

需要一些手册调整他们的广告代码。他们应该如何结束广告代码的示例:

It takes some manual tweaking of their ad code. Their example of how the ad tags should end up:

<html>
<head></head>

<body>

Some content here.

Ad goes here.

<!-- Preserve space while the rest of the page loads. -->

<div id="placeholderId" style="width:728px;height:90px">

<!-- Fallback mechanism to use if unable to load the script tag. -->

<noscript>
<iframe id="4cb4e94bd5bb6" name="4cb4e94bd5bb6"
 src="http://d.example.com/w/1.0/afr?auid=8&target=
_blank&cb=INSERT_RANDOM_NUMBER_HERE"
 frameborder="0" scrolling="no" width="728"
 height="90">
<a href="http://d.example.com/w/1.0/rc?cs=
4cb4e94bd5bb6&cb=INSERT_RANDOM_NUMBER_HERE"
 target="_blank">
<img src="http://d.example.com/w/1.0/ai?auid=8&cs=
4cb4e94bd5bb6&cb=INSERT_RANDOM_NUMBER_HERE"
 border="0" alt=""></a></iframe>
</noscript>
</div>

<!--Async ad request with multiple parameters.-->

<script type="text/javascript">
    var OX_ads = OX_ads || [];
    OX_ads.push({
       "slot_id":"placeholderId",
       "auid":"8",
       "tid":"4",
       "tg":"_blank",
       "r":"http://redirect.clicks.to.here/landing.html",
       "rd":"120",
       "rm":"2",
       "imp_beacon":"HTML for client-side impression beacon",
       "fallback":"HTML for client-side fallback"
    });
</script>

<!-- Fetch the Tag Library -->

<script type="text/javascript" src="http://d.example.com/w/1.0/jstag"></script>

Some other content here.

</body>
</html>

这篇关于我们怎样才能阻止OpenX阻止页面加载?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆