AdvertPRO

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

<!-- BEGIN ADVERTPRO CODE -->
<script src="https://adserver.example.com/js/libcode1_noajax.js" type="text/javascript"></script>
<!-- END ADVERTPRO CODE -->

<!-- BEGIN ADVERTPRO CODE -->
<script type="text/javascript">
if (document.avp_ready) { avp_zone({ base: 'adserver.example.com', type: 'banner', zid: 7, pid: 0 }); }
</script>
<!-- END ADVERTPRO CODE -->

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:

<!-- BEGIN ADVERTPRO CODE -->
<script src="https://adserver.example.com/js/libcode1_noajax.js" type="text/javascript"></script>
<!-- END ADVERTPRO CODE -->

<!-- BEGIN ADVERTPRO CODE -->
<script type="text/javascript">
if (document.avp_ready) { avp_zone({ base: 'adserver.example.com', type: 'banner', zid: 7, pid: 0, encode: 1, cturl: '%%CLICK_URL_ESC%%' }); }
</script>
<!-- END ADVERTPRO CODE -->

HTML Code

Original Code

You should have received some HTML code from AdvertPRO that looks similar to one of the following examples:

JAVASCRIPT with built-in cache buster

<!-- BEGIN ADVERTPRO CODE -->
<script type="text/javascript">
document.write('<scr'+'ipt src="https://adserver.example.com/servlet/view/banner/javascript/zone?zid=123&pid=0&random='+Math.floor(89999999*Math.random()+10000000)+'&millis='+new Date().getTime()+'&referrer='+encodeURIComponent((window!=top&&window.location.ancestorOrigins)?window.location.ancestorOrigins[window.location.ancestorOrigins.length-1]:document.location)+'" type="text/javascript"></scr'+'ipt>');
</script>
<!-- END ADVERTPRO CODE -->

JAVASCRIPT with click tracking and cache buster

<!-- BEGIN ADVERTPRO CODE -->
<script type="text/javascript" src="https://adserver.example.com/servlet/view/banner/javascript/zone?zid=123&pid=0&random=[random]&encode=1&cturl=[clickurl]" type="text/javascript"></script>
<!-- END ADVERTPRO CODE -->

IFRAME with click tracking and cache buster

<!-- BEGIN ADVERTPRO CODE -->
<iframe src="https://adserver.example.com/servlet/view/banner/javascript/html/zone?zid=123&pid=0&random=[random]&encode=1&cturl=[clickurl]" height="60" width="468" hspace="0" vspace="0" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
<!-- END ADVERTPRO CODE -->

Modified Code

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

JAVASCRIPT with built-in cache buster

<!-- BEGIN ADVERTPRO CODE -->
<script type="text/javascript">
document.write('<scr'+'ipt src="https://adserver.example.com/servlet/view/banner/javascript/zone?zid=123&pid=0&random='+Math.floor(89999999*Math.random()+10000000)+'&millis='+new Date().getTime()+'&encode=1&referrer='+encodeURIComponent((window!=top&&window.location.ancestorOrigins)?window.location.ancestorOrigins[window.location.ancestorOrigins.length-1]:document.location)+'&cturl=
%%CLICK_URL_ESC%%" type="text/javascript"></scr'+'ipt>');
</script>
<!-- END ADVERTPRO CODE -->

JAVASCRIPT with click tracking and cache buster

<!-- BEGIN ADVERTPRO CODE -->
<script type="text/javascript" src="https://adserver.example.com/servlet/view/banner/javascript/zone?zid=123&pid=0&random=%%CACHEBUSTER%%&encode=1&cturl=%%CLICK_URL_ESC%%" type="text/javascript"></script>
<!-- END ADVERTPRO CODE -->

IFRAME with click tracking and cache buster

<!-- BEGIN ADVERTPRO CODE -->
<iframe src="https://adserver.example.com/servlet/view/banner/javascript/html/zone?zid=123&pid=0&random=%%CACHEBUSTER%%
&encode=1&cturl=%%CLICK_URL_ESC%%" height="60" width="468" hspace="0" vspace="0" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
<!-- END ADVERTPRO CODE -->

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>