在第三方多媒體廣告代碼中新增巨集

Display & Video 360 與眾多第三方廣告伺服器相容。因此,您可使用許多點擊追蹤及 CacheBuster 巨集,讓第三方能夠追蹤透過 Display & Video 360 放送的多媒體廣告素材點擊。

當您在 Display & Video 360 中新增可識別的第三方多媒體廣告代碼時,系統會自動插入點擊追蹤及 CacheBuster 巨集。如果是系統無法識別的代碼,您就必須自行插入這些巨集。每種第三方多媒體廣告代碼的樣式都有些微差異,但您可使用下方範例做為參考。

何謂巨集?

巨集是一個預留位置 (例如:${CLICK_URL}),廣告伺服器會在放送廣告素材時將這個預留位置取代為實際的值。如果您想讓 Display & Video 360 在代碼中即時插入特定資訊,建議您在代碼中使用巨集。

舉例來說,假設您使用的是以下第三方廣告代碼:
<script type="text/javascript" src="http://example.com?click="></script>

第三方廣告伺服器會預期在「click=」後方取得 Display & Video 360 點擊追蹤網址。如要取得這個網址,請在代碼中插入點擊追蹤巨集:
<script type="text/javascript" src="http://example.com?click=${CLICK_URL}"></script>

這樣一來,廣告每次放送時,預留位置 ${CLICK_URL} 都會被替換成 Display & Video 360 所提供的實際點擊追蹤網址。

點擊追蹤及 CacheBuster 巨集

點擊追蹤巨集是最常用的巨集類型。第三方廣告伺服器可利用這類巨集追蹤點擊,並將它與 Display & Video 360 中正確的廣告素材、委刊項和競價建立關聯。使用者點擊廣告素材時,系統會先將使用者導向至 Display & Video 360 廣告伺服器 (以便記錄點擊和相關競價資訊),再重新導向至廣告客戶的網址。

代碼和巨集範例

Celtra 代碼

加入 Click 巨集之前:

<script src="mraid.js"></script>
<div class="celtra-ad-v3">
  <img src="data:image/png,celtra" style="display: none" onerror="
  (function(img) {
    var params = {'clickUrl':'http://www.celtra.com/','preferredClickThroughWindow':'new','clickEvent':'advertiser','externalAdServer':'Custom'};
    var req = document.createElement('script');
    req.id = params.scriptId = 'celtra-script-' + (window.celtraScriptIndex = (window.celtraScriptIndex||0)+1);
    params.clientTimestamp = new Date/1000;
    var src = (window.location.protocol == 'https:' ? 'https' : 'http') + '://ads.celtra.com/65fb825c/mraid-ad.js?';
    for (var k in params) {
      src += '&amp;' + encodeURIComponent(k) + '=' + encodeURIComponent(params[k]);
    }
    req.src = src;
    img.parentNode.insertBefore(req, img.nextSibling);
  })(this);
"/></div>


加入 Click 巨集之後:

<script src="mraid.js"></script>
<div class="celtra-ad-v3">
  <img src="data:image/png,celtra" style="display: none" onerror="
  (function(img) {
    var params = {'clickUrl':'${CLICK_URL}','preferredClickThroughWindow':'new','clickEvent':'advertiser','externalAdServer':'Custom'};
    var req = document.createElement('script');
    req.id = params.scriptId = 'celtra-script-' + (window.celtraScriptIndex = (window.celtraScriptIndex||0)+1);
    params.clientTimestamp = new Date/1000;
    var src = (window.location.protocol == 'https:' ? 'https' : 'http') + '://ads.celtra.com/65fb825c/mraid-ad.js?';
    for (var k in params) {
      src += '&amp;' + encodeURIComponent(k) + '=' + encodeURIComponent(params[k]);
    }
    req.src = src;
    img.parentNode.insertBefore(req, img.nextSibling);
  })(this);
"/></div>

Conversant (舊稱 Mediaplex) 代碼

加入 Click 巨集之前:

<script language="JavaScript1.1" src="http://adfarm.mediaplex.com/ad/js/1234-12345-1234-1?mpt=[CACHEBUSTER]&mpvc="></script><noscript>
<a href="http://adfarm.mediaplex.com/ad/ck/1091-86796-2738-5?mpt=[CACHEBUSTER]">
<img src="http://adfarm.mediaplex.com/ad/bn/1234-12345-1234-1?mpt=[CACHEBUSTER]"?alt="請按這裡" border="0"></a></noscript>


加入 Click 巨集之後:

