Featured Post
- Get link
- Other Apps
Labels
Posted by
Fang
DFP廣告代碼可以做蓋版效果嗎?
就像貓可以蓋在你的筆記本上,GPT也可以蓋在你的網頁上。
蓋版廣告老美叫interstitial (英文意思 = "有間隙/不相連"),所以Google Publisher Tag(GPT)的function type是Out of Page(英文意思 = "頁面外")
Out of Page說明,來自GPT Reference Library (請參考我關於GPT邏輯說明)
https://developers.google.com/doubleclick-gpt/reference#googletag.defineOutOfPageSlot
1. 把廣告代碼的head部位,adSlot的代碼改成googletag.Slot。
格式:
googletag.defineOutOfPageSlot(adUnitPath, opt_div)
飯粒:
<head>
<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() {
googletag.defineOutOfPageSlot('/00000000/AdUnitName', "div-gpt-ad-00000000000"). addService(googletag.pubads()); googletag.pubads().enableSyncRendering(); googletag.enableServices(); }); </script>
</head>
<body>
<div id="div-gpt-ad-00000000000"> <script type="text/javascript"> googletag.cmd.push(function() { googletag.display('div-gpt-ad-00000000000'); }); </script> </div>
</body>
2. 眼尖的媒體朋友會發現,head部位一般使用的:
googletag.pubads().enableSingleRequest();
(非同步呼叫)
變成:
googletag.pubads().enableSyncRendering();
(同步呼叫)
因為Out of Page必須隨著HTML元件的loading,才能確保出現位置。
國外網站討論Sync的原因
https://productforums.google.com/forum/#!topic/dfp/2thf95vNgC8;context-place=topicsearchin/dfp/GPT$20interstitial$20ads
也有人嘗試用SingeRequest(Async)成功的,可試試但不推薦
https://productforums.google.com/forum/#!topic/dfp/LMHySPpi-bs;context-place=topicsearchin/dfp/GPT$20interstitial$20ads
3. 委刊項尺寸記得設定Out of Page
4. 素材不要設SafeFrame,容易投不進單元:
Popular Posts
Posted by
Fang
in-read影音廣告跟pre-roll出現的位置有不一樣嗎?與outstream video又有什麼不同?
- Get link
- Other Apps
Comments
Post a Comment