谁介意看一下我的代码,试着让我的DFP广告响应,因为我的网站都是响应式的?我遵循了Google DFP上的例子,当我尝试移动屏幕时,广告似乎并没有缩小(并且根本没有显示在真正的移动屏幕上),下面的代码在我的头文件中。
我很确定我的地图是正确的。我想知道我是否也必须对我的身体代码进行任何更改,或者我是否必须上传新的创意,它具有调整后的大小以适应移动屏幕?
<script async='async' src='https://www.googletagservices.com/tag/js/gpt.js'></script>
<script>
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
</script>
<script>
googletag.cmd.push(function() {
var mapping = googletag.sizeMapping().
addSize([992, 0], [[970, 90], [728, 90], [300, 250], [1, 1]]). //desktop
addSize([768, 0], [[300, 250], [728, 90], [1, 1]]). //tablet
addSize([320, 0], [[320, 50], [320, 100], [300, 250], [1, 1]]). //mobile
addSize([0, 0], [[320, 50], [1, 1]]). //other
build();
slot1 = googletag.defineSlot('/316721235/DL-TestAds', [728, 90], 'div-gpt-ad-1496860907063-0').defineSizeMapping(mapping).addService(googletag.pubads());
googletag.pubads().enableAsyncRendering();
googletag.enableServices();
});
</script>https://stackoverflow.com/questions/44527249
复制相似问题