[英]Dynamically inserting Adsense unit
我正在嘗試動態插入Adsense單元,但我沒有得到任何點擊。
廣告看起來很好,因為我改為動態插入廣告單元(這會減慢我的HTML5畫布速度)我再也沒有獲得任何點擊了。
這是我用過的代碼:
function appendAd(holder, client, slot, width, height) {
window.google_ad_client = client;
window.google_ad_slot = slot;
window.google_ad_width = width;
window.google_ad_height = height;
var container = document.getElementById(holder);
var w = document.write;
document.write = function (content) {
container.innerHTML = content;
document.write = w;
};
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = 'http://pagead2.googlesyndication.com/pagead/show_ads.js';
document.body.appendChild(script);
}
我已經聯系了Adsense支持,他們說這是不允許的。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.