「TAMedia MobileWeb InRead 廣告使用 AdManager 串接教學」修訂間的差異
跳至導覽
跳至搜尋
imported>Wikiuser |
imported>Wikiuser |
||
行 52: | 行 52: | ||
<nowiki><div id="div-tam-ad-testSlot12345"></div></nowiki><br> | <nowiki><div id="div-tam-ad-testSlot12345"></div></nowiki><br> | ||
<script type="text/javascript" language="javascript"><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> | <nowiki>adLoad2('testSlot12345', '', 'div-tam-ad-testSlot12345', true, 0, tamOnReceiveAd);</nowiki><br> | ||
function tamOnReceiveAd(status){<br> | function tamOnReceiveAd(status){<br> | ||
行 66: | 行 69: | ||
<nowiki><div id="gpt-passback"></nowiki><br> | <nowiki><div id="gpt-passback"></nowiki><br> | ||
<script type="text/javascript" language="javascript"><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> | <nowiki>adLoad2('testSlot12345', '', 'div-tam-ad-testSlot12345', true, 0, tamOnReceiveAd);</nowiki><br> | ||
function tamOnReceiveAd(status){<br> | function tamOnReceiveAd(status){<br> |
於 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 | 請求廣告成功,但無廣告 |