Displaying Google Ad's Only When Referred From Google
If you are using Google Ad's and only want them to be displayed when the referrer is Google, then you can use this simple javascript if condition to accomplish this.
<div style="text-align:center">
<script type="text/javascript">
<!--
if (document.referrer != null && document.referrer.toString().indexOf("google") != -1)
{
google_ad_client = "pub-9087979379036836";
google_ad_slot = "3579334815";
google_ad_width = 468;
google_ad_height = 60;
document.write("<script type='text/javascript' src='http://pagead2.googlesyndication.com/pagead/show_ads.js'><\/script>");
}
//-->
</script>
</div>



