「TAMedia MobileWeb InRead 廣告使用 AdManager 串接教學」修訂間的差異
跳至導覽
跳至搜尋
imported>Wikiuser |
imported>Wikiuser |
||
行 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> | ||
<nowiki>adLoad2('testSlot12345', '', ' | <nowiki>adLoad2('testSlot12345', '', 'div-tam-ad-testSlot12345', true, 0, tamOnReceiveAd);</nowiki><br> | ||
function tamOnReceiveAd(status){<br> | function tamOnReceiveAd(status){<br> | ||
console.log('%c[TAMedia]%c InRead Callback status : ' + status, 'background:#DDDDDD;color:#FF5511;', 'background:#DDDDDD;color:#000000;');<br> | console.log('%c[TAMedia]%c InRead Callback status : ' + status, 'background:#DDDDDD;color:#FF5511;', 'background:#DDDDDD;color:#000000;');<br> | ||
行 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> | ||
<nowiki>adLoad2('testSlot12345', '', ' | <nowiki>adLoad2('testSlot12345', '', 'div-tam-ad-testSlot12345', true, 0, tamOnReceiveAd);</nowiki><br> | ||
function tamOnReceiveAd(status){<br> | function tamOnReceiveAd(status){<br> | ||
console.log('%c[TAMedia]%c InRead Callback status : ' + status, 'background:#DDDDDD;color:#FF5511;', 'background:#DDDDDD;color:#000000;');<br> | console.log('%c[TAMedia]%c InRead Callback status : ' + status, 'background:#DDDDDD;color:#FF5511;', 'background:#DDDDDD;color:#000000;');<br> | ||
行 45: | 行 44: | ||
</script> | </script> | ||
<font color = Green> | == 使用 Ad Manager 的串接方法 - 方法 2(Only For InRead 300 x 250) == | ||
<font color = Green>選擇 Ad Manager 廣告單元 '''300 x 250''' 進行串接</font><br> | |||
* 放送到 Safeframe:'''請勾選'''<br> | * 放送到 Safeframe:'''請勾選'''<br> | ||
* 請自行先將請求廣告(adLoad2)之參數自行修改再使用<br> | * 請自行先將請求廣告(adLoad2)之參數自行修改再使用<br> | ||
行 51: | 行 51: | ||
<script type="text/javascript" src="https://adc.tamedia.com.tw/rmadp/static/js/messenger.js"></script><br> | <script type="text/javascript" src="https://adc.tamedia.com.tw/rmadp/static/js/messenger.js"></script><br> | ||
<script type="text/javascript" src="https://adc.tamedia.com.tw/rmadp/static/js/gm-sdk6-mobile.js"></script><br> | <script type="text/javascript" src="https://adc.tamedia.com.tw/rmadp/static/js/gm-sdk6-mobile.js"></script><br> | ||
<nowiki><div id=" | <nowiki><div id="div-tam-ad-testSlot12345"></div></nowiki><br> | ||
<script type="text/javascript" language="javascript"><br> | <script type="text/javascript" language="javascript"><br> | ||
<nowiki>adLoad2('testSlot12345', '', ' | <nowiki>adLoad2('testSlot12345', '', 'div-tam-ad-testSlot12345', true, 0, tamOnReceiveAd);</nowiki><br> | ||
function tamOnReceiveAd(status){<br> | function tamOnReceiveAd(status){<br> | ||
console.log('%c[TAMedia]%c InRead Callback status : ' + status, 'background:#DDDDDD;color:#FF5511;', 'background:#DDDDDD;color:#000000;');<br> | console.log('%c[TAMedia]%c InRead Callback status : ' + status, 'background:#DDDDDD;color:#FF5511;', 'background:#DDDDDD;color:#000000;');<br> | ||
行 63: | 行 63: | ||
<script type="text/javascript" src="https://adc.tamedia.com.tw/rmadp/static/js/gm-sdk6-mobile.js"></script><br> | <script type="text/javascript" src="https://adc.tamedia.com.tw/rmadp/static/js/gm-sdk6-mobile.js"></script><br> | ||
<script src='https://www.googletagservices.com/tag/js/gpt.js'></script><br> | <script src='https://www.googletagservices.com/tag/js/gpt.js'></script><br> | ||
<nowiki><div id=" | <nowiki><div id="div-tam-ad-testSlot12345"></div></nowiki><br> | ||
<script type="text/javascript" language="javascript"><br> | <script type="text/javascript" language="javascript"><br> | ||
<nowiki>adLoad2('testSlot12345', '', ' | <nowiki>adLoad2('testSlot12345', '', 'div-tam-ad-testSlot12345', true, 0, tamOnReceiveAd);</nowiki><br> | ||
function tamOnReceiveAd(status){<br> | function tamOnReceiveAd(status){<br> | ||
console.log('%c[TAMedia]%c InRead Callback status : ' + status, 'background:#DDDDDD;color:#FF5511;', 'background:#DDDDDD;color:#000000;');<br> | console.log('%c[TAMedia]%c InRead Callback status : ' + status, 'background:#DDDDDD;color:#FF5511;', 'background:#DDDDDD;color:#000000;');<br> | ||
行 73: | 行 73: | ||
}<br> | }<br> | ||
</script> | </script> | ||
== TAMedia Callback Function 參數 == | |||
{| class="wikitable" | |||
| Callback Function 參數 | |||
| 說明 | |||
|- | |||
| 00 | |||
| 請求廣告成功 | |||
|- | |||
| 20 | |||
| 請求廣告成功,但無廣告 | |||
|} |
於 2019年3月4日 (一) 08:20 的修訂
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/messenger.js"></script>
<script type="text/javascript" src="https://adc.tamedia.com.tw/rmadp/static/js/gm-sdk6-mobile.js"></script>
<div id="div-tam-ad-testSlot12345"></div>
<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
- Passback 資訊請自行修改
<script type="text/javascript" src="https://adc.tamedia.com.tw/rmadp/static/js/messenger.js"></script>
<script type="text/javascript" src="https://adc.tamedia.com.tw/rmadp/static/js/gm-sdk6-mobile.js"></script>
<script src='https://www.googletagservices.com/tag/js/gpt.js'></script>
<div id="div-tam-ad-testSlot12345"></div>
<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){
googletag.pubads().definePassback('/12345678/intOTHER_12345678', [320, 480]).display();
}
}
</script>
TAMedia Callback Function 參數
Callback Function 參數 | 說明 |
00 | 請求廣告成功 |
20 | 請求廣告成功,但無廣告 |