<script language="JavaScript1.1" src="http://adfarm.mediaplex.com/ad/js/1234-12345-1234-1?mpt=${CACHEBUSTER}&mpvc=${CLICK_URL_ENC}"></script><noscript>
<a href="${CLICK_URL}http://adfarm.mediaplex.com/ad/ck/1234-12345-1234-1?mpt=${CACHEBUSTER}">  <img src="http://adfarm.mediaplex.com/ad/bn/1091-86796-2738-5?mpt=${CACHEBUSTER}"alt="請按這裡" border="0"></a></noscript>
Conversant 代碼通常必須使用單編碼的 Click 巨集 ${CLICK_URL_ENC},但有時需要雙重編碼的 Click 巨集 ${CLICK_URL_ENC_ENC}。如果廣告伺服器未指明需要使用哪一種格式,您可在廣告投放程序中透過 Display & Video 360 確認點擊追蹤是否正常運作。

Campaign Manager 360 JavaScript 代碼

加入 Click 巨集之前:

<SCRIPT language='JavaScript1.1' SRC="https://ad.doubleclick.net/ddm/adj/Nxxxx.site-keyname/Byyyyyyy;sz=widthxheight;dc_expa=URL;ord=[timestamp];dc_lat=N;dc_rdid=Czzzz;tag_for_child_directed_treatment=I;kw=[keyword];click=?">


加入 Click 巨集之後:

<SCRIPT language='JavaScript1.1' SRC="https://ad.doubleclick.net/ddm/adj/Nxxxx.site-keyname/Byyyyyyy;sz=widthxheight;dc_expa=URL;ord=${CACHEBUSTER};dc_lat=N;dc_rdid=Czzzz;tag_for_child_directed_treatment=I;kw=[keyword];click=${CLICK_URL}?">

Campaign Manager 360 INS 代碼

使用 Campaign Manager 360 的 INS 代碼時,請加入 data-dcm-click-tracker 參數,並將參數值設為 ${CLICK_URL} 巨集。此外,為了避免報表產生差異,您必須使用指令碼顯示模式,而不要使用 iframe (也就是將 data-dcm-rendering-mode 屬性設為「script」:data-dcm-rendering-mode='script')。

如要進一步瞭解 INS 代碼,請造訪 Campaign Manager 360 說明中心

加入 Click 巨集之前:

<ins class='dcmads'
 style='display:inline-block;width:300px;height:250px'
 data-dcm-placement='N7480.1664088DOUBLECLICK.NETTEST/B8299600.114131924'
 data-dcm-param-custom_key='custom_value'
 data-dcm-rendering-mode='script'>
 <script src='https://www.googletagservices.com/dcm/dcmads.js'></script>
</ins>

加入 Click 巨集之後:

<ins class='dcmads' 
 style='display:inline-block;width:300px;height:250px' 
 data-dcm-placement='N7480.1664088DOUBLECLICK.NETTEST/B8299600.114131924' 
 data-dcm-rendering-mode='script' 
 data-dcm-click-tracker='${CLICK_URL}'> 
 <script src='https://www.googletagservices.com/dcm/dcmads.js'></script> 
</ins>

Campaign Manager 360 iframe/JavaScript 代碼

加入 Click 巨集之前:

<IFRAME SRC="https://ad.doubleclick.net/ddm/adi/Nxxxx.site-keyname/Byyyyyyy;sz=widthxheight;ord=[timestamp];dc_lat=N;dc_rdid=Czzzz;tag_for_child_directed_treatment=I;kw=[keyword];click=?" WIDTH=X HEIGHT=Y MARGINWIDTH=0 MARGINHEIGHT=0 HSPACE=0 VSPACE=0 FRAMEBORDER=0 SCROLLING=no BORDERCOLOR='#000000'> 
<SCRIPT language='JavaScript1.1' SRC="https://ad.doubleclick.net/ddm/adj/Nxxxx.site-keyname/Byyyyyyy;abr=!ie;sz=widthxheight;ord=[timestamp];dc_lat=N;dc_rdid=Czzzz;tag_for_child_directed_treatment=I;kw=[keyword];click=?"> 
</SCRIPT> 
</IFRAME> 

 

加入 Click 巨集之後:

