inserting getclicky.com javascript tracking script into php

Discussion in 'PHP' started by neil patrick harris, May 3, 2008.

  1. #1
    I'm trying to track users searches on my site so I can offer them better results and post the most searched torrent on the front page etc... So I need to install this tracking code from getclicky.com on one of my php pages but I have no idea how to put it in there.

    Can anyone show me how? Heres the script.

    <!-- sticky traffic analytics  -->
    
    <script src="http://static.getclicky.com/55555.js" type="text/javascript"></script>
    
    	<!-- sticky traffic analytics  -->
    Code (markup):
    and the bottom of my page ends like this.

    
    	$url = "http://www.torrentz.com/search?q=". $q. "&x=0&y=0";
    
        break;	
    }
    
    ?>
    Code (markup):
    Thanks in advance.:)
     
    neil patrick harris, May 3, 2008 IP
  2. matthewrobertbell

    matthewrobertbell Peon

    Messages:
    781
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Put the code after the "?>"
     
    matthewrobertbell, May 4, 2008 IP
  3. neil patrick harris

    neil patrick harris Peon

    Messages:
    288
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I did it gives me a parse error on line __
     
    neil patrick harris, May 4, 2008 IP
  4. matthewrobertbell

    matthewrobertbell Peon

    Messages:
    781
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Change all " to \" in the code you are inserting
     
    matthewrobertbell, May 5, 2008 IP
  5. skippybosco

    skippybosco Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    this is very similar to what I have on my site.. this should work for you:

    	$url = "http://www.torrentz.com/search?q=". $q. "&x=0&y=0";
    
        break;	
    }
    
    <script src='http://static.getclicky.com/55555.js' type='text/javascript'></script>
    
    ?>
    
    Code (markup):
     
    skippybosco, May 5, 2008 IP