InsertGoogleAdsense adsSource codeDirectly embed the topic template page. In factGoogleAdsense supports and allows the use of JSFileCall. Of course, the premise is not to modify it for any reason.Code, Or manually affects the positioning of the advertisement. This will be caused by a violation of the Plan PolicyGoogleClick your account.
The following uses the 468x60 classic AD Size code as an example to describe JSFileThe method to call.
The code for getting an advertisement unit is as follows:
<SCRIPT type = "text/JavaScript"> <! -- Google_ad_client = "publisher ID";/* 468x60, created in XX-xx */google_ad_slot = "xxxxxxxxxx"; google_ad_width = 468; google_ad_height = 60; // --> </SCRIPT> <SCRIPT type = "text/JavaScript" src = "http://pagead2.googlesyndication.com/pagead/show_ads.js"> </SCRIPT>
After getting this code, you need to convert it to the JS form:
Document. writeln ("<SCRIPT type = \" text \/JavaScript \ "> <! -- "); Document. writeln ("google_ad_client = \" publisher ID \ ";"); document. writeln ("\/* 468x60, created in XX-xx * \/"); document. writeln ("google_ad_slot = \" xxxxxxxxxx \ ";"); document. writeln ("google_ad_width = 468;"); document. writeln ("google_ad_height = 60;"); document. writeln ("\/-->"); document. writeln ("<\/SCRIPT>"); document. writeln ("<SCRIPT type = \" text \/JavaScript \ ""); document. writeln ("src = \" http: \// pagead2.googlesyndication.com \/pagead \/show_ads.js \ ">"); document. writeln ("<\/SCRIPT> ")
In view of the trouble to manually change, it is recommended to use online HTML to JS tools, such as: http://www.book560.com/Other/jstohtm.htm
Save the converted code as JSFileThe call method is as follows:
<Script language = "JavaScript" src = "ggad_468x60.js" type = "text/JavaScript"> </SCRIPT>