是否有人會介意查看我的代碼,試圖讓我的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>