DoubleClick

The following presents a guideline on how DoubleClick standard and rich media tags should be edited to count clicks in Google Ad Manager. In order to track clicks follow the procedure below:

JavaScript Code

Original Code

You should have received some JavaScript code from DoubleClick that looks similar to the following example:

<SCRIPT language='JavaScript1.1' SRC="https://ad.doubleclick.net/adj/N270.site.com/F87536;sz=300x250;ord=[timestamp]?"></script>
<NOSCRIPT>
<A HREF="https://ad.doubleclick.net/jump/N270.site.com/F87536;sz=300x250;ord=[timestamp]?">
<IMG SRC="https://ad.doubleclick.net/ad/N270.site.com/F87536;sz=300x250;ord=[timestamp]?" BORDER=0 WIDTH=468 HEIGHT=60 ALT="Click Here!">Click Here!</A>
</NOSCRIPT>

Modified Code

What you need to do is modify the URL in the <SCRIPT> tag as shown by the highlighted changes, The resulting tag should look similar to the following example:

<SCRIPT language='JavaScript1.1' SRC="https://ad.doubleclick.net/adj/N270.site.com/F87536;sz=300x250;click=%%CLICK_URL_UNESC%%;ord=%%CACHEBUSTER%%?"></script>
<NOSCRIPT>
<A HREF="%%CLICK_URL_UNESC%%https://ad.doubleclick.net/jump/N270.site.com/F87536; sz=300x250;ord=%%CACHEBUSTER%%?">
<IMG SRC="https://ad.doubleclick.net/ad/N270.site.com/F87536;sz=300x250;ord=%%CACHEBUSTER%%?" BORDER=0 WIDTH=300 HEIGHT=250 ALT="Click Here!">Click Here!</A>
</NOSCRIPT>

IFRAME Code

Original Code

You should have received some IFRAME code from DoubleClick that looks similar to the following example:

<IFRAME SRC="https://ad.doubleclick.net/adi/N884.sitename/F87536;sz=300x250;ord=[timestamp]?" WIDTH=300 HEIGHT=250 MARGINWIDTH=0 MARGINHEIGHT=0 HSPACE=0 VSPACE=0 FRAMEBORDER=0 SCROLLING=no BORDERCOLOR='#000000'>
<SCRIPT language='JavaScript1.1' SRC="https://ad.doubleclick.net/adj/N884.sitename/F87536;abr=!ie;sz=300x250;ord=[timestamp]?">
</SCRIPT>
<NOSCRIPT>
<A HREF="https://ad.doubleclick.net/jump/N884.sitename/F87536;abr=!ie4;abr=!ie5;sz=300x250;ord=[timestamp]?">
<IMG SRC="https://ad.doubleclick.net/ad/N884.sitename/F87536;abr=!ie4;abr=!ie5;sz=300x250;ord=[timestamp]?" BORDER=0 WIDTH=300 HEIGHT=250 ALT="Click Here">
</A>
</NOSCRIPT>
</IFRAME>

Modified Code

What you need to do is modify the URL in the <IFRAME> tag as shown by the highlighted changes, The resulting tag should look similar to the following example:

<IFRAME SRC="https://ad.doubleclick.net/adi/N884.sitename/F87536;sz=300x250;click=%%CLICK_URL_UNESC%%;ord=%%CACHEBUSTER%%?" WIDTH=300 HEIGHT=250 MARGINWIDTH=0 MARGINHEIGHT=0 HSPACE=0 VSPACE=0 FRAMEBORDER=0 SCROLLING=no BORDERCOLOR='#000000'>
<SCRIPT language='JavaScript1.1' SRC="https://ad.doubleclick.net/adj/N884.sitename/F87536;abr=!ie;sz=300x250;click=%%CLICK_URL_UNESC%%;ord=%%CACHEBUSTER%%?">
</SCRIPT>
<NOSCRIPT>
<A HREF="%%CLICK_URL_UNESC%%https://ad.doubleclick.net/jump/N884.sitename/F87536;abr=!ie4;abr=!ie5;sz=300x250;ord=%%CACHEBUSTER%%?">
<IMG SRC="https://ad.doubleclick.net/ad/N884.sitename/F87536;abr=!ie4;abr=!ie5;sz=300x250;ord=%%CACHEBUSTER%%?" BORDER=0 WIDTH=300 HEIGHT=250 ALT="Click Here">
</A>
</NOSCRIPT>
</IFRAME>

IMG Code

Original Code

You should have received some IMG code from DoubleClick that looks similar to the following example:

<A HREF="https://ad.doubleclick.net/jump/N884.sitename/F87536;sz=300x250;ord=[timestamp]?">
<IMG SRC="https://ad.doubleclick.net/ad/N884.sitename/F87536;sz=300x250;ord=[timestamp]?" BORDER=0 WIDTH=300 HEIGHT=250 ALT="Click Here">
</A>

Modified Code

What you need to do is modify the URL in the <A> tag as shown by the highlighted changes, The resulting tag should look similar to the following example:

<A HREF="%%CLICK_URL_UNESC%%https://ad.doubleclick.net/jump/N884.sitename/F87536;sz=300x250;ord=%%CACHEBUSTER%%?" target="_blank">
<IMG SRC="https://ad.doubleclick.net/ad/N884.sitename/F87536;sz=300x250;ord=%%CACHEBUSTER%%?" BORDER=0 WIDTH=300 HEIGHT=250 ALT="Click Here">
</A>

INS Code

Original Code

You should have received some INS code from DoubleClick that looks similar to the following example:

<ins class="dcmads" style="display:inline-block;width:300px;height:250px"
    data-dcm-placement="N884.sitename/F87536.879654872"
    data-dcm-rendering-mode="iframe"
    data-dcm-https-only
    data-dcm-resettable-device-id="">
  <script src="https://www.googletagservices.com/dcm/dcmads.js"></script>
</ins>

Modified Code

What you need to do is modify the URL in the <INS> tag as shown by the highlighted changes, The resulting tag should look similar to the following example:

<ins class="dcmads" style="display:inline-block;width:300px;height:250px"
    data-dcm-placement="N884.sitename/F87536.879654872"
    data-dcm-rendering-mode="iframe"
    data-dcm-https-only
    data-dcm-resettable-device-id="">
    data-dcm-click-tracker="%%CLICK_URL_UNESC%%" 
  <script src="https://www.googletagservices.com/dcm/dcmads.js"></script>
</ins>

Note

The ad server recognises the [timestamp] placeholder and will automatically replace it with a cache buster. It is not necessary to convert it to the %%CACHEBUSTER%% macro manually.

Use %%CLICK_URL_UNESC%% at the beginning of a link. Use %%CLICK_URL_ESC%% when the click-tracker is the parameter of another URL.

<a href="%%CLICK_URL_UNESC%%https://www.google.com">link</a>
<a href="https://www.google.com?rd_url=%%CLICK_URL_ESC%%">link</a>