key Log In or Register to edit

If everything is working properly the %!ADVERTS{}% directive below will be a random advert

... advert below Ad Sponsor

... advert above

If you see nothing above, here's what you do

  1. Ensure you have an advertiser and campaign in your adserver
  2. Use your browser's controls to view the HTML Page Source of this page
  3. Compare the expected output below with that of your Page Source, especially the server setting
  4. Ensure your ADVERTSPLUGIN_ADVERTSCRIPTBASE is as expected (Yours is set to http://adverts.mrjc.com/)
  5. Ensure you are getting the right page hits

The following code explains the output and can be used to help diagnose problems

In Adverts Plugin.pm, the method getTemplateAdvertRemoteInvocationJavaScript produces the code for phpAdsNew / Max Media Manager "Remote Invocation Java Script?" method

The following is injected into the HTML:

<script language='JavaScript' type='text/javascript'>
<!--
   if (!document.phpAds_used) document.phpAds_used = ',';
   phpAds_random = new String (Math.random()); phpAds_random = phpAds_random.substring(2,11);
   
   document.write ("<" + "script language='JavaScript' type='text/javascript' src='");
   document.write ("http://yourserver.com/phpAdsNew-2.0/adjs.php?n=" + phpAds_random);
   document.write ("&amp;what=Foobar&amp;clientid=2");
   document.write ("&amp;exclude=" + document.phpAds_used);
   if (document.referer)
      document.write ("&amp;referer=" + escape(document.referer));
   document.write ("'><" + "/script>");
//-->
</script><noscript><a href='http://yourserver.com/phpAdsNew-2.0/adclick.php?n=ad13c123' target='_blank'><img src='http://yourserver.com/phpAdsNew-2.0/adview.php?what=Foobar&amp;clientid=2&amp;n=ad13c123' border='0' alt=''></a></noscript>

using this as a wrapper (http://twiki.org/cgi-bin/view/Codev/JavaScriptInterferedWithByTWiki)

<script type="text/javascript">
<!-- Hide JavaScript and <pre> escape TWiki rendering
... your JavaScript goes here...
// Stop hiding and stop </pre> escaping TWiki rendering -->
</script>

Causes an entry such as this in access.log:

65.94.104.160 - - [29/Aug/2004:18:39:14 -0700] "GET /phpAdsNew-2.0/adjs.php?n=239035524&bannerid:1&exclude=, HTTP/1.1" 200 928 "http://yourserver.com/ad.html" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705)"

which then causes this:

65.94.104.160 - - [29/Aug/2004:18:39:14 -0700] "GET /phpAdsNew-2.0/adlog.php?bannerid=1&clientid=2&zoneid=0&source=&block=0&capping=0&cb=092590b19368e17feb905f0b445970fe HTTP/1.1" 200 387 "http://yourserver.com/ad.html" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705)"

 
Ad Sponsor
Back to Redbourn
Copyright © We make no guarantee of the correctness of the content of this site. All material on this collaboration platform is the property of Martin Cleaver and the contributing authors.