Track JavaScript usage on your site

Discussion in 'JavaScript' started by KalvinB, Jan 4, 2007.

  1. #1
    http://js.icarusindie.com/

    I was sick of maintaining multiple copies of my js enabled checking code so I created a single simple way to do it.

    
    <a href="http://js.icarusindie.com/js.php?a=bot"><img name='js_check' src="http://js.icarusindie.com/js.php?a=check" border=0></a>
    <script type="text/javascript">window.onload=function() { js_check.src='http://js.icarusindie.com/js.php?a=log'; }</script>
    
    Code (markup):
    If you already have an onload function on your site you'll just need to move the function that swaps out the images from the script portion of the code above to the onload function you already have.

    The site is rather crude right now because I just wanted to get it collecting data.

    Going to the link designates the IP as a bot and that ip will be ignored when checking to see if an IP has javascript disabled. Since the returned image is a 1x1 transparent image no real people should ever click on the link.

    This weekend you'll be able to enter your domain name on the js.icarusindie.com site and see stats on your site.

    On the site it tells you what request to send to the server to see if an IP has JS enabled. What you do with that information is up to you. I'll have sample PHP code for getting that information this weekend.

    I recommend pasting the code at the bottom of pages you want to track usage.
     
    KalvinB, Jan 4, 2007 IP
  2. KalvinB

    KalvinB Peon

    Messages:
    2,787
    Likes Received:
    78
    Best Answers:
    0
    Trophy Points:
    0
    #2
    KalvinB, Jan 5, 2007 IP