How do I add a random number to an Image or iFrame invocation tag in place of insert_random_number_here?

Image and iFrame invocation tags have a placeholder for a random number which is used to prevent users from caching a URL's content in their browser, preventing new banners from being freshly loaded.

Other invocation tag types automatically provide a random number.

Without a random number attached to the invocation tag, it may prevent the banners from being rotated properly and a valid impression might not be recorded.

You can add a random number to these tags' client-side by using JavaScript, or their server-side by using a programming language like PHP or ASP

An example in PHP would be:


<a href="http://www.example.com/ck.php?n=3798N2&cb=<?php echo rand(); ?>"><img src="http://www.example.com/avw.php?zoneid=10&n=3798N2&cb=<?php echo rand(); ?>"></a>

An example in Javascript would be:


<script type='text/javascript'>
var randomnumber=Math.floor(Math.random()*99999999999);
document.write("<a href='http://www.example.com/ck.php?n=3798N2&cb="+randomnumber);
document.write("'><img src='http://www.example.com/avw.php?zoneid=10&n=3798N2&cb="+randomnumber);
document.write("'></a>");
</script>

You will want to first generate the valid Image invocation tag from within OpenX to make sure that the domain and path to OpenX are valid, and that the <img> tag has the correct zoneid.

--
Keywords: INSERT_RANDOM_NUMBER_HERE