Mediaplex

The following presents a guideline on how Mediaplex 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 Mediaplex that looks similar to the following example:

<script language="JavaScript1.1" src="https://altfarm.mediaplex.com/ad/js/5488-54542-9524-1?mpt=[CACHEBUSTER]&mpvc="></script>
<noscript>
<a href="https://altfarm.mediaplex.com/ad/ck/5488-54542-9524-1?mpt=[CACHEBUSTER]">
<img src="https://altfarm.mediaplex.com/ad/bn/5488-54542-9524-1?mpt=[CACHEBUSTER]" alt="Click Here" border="0">
</a>
</noscript>

Modified Code

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

<script language="JavaScript1.1" src="https://altfarm.mediaplex.com/ad/js/5488-54542-9524-1?mpt=%%CACHEBUSTER%%&mpvc=%%CLICK_URL_ESC_ESC%%"></script>
<noscript>
<a href="%%CLICK_URL_UNESC%%https://altfarm.mediaplex.com/ad/ck/5488-54542-9524-1?mpt=%%CACHEBUSTER%%">
<img src="https://altfarm.mediaplex.com/ad/bn/5488-54542-9524-1?mpt=%%CACHEBUSTER%%" alt="Click Here" border="0">
</a>
</noscript>

IFRAME Code

Original Code

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

<iframe src="https://altfarm.mediaplex.com/ad/fm/5488-54542-9524-1?mpt=[CACHEBUSTER]&mpvc=" width=300 height=250 marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=no bordercolor="#000000">
<script type="text/javascript" src="https://altfarm.mediaplex.com/ad/!js/5488-54542-9524-1?mpt=[CACHEBUSTER]&mpvc=">
</script>
<noscript>
<a href="https://altfarm.mediaplex.com/ad/nc/5488-54542-9524-1?mpt=[CACHEBUSTER]">
<img src="https://altfarm.mediaplex.com/ad/nb/5488-54542-9524-1?mpt=[CACHEBUSTER]" alt="Click Here" border="0">
</a>
</noscript>
</iframe>

Modified Code

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

<iframe src="https://altfarm.mediaplex.com/ad/fm/5488-54542-9524-1?mpt=%%CACHEBUSTER%%&mpvc=%%CLICK_URL_ESC_ESC%%" width="300" height="250" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no" bordercolor="#000000">
<script type="text/javascript" src="https://altfarm.mediaplex.com/ad/!js/5488-54542-9524-1?mpt=%%CACHEBUSTER%%&mpvc=%%%CLICK_URL_ESC_ESC%%">
</script>
<noscript>
<a href="%%CLICK_URL_UNESC%%https://altfarm.mediaplex.com/ad/nc/5488-54542-9524-1?mpt=%%CACHEBUSTER%%">
<img src="https://altfarm.mediaplex.com/ad/nb/5488-54542-9524-1?mpt=%%CACHEBUSTER%%" alt="Click Here" border="0">
</a>
</noscript>
</iframe>

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>