Version 5.0
AdvertServe User Manual :: v5.0

PhpAdsNew Click Tracking

Note Note

Manually making the changes documented here to activate click tracking is no longer necessary. As of version 3.0 the ad server will automatically make these changes for you when creating or editing a media. These examples are only provided as a reference so you can see if a particular code format is recognized or not. Please submit unrecognized codes to support for addition to our automated processing rules.

Original Code

You should have received some code from PhpAdsNew that looks like the following:


<script language='JavaScript' type='text/javascript'>
<!--
  // Insert click tracking URL here
  document.phpAds_ct0 = 'Insert_Clicktrack_URL_Here';

  var rnd = Math.floor(Math.random()*99999999999);
  var protocol = location.protocol.indexOf('https')>-1?'https:':'http:';
  if (!document.phpAds_used) document.phpAds_used = ',';
  document.write ("<" + "script language='JavaScript' type='text/javascript' src='");
  document.write (protocol+"//www.xyz.net/adjs.php?n=acf3a813");
  document.write ("&zoneid=415");
  document.write ("&exclude=" + document.phpAds_used);
  document.write ("&loc=" + escape(window.location));
  if (document.referrer)
    document.write ("&referer=" + escape(document.referrer));
  document.write ('&r=' + awrz_rnd);
  document.write ("&ct0=" + escape(document.phpAds_ct0));
  document.write ("'><" + "/script>");
//-->
</script>
<noscript>
<a href="http://www.xyz.net/adclick.php?n=acf3a813" target="_blank">
<img src="http://www.xyz.net/adview.php?zoneid=415&n=acf3a813" border="0" alt="">
</a>
</noscript>

Modified Code

What you need to do is modify the URLs in the <SCRIPT> and <A> tags as shown by the highlighted changes:


<script language='JavaScript' type='text/javascript'>
<!--
  // Insert click tracking URL here
  document.phpAds_ct0 = '%%CLICKLINK%%';

  var rnd = Math.floor(Math.random()*99999999999);
  var protocol = location.protocol.indexOf('https')>-1?'https:':'http:';
  if (!document.phpAds_used) document.phpAds_used = ',';
  document.write ("<" + "script language='JavaScript' type='text/javascript' src='");
  document.write (protocol+"//www.xyz.net/adjs.php?n=acf3a813");
  document.write ("&zoneid=415");
  document.write ("&exclude=" + document.phpAds_used);
  document.write ("&loc=" + escape(window.location));
  if (document.referrer)
    document.write ("&referer=" + escape(document.referrer));
  document.write ('&r=' + awrz_rnd);
  document.write ("&ct0=" + escape(document.phpAds_ct0));
  document.write ("'><" + "/script>");
//-->
</script>
<noscript>
<a href="%%CLICKLINK%%http://www.xyz.net/adclick.php?n=acf3a813" target="_blank">
<img src="http://www.xyz.net/adview.php?zoneid=415&n=acf3a813" border="0" alt="">
</a>
</noscript>