「TAMedia MobileWeb InRead 廣告使用 AdManager 串接教學」修訂間的差異
跳至導覽
跳至搜尋
imported>Wikiuser |
imported>Wikiuser |
||
(未顯示同一使用者於中間所作的 10 次修訂) | |||
行 2: | 行 2: | ||
{| class="wikitable" | {| class="wikitable" | ||
| TAMedia 廣告類型 | | TAMedia 廣告類型 | ||
| AD Manager 對應的廣告大小 | | AD Manager 對應的廣告大小 | ||
|- | |- | ||
| InRead 300 x 250 | | InRead 300 x 250 | ||
| 1 x | | 1 x 1 or 300 x 250 | ||
|- | |- | ||
| InRead 1200 x 627 | | InRead 1200 x 627 | ||
行 18: | 行 18: | ||
|} | |} | ||
== 使用 Ad Manager 的串接方法 == | == 使用 Ad Manager 的串接方法 - 方法 1<font color = Purple>(建議使用)</font> == | ||
<font color = Green>選擇 Ad Manager 廣告單元 '''1 x 1''' 進行串接</font><br> | |||
<font color = Green> | |||
* 放送到 Safeframe:<font color = Scarlet>'''請勿勾選'''</font><br> | * 放送到 Safeframe:<font color = Scarlet>'''請勿勾選'''</font><br> | ||
* 請自行先將請求廣告(adLoad2)之參數自行修改再使用<br> | * 請自行先將請求廣告(adLoad2)之參數自行修改再使用<br> | ||
行 26: | 行 25: | ||
<script type="text/javascript" src="https://adc.tamedia.com.tw/rmadp/static/js/tam-dfp-mediation.js"></script><br> | <script type="text/javascript" src="https://adc.tamedia.com.tw/rmadp/static/js/tam-dfp-mediation.js"></script><br> | ||
<script type="text/javascript" language="javascript"><br> | <script type="text/javascript" language="javascript"><br> | ||
adLoad2('testSlot12345', ' | <nowiki>adLoad2('testSlot12345', '', 'div-tam-ad-testSlot12345', true, 0, tamOnReceiveAd);</nowiki><br> | ||
function | function tamOnReceiveAd(status){<br> | ||
console.log('%c[TAMedia]%c | console.log('%c[TAMedia]%c InRead Callback status : ' + status, 'background:#DDDDDD;color:#FF5511;', 'background:#DDDDDD;color:#000000;');<br> | ||
}<br> | }<br> | ||
</script> | </script> | ||
行 36: | 行 35: | ||
<script type="text/javascript" src="https://adc.tamedia.com.tw/rmadp/static/js/tam-dfp-mediation.js"></script><br> | <script type="text/javascript" src="https://adc.tamedia.com.tw/rmadp/static/js/tam-dfp-mediation.js"></script><br> | ||
<script type="text/javascript" language="javascript"><br> | <script type="text/javascript" language="javascript"><br> | ||
adLoad2('testSlot12345', ' | <nowiki>adLoad2('testSlot12345', '', 'div-tam-ad-testSlot12345', true, 0, tamOnReceiveAd);</nowiki><br> | ||
function | function tamOnReceiveAd(status){<br> | ||
console.log('%c[TAMedia]%c | console.log('%c[TAMedia]%c InRead Callback status : ' + status, 'background:#DDDDDD;color:#FF5511;', 'background:#DDDDDD;color:#000000;');<br> | ||
if('00' != status){<br> | if('00' != status){<br> | ||
dfpPassback('/12345678/intOTHER_12345678', 'div-gpt-ad-1234567890-0', [ | dfpPassback('/12345678/intOTHER_12345678', 'div-gpt-ad-1234567890-0', [1, 1]);<br> | ||
}<br> | }<br> | ||
}<br> | }<br> | ||
</script> | </script> | ||
== 使用 Ad Manager 的串接方法 - 方法 2(Only For InRead 300 x 250) == | |||
<font color = Green>選擇 Ad Manager 廣告單元 '''300 x 250''' 進行串接</font><br> | |||
* 放送到 Safeframe:'''請勾選'''<br> | |||
* 請自行先將請求廣告(adLoad2)之參數自行修改再使用<br> | |||
* 直接貼到 Ad Manager "第三方"串接範例:<br> | |||
<script type="text/javascript" src="https://adc.tamedia.com.tw/rmadp/static/js/gm-sdk7-mobile.js"></script><br> | |||
<nowiki><div id="div-tam-ad-testSlot12345"></div></nowiki><br> | |||
<script type="text/javascript" language="javascript"><br> | |||
function adManagerCurl(){<br> | |||
return "%%PATTERN:url%%";<br> | |||
}<br> | |||
<nowiki>adLoad2('testSlot12345', '', 'div-tam-ad-testSlot12345', true, 0, tamOnReceiveAd);</nowiki><br> | |||
function tamOnReceiveAd(status){<br> | |||
console.log('%c[TAMedia]%c InRead Callback status : ' + status, 'background:#DDDDDD;color:#FF5511;', 'background:#DDDDDD;color:#000000;');<br> | |||
}<br> | |||
</script> | |||
<font color = Blue>'''使用 Passback'''</font><br> | |||
* Passback 資訊請自行修改<br> | |||
<script type="text/javascript" src="https://adc.tamedia.com.tw/rmadp/static/js/gm-sdk7-mobile.js"></script><br> | |||
<script async src="https://securepubads.g.doubleclick.net/tag/js/gpt.js"></script><br> | |||
<nowiki><div id="div-tam-ad-testSlot12345"></div></nowiki><br> | |||
<nowiki><div id="gpt-passback"></nowiki><br> | |||
<script type="text/javascript" language="javascript"><br> | |||
function adManagerCurl(){<br> | |||
return "%%PATTERN:url%%";<br> | |||
}<br> | |||
<nowiki>adLoad2('testSlot12345', '', 'div-tam-ad-testSlot12345', true, 0, tamOnReceiveAd);</nowiki><br> | |||
function tamOnReceiveAd(status){<br> | |||
console.log('%c[TAMedia]%c InRead Callback status : ' + status, 'background:#DDDDDD;color:#FF5511;', 'background:#DDDDDD;color:#000000;');<br> | |||
<nowiki>if('00' != status){</nowiki><br> | |||
<nowiki>console.log('[TAMedia] Call To Passback.'); | |||
gamPassback();</nowiki><br> | |||
<nowiki>}</nowiki><br> | |||
<nowiki>}</nowiki><br> | |||
<nowiki>function gamPassback(){ | |||
window.googletag = window.googletag || {cmd: []}; | |||
googletag.cmd.push(function() { | |||
googletag.defineSlot('/12345678/OTHER_12345678', [300, 250], 'gpt-passback').addService(googletag.pubads()); | |||
googletag.pubads().set('page_url', '%%PATTERN:url%%'); | |||
googletag.enableServices(); | |||
googletag.display('gpt-passback'); | |||
});</nowiki><br> | |||
}<br> | |||
</script><br> | |||
<nowiki></div></nowiki> | |||
== TAMedia Callback Function 參數 == | |||
{| class="wikitable" | |||
| Callback Function 參數 | |||
| 說明 | |||
|- | |||
| 00 | |||
| 請求廣告成功 | |||
|- | |||
| 20 | |||
| 請求廣告成功,但無廣告 | |||
|} |
於 2020年3月11日 (三) 02:21 的最新修訂
TAMedia 廣告 與 Ad Manager 廣告大小對應表
TAMedia 廣告類型 | AD Manager 對應的廣告大小 |
InRead 300 x 250 | 1 x 1 or 300 x 250 |
InRead 1200 x 627 | 1 x 1 |
InRead Interscroller | 1 x 1 |
InRead Anchor | 1 x 1 |
使用 Ad Manager 的串接方法 - 方法 1(建議使用)
選擇 Ad Manager 廣告單元 1 x 1 進行串接
- 放送到 Safeframe:請勿勾選
- 請自行先將請求廣告(adLoad2)之參數自行修改再使用
- 直接貼到 Ad Manager "第三方"串接範例:
<script type="text/javascript" src="https://adc.tamedia.com.tw/rmadp/static/js/tam-dfp-mediation.js"></script>
<script type="text/javascript" language="javascript">
adLoad2('testSlot12345', '', 'div-tam-ad-testSlot12345', true, 0, tamOnReceiveAd);
function tamOnReceiveAd(status){
console.log('%c[TAMedia]%c InRead Callback status : ' + status, 'background:#DDDDDD;color:#FF5511;', 'background:#DDDDDD;color:#000000;');
}
</script>
使用 Passback
- 請從 Ad Manager 以一般產出代碼方式取得必要資訊帶入 dfpPassback 函式(依序為 "廣告單元ID", "Div Tag ID", "Size Array")
<script type="text/javascript" src="https://adc.tamedia.com.tw/rmadp/static/js/tam-dfp-mediation.js"></script>
<script type="text/javascript" language="javascript">
adLoad2('testSlot12345', '', 'div-tam-ad-testSlot12345', true, 0, tamOnReceiveAd);
function tamOnReceiveAd(status){
console.log('%c[TAMedia]%c InRead Callback status : ' + status, 'background:#DDDDDD;color:#FF5511;', 'background:#DDDDDD;color:#000000;');
if('00' != status){
dfpPassback('/12345678/intOTHER_12345678', 'div-gpt-ad-1234567890-0', [1, 1]);
}
}
</script>
使用 Ad Manager 的串接方法 - 方法 2(Only For InRead 300 x 250)
選擇 Ad Manager 廣告單元 300 x 250 進行串接
- 放送到 Safeframe:請勾選
- 請自行先將請求廣告(adLoad2)之參數自行修改再使用
- 直接貼到 Ad Manager "第三方"串接範例:
<script type="text/javascript" src="https://adc.tamedia.com.tw/rmadp/static/js/gm-sdk7-mobile.js"></script>
<div id="div-tam-ad-testSlot12345"></div>
<script type="text/javascript" language="javascript">
function adManagerCurl(){
return "%%PATTERN:url%%";
}
adLoad2('testSlot12345', '', 'div-tam-ad-testSlot12345', true, 0, tamOnReceiveAd);
function tamOnReceiveAd(status){
console.log('%c[TAMedia]%c InRead Callback status : ' + status, 'background:#DDDDDD;color:#FF5511;', 'background:#DDDDDD;color:#000000;');
}
</script>
使用 Passback
- Passback 資訊請自行修改
<script type="text/javascript" src="https://adc.tamedia.com.tw/rmadp/static/js/gm-sdk7-mobile.js"></script>
<script async src="https://securepubads.g.doubleclick.net/tag/js/gpt.js"></script>
<div id="div-tam-ad-testSlot12345"></div>
<div id="gpt-passback">
<script type="text/javascript" language="javascript">
function adManagerCurl(){
return "%%PATTERN:url%%";
}
adLoad2('testSlot12345', '', 'div-tam-ad-testSlot12345', true, 0, tamOnReceiveAd);
function tamOnReceiveAd(status){
console.log('%c[TAMedia]%c InRead Callback status : ' + status, 'background:#DDDDDD;color:#FF5511;', 'background:#DDDDDD;color:#000000;');
if('00' != status){
console.log('[TAMedia] Call To Passback.'); gamPassback();
}
}
function gamPassback(){ window.googletag = window.googletag || {cmd: []}; googletag.cmd.push(function() { googletag.defineSlot('/12345678/OTHER_12345678', [300, 250], 'gpt-passback').addService(googletag.pubads()); googletag.pubads().set('page_url', '%%PATTERN:url%%'); googletag.enableServices(); googletag.display('gpt-passback'); });
}
</script>
</div>
TAMedia Callback Function 參數
Callback Function 參數 | 說明 |
00 | 請求廣告成功 |
20 | 請求廣告成功,但無廣告 |