SEO friendly click tracking?

Discussion in 'JavaScript' started by runnerunner, May 16, 2006.

  1. #1
    is there an easy way to create SEO friendly links and track their clicks?

    i am trying to use this code:

    <script language="JavaScript">
    function trackclick(id) {
        if(document.images){
            (new Image()).src="trackclick.php?id="+id;
        }
        return true;
    }
    </script>
    Code (markup):
    and then this as the link:

    <a href="http://sample.com"
    	id="1"
        title="title"
        onclick="return trackclick(this.id);">
        title</font></a>
    HTML:
    trackclick then gets the id and updates the clicks into a mysql database, does this look good? You have to have an image on the page for it to work in theory, but it only works like 1 out of 25 times, any suggestions? thanks
     
    runnerunner, May 16, 2006 IP