<IFRAME SRC="https://ad.doubleclick.net/ddm/adi/Nxxxx.site-keyname/Byyyyyyy;sz=widthxheight;ord=${CACHEBUSTER};dc_lat=N;dc_rdid=Czzzz;tag_for_child_directed_treatment=I;kw=[keyword];click=${CLICK_URL}" WIDTH=X HEIGHT=Y MARGINWIDTH=0 MARGINHEIGHT=0 HSPACE=0 VSPACE=0 FRAMEBORDER=0 SCROLLING=no BORDERCOLOR='#000000'> 
<SCRIPT language='JavaScript1.1' SRC="https://ad.doubleclick.net/ddm/adj/Nxxxx.site-keyname/Byyyyyyy;abr=!ie;sz=widthxheight;ord=${CACHEBUSTER};dc_lat=N;dc_rdid=Czzzz;tag_for_child_directed_treatment=I;kw=[keyword];click=${CLICK_URL}?"> 
</SCRIPT> 
</IFRAME> 

FlashTalking 和 DoubleVerify 代碼

加入 Click 巨集之前:

<script language="javascript" type="text/javascript">
new function() {
this.rand = Math.floor((Math.random() + "") * 1000000000000);
this.dvparams = 'ctx=12345&cmp=12345&plc=12345&sid=12345';
this.dvregion = '0';
this.tagsrc = '<noscr'+'ipt>\n<a href="http://servedby.flashtalking.com/
click/4/12345;12345;0;12345;0/?url=12345" target="_blank">\n
<img border="0" src="http://servedby.flashtalking.com/imp/4/12345;12345;12345;gif;
FIOS112MDUInviteBT2DallasDMAMPG3160x600FT213to331/?"></a>\n
</noscr'+'ipt>\n<scr'+'ipt language="Javascr'+'ipt1.1" type="text/javascr'+'ipt">
\nvar ftClick = "";\nvar ftX = "";\nvar ftY = "";\nvar ftZ = "";\nvar ftContent = "";
\nvar ftCustom = "";\nvar ft160x600_OOBclickTrack = "";\nvar ftRandom = Math.random()*1000000;
\nvar ftBuildTag1 = "<scr";\nvar ftBuildTag2 = "</";\nvar ftTag = ftBuildTag1 +
'ipt language="javascr'+'ipt1.1" type="text/javascr'+'ipt" ';nftTag +=
'src="http://servedby.flashtalking.com/imp/4/12345;12345;12345;js;

FIOS112MDUInviteBT2DallasDMAMPG3160x600FT213to331/?click='+ftClick+'&
ftx='+ftX+'&fty='+ftY+'&ftadz='+ftZ+'&ftscw='+ftContent+'&
ft_custom='+ftCustomn+'&cachebuster='+ftRandom+'" id="ftscr'+'ipt_160x600"
name="ftscr'+'ipt_160x600"';nftTag += '">' + ftBuildTag2 + 'scr'+'ipt>
';ndocument.write(ftTag);\n</scr'+'ipt>nn';
this.altsrc = '<a href="http://www.example.com/defaultads/comp160x600.gif"
width="160" height="600" border="0"></a>';

this.callbackName = '__dvredirect_callback_' + this.rand;
var thisRedirect = this;
window[this.callbackName] = function () { return thisRedirect; };

 

var src = 'http://rtbcdn.doubleverify.com/bsredirect5.js?callback=' + this.callbackName;
document.write('<scr' + 'ipt src=' + src + '></scr' + 'ipt>');
}

</script>


加入 Click 巨集之後:

<script language="javascript" type="text/javascript">
new function() {
this.rand = Math.floor((Math.random() + "") * 1000000000000);
this.dvparams = 'ctx=12345&cmp=12345&plc=12345&sid=12345';
this.dvregion = '0';
this.tagsrc = '<noscr'+'ipt>\n<a href="${CLICK_URL}http://servedby.flashtalking.com/
click/4/12345;12345;0;12345;0/?url=1419304" target="_blank">\n
<img border="0" src="http://servedby.flashtalking.com/imp/4/12345;12345;12345;gif;
FIOS112MDUInviteBT2DallasDMAMPG3160x600FT213to331/?"></a>\n
</noscr'+'ipt>\n<scr'+'ipt language="Javascr'+'ipt1.1" type="text/javascr'+'ipt">
\nvar ftClick = "${CLICK_URL_ENC}";\nvar ftX = "";\nvar ftY = "";\nvar ftZ = "";\nvar ftContent = "";
\nvar ftCustom = "";\nvar ft160x600_OOBclickTrack = "";\nvar ftRandom = Math.random()*1000000;
\nvar ftBuildTag1 = "<scr";\nvar ftBuildTag2 = "</";\nvar ftTag = ftBuildTag1 +
'ipt language="javascr'+'ipt1.1" type="text/javascr'+'ipt" ';nftTag +=
'src="http://servedby.flashtalking.com/imp/4/12345;12345;12345;js;

FIOS112MDUInviteBT2DallasDMAMPG3160x600FT213to331/?click='+ftClick+'&
ftx='+ftX+'&fty='+ftY+'&ftadz='+ftZ+'&ftscw='+ftContent+'&
ft_custom='+ftCustomn+'&cachebuster='+ftRandom+'" id="ftscr'+'ipt_160x600"
name="ftscr'+'ipt_160x600"';nftTag += '">' + ftBuildTag2 + 'scr'+'ipt>
';ndocument.write(ftTag);\n</scr'+'ipt>nn';
this.altsrc = '<a href="http://www.example.com/defaultads/comp160x600.gif"
width="160" height="600" border="0"></a>';

this.callbackName = '__dvredirect_callback_' + this.rand;
var thisRedirect = this;
window[this.callbackName] = function () { return thisRedirect; };

 

var src = 'http://rtbcdn.doubleverify.com/bsredirect5.js?callback=' + this.callbackName;
document.write('<scr' + 'ipt src=' + src + '></scr' + 'ipt>');
}

