I need to record clicks when someone clicked on a absolute url. If the link is record.php?id=x then its easy to do that. However, I need the absolute url to be indexed by search engine so I cant do that ( am I right actually? ) What I think of now is record the clicks using javascript. <a href="" onclick="ajax_function()"></a> Code (markup): Is there any other way? Thank you.
I'd stick with the PHP route, making sure the PHP code 301's to the 'normal' URL. There will still be a sacrifice though, but thats the price you pay for recording stats. I don't see why you just plug Google Analytics in (JS code) meaning YOU don't have to do anything...
You have to do it with javascript. It won't work easily on PHP. Link directory scripts (like phpld) also do it with javascript
Its not hard; see sample psuedocode <? $url = $_GET['id']; // connect to mysql //select row $url and increment by 1 //end mysql header(Location: $url); ?> Thats some example code. Its certainly not convoluted. Code (markup):
He wants to do it without a ?id=... Instead of going first to mydomain.com?id=x, increment by 1 and go to otherdomain.com the OP wants to increment by 1 and go to otherdomain.com without going to mydomain.com?id=x first, so the search engines will index otherdomain.com, not mydomain.com?id=x. At least that's how I understand it...