Use JS file import way to put GG ads

Source: Internet
Author: User

Yesterday's own station to put GG AD, but the site is all static page, but I want to casually update the GG ad so think of using JS file Import method, also can use. php file Import Way, the following is about my method:

First of all, directly in the source code put GG ad a lot of people put this:

<script type= "Text/javascript" ><!--
Google_ad_client = "pub-6219414158063594";
/* 468x15, founded in 08-3-10 * *
Google_ad_slot = "2571270205";
Google_ad_width = 368;
Google_ad_height = 20;
-->
</script>
<script type= "Text/javascript"
src= "Http://pagead2.googlesyndication.com/pagead/show_ads.js" >
</script>

This has a very big inconvenience is that I replace inconvenient, the following we take a look at JS. File Import form.

I put <script src= '/gg_ad/gg.js ' in the source code of the Web page ></script>

In the gg.js file to put the above code, but because it is a JS file so we have to go to the unnecessary symbols, the code is as follows:

Google_ad_client = "pub-6219414158063594";
Google_ad_slot = "7794600866";
Google_ad_width = 234;
Google_ad_height = 60;
Google_cpa_choice = "";

document.write (' <script type= "Text/javascript" src= "Http://pagead2.googlesyndication.com/pagead/show_ads.js" ></script> ');

There is also a JS into the guide PHP file, see example:

<script src= ' js.php ' is written in js.php,

document.write (' google_ad_client = ' pub-6219414158063594 '; '); There are no more words here than others.

Note: Original www.111cn.net, reprint please indicate the place.

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.