</script>

Sizmek 代碼

Please note, Display & Video 360 will automatically insert click tracking macros into your Sizmek tags for you.

 

第一類代碼

加入 Click 巨集之前:

<script src="http://bs.serving-sys.com/BurstingPipe/adServer.bs?cn=rsb&c=28&pli=1234567&PluID=0&w=160&h=600&ord=[timestamp]&ucm=true"></script>
<noscript>
<a href="http://bs.serving-sys.com/BurstingPipe/BannerRedirect.asp?FlightID=1234567&Page=&PluID=0&Pos=5756" target="_blank"><img src="http://bs.serving-sys.com/BurstingPipe/BannerSource.asp?FlightID=1280098&Page=&PluID=0&Pos=5756" border=0 width=160 height=600></a>
</noscript>


加入 Click 巨集之後:

<script src="http://bs.serving-sys.com/BurstingPipe/adServer.bs?cn=rsb&c=28&pli=1234567&PluID=0&w=160&h=600&ord=${CACHEBUSTER}&ncu=${CLICK_URL_ENC}&ucm=true"></script>
<noscript>
<a href="${CLICK_URL}http://bs.serving-sys.com/BurstingPipe/BannerRedirect.asp?FlightID=134567&Page=&PluID=0&Pos=5756" target="_blank"><img src="http://bs.serving-sys.com/BurstingPipe/BannerSource.asp?FlightID=1234567&Page=&PluID=0&Pos=5756" border=0 width=160 height=600></a>
</noscript>

 

第二類代碼

加入 Click 巨集之前:

<script> var gstrEbPreLoadscripts = "http://geo.serving-sys.com/GeoAnalytics/ebGeoAnalyticsDMACodeCS.aspx";</script> <script src="http://bs.serving-sys.com/BurstingPipe/adServer.bs?cn=rsb&c=28&pli=1234567&PluID=0&w=160&h=600&ord=[timestamp]&cs=1"></script> <noscript> <a href="http://bs.serving-sys.com/BurstingPipe/BannerRedirect.asp?FlightID=1234567&Page=&PluID=0&Pos=518" target="_blank"><img src="http://bs.serving-sys.com/BurstingPipe/BannerSource.asp?FlightID=1234567&Page=&PluID=0&Pos=518" border=0 width=160 height=600></a> </noscript>


加入 Click 巨集之後:

<script> var gstrEbPreLoadscripts = "http://geo.serving-sys.com/GeoAnalytics/ebGeoAnalyticsDMACodeCS.aspx";</script> <script src="http://bs.serving-sys.com/BurstingPipe/adServer.bs?cn=rsb&c=28&pli=1234567&PluID=0&w=160&h=600&ord=${CACHEBUSTER}&ncu=${CLICK_URL_ENC}&cs=1"></script><noscript><a href="${CLICK_URL}http://bs.serving-sys.com/BurstingPipe/BannerRedirect.asp?FlightID=1234567&Page=&PluID=0&Pos=518" target="_blank"><img src="http://bs.serving-sys.com/BurstingPipe/BannerSource.asp?FlightID=1234567&Page=&PluID=0&Pos=518" border=0 width=160 height=600></a></noscript>
這對您有幫助嗎?
我們應如何改進呢?

還有其他問題嗎?

登入即可獲得其他支援選項,快速解決您的問題