Baidu advertising alliance code optimization

Source: Internet
Author: User

As a small website, placing various advertisements on the page is a matter of course. We use the Baidu alliance. Previously, it was Google's Adsense. Google is in the palace of tianchao, and since the Chinese people, it seems that Baidu is the only choice.

Then, as a small website, it is natural to place 10 8 advertisements on the page. This means that there will be 10 8 <scripts> for each page, plus other script links, CSS links, and images. Wow, open your page and there are a lot of requests. It's like marrying a wife and having a couple of children with her ex-husband, as well as three aunts in the family. It's disgusting. This is the secret of our website.

In the October revolution, Baidu prepared an optimized statement for us, that is, no matter how many Baidu AD Alliance code you put on the page, it can be included in a request. The Code is as follows:

<script>BAIDU_CLB_preloadSlots("213888", "216888", "214888", "214888", "317888","216888", "216888", "216888", "267888");</script>

The number is the ID of the advertisement.

The format is as follows:

[HTML]
View plaincopyprint?
  1. <Head> <title> beauty in bed </title>
  2. <Script
    Type = 'text/JavaScript'
    Src = 'HTTP: // cbjs.baidu.com/js/m.js'> </SCRIPT>
  3. <PRE
    Id = "line16"> <Span
    Class = "start-tag"> script </span> baidu_clb_preloadslots ("213888 ",
    "216888", "214888", "214888", "317888", "216888", "216888", "216888", "267888"); </<Span
    Class = "End-tag"> script </span>
  4. <Link
    Href = "/CSS/default.css? Ver = 120308"
    Rel = "stylesheet"
    Type = "text/CSS">
  5. </Head> </PRE>
<Head> <title> beauty in bed </title> <SCRIPT type = 'text/JavaScript 'src = 'HTTP: // cbjs.baidu.com/js/m.js'> </SCRIPT>
<script>BAIDU_CLB_preloadSlots("213888", "216888", "214888", "214888", "317888","216888", "216888", "216888", "267888");</script><link href="/css/default.css?ver=120308" rel="stylesheet" type="text/css">

[HTML]
View plaincopyprint?
  1. <Body>
  2. <Div>
  3. <Table
    Id = "ms_tbad"
    Style = "border: none;"> <tr>
  4. <TD> <script
    Type = "text/JavaScript"> baidu_clb_fillslot ("216888"); </SCRIPT> </TD>
  5. <TD> <script
    Type = "text/JavaScript"> baidu_clb_fillslot ("216888"); </SCRIPT> </TD>
  6. <TD> <script
    Type = "text/JavaScript"> baidu_clb_fillslot ("216988"); </SCRIPT> </TD>
  7. </Tr>
  8. </Table>
  9. </Div>
  10. </Body>
<body><div>    <table id="ms_tbAd" style="border:none;"><tr>        <td><script type="text/javascript">BAIDU_CLB_fillSlot("216888");</script></td>        <td><script type="text/javascript">BAIDU_CLB_fillSlot("216888");</script></td>        <td><script type="text/javascript">BAIDU_CLB_fillSlot("216988");</script></td>        </tr>    </table></div></body>

Of course, if there is only one baidu_clb_fillslot, it is not necessary to write this one request statement.

From: http://blog.csdn.net/leftfist/article/details/7335127

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.