是否有人会介意查看我的代码,试图让我的DFP广告响应,因为我的网站都响应?我遵循Google 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>