我正在尝试为自己的WordPress网站制作自适应广告系列广告,但它并不起作用。我一直在使用这篇文章:
http://exisweb.net/how-to-use-google-adsense-on-a-responsive-website#comment-220787 (解决方案3)
和 https://support.google.com/dfp_premium/answer/3423562?hl=en#
标题部分的代码是:
<script type='text/javascript'>
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
(function() {
var gads = document.createElement('script');
gads.async = true;
gads.type = 'text/javascript';
var useSSL = 'https:' == document.location.protocol;
gads.src = (useSSL ? 'https:' : 'http:') +
'//www.googletagservices.com/tag/js/gpt.js';
var node = document.getElementsByTagName('script')[0];
node.parentNode.insertBefore(gads, node);
})();
</script>
<script type='text/javascript'>
googletag.cmd.push(function() {
var mapping1 = googletag.sizeMapping().
addSize([480, 200], [468, 60]).
addSize([768, 200], [728, 90]).
build();
googletag.defineSlot('/4049405/728x90_1_archive_hrreview', [728, 90], 'div-gpt-ad-1420018633340-0').addService(googletag.pubads());
googletag.defineSlot('/4049405/728x90_1_home_hrreview', [728, 90], 'div-gpt-ad-1420018633340-1').defineSizeMapping(mapping1).addService(googletag.pubads());
googletag.defineSlot('/4049405/728x90_2_home_hrreview', [728, 90], 'div-gpt-ad-1420018633340-2').defineSizeMapping(mapping1).addService(googletag.pubads());
googletag.defineSlot('/4049405/728x90_3_home_hrreview', [728, 90], 'div-gpt-ad-1420018633340-3').defineSizeMapping(mapping1).addService(googletag.pubads());
googletag.defineSlot('/4049405/728x90_div-analysis_hrreview', [728, 90], 'div-gpt-ad-1420018633340-4').addService(googletag.pubads());
googletag.defineSlot('/4049405/728x90_div-blogs_hrreview', [728, 90], 'div-gpt-ad-1420018633340-5').addService(googletag.pubads());
googletag.defineSlot('/4049405/728x90_div-news_hrreview', [728, 90], 'div-gpt-ad-1420018633340-6').addService(googletag.pubads());
以上没有任何改变。我正在尝试更改左侧主要内容中的广告。应该有2种尺寸:728px x 90px和468px x 60px。目前只展示较大的广告。因此,当您缩小网站的大小时,广告会突出显示在正确的列中。当网站非常小时,广告会在整个网站上展开。
我有什么遗漏的吗?
答案 0 :(得分:0)