动态插入 Adsense 单元
Dynamically inserting Adsense unit
我正在尝试动态插入 Adsense 单元,但没有获得任何点击。
广告显示正常,因为我更改为动态插入广告单元(它减慢了我的 HTML5 canvas)我不再获得任何点击。
这是我用过的代码:
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 支持,他们说不允许。
我正在尝试动态插入 Adsense 单元,但没有获得任何点击。
广告显示正常,因为我更改为动态插入广告单元(它减慢了我的 HTML5 canvas)我不再获得任何点击。
这是我用过的代码:
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 支持,他们说不允许。