Forum Moderators: DixonJones
I have a site built with plain HTML, which is essentially a collection of links with my comments and reviews on each one. It's just a small hobby site of mine, but it's slowly getting more traffic from fellow enthusiasts, and I'd like to start tracking where these people are clicking off to.
Is there a relatively simple way to track this? I've seen plenty of sites use the syntax "www.myownsite.com/script/redirect?www.thenewsite.com" but can't figure it out myself. Seems to be PHP(?) or something, of which I know nothing. As I mentioned in the subtitle of this thread, I'm new to anything but HTML (and not even all that good at HTML!)
Anyway, no more rambling from me - thanks for any help :)
mo.
If you links go to a server-side script (eg. PHP) then you can increment a counter and THEN redirect the user to the linked site.
This can also help protect your site from 'content scrapers'.
Heres some PHP to get you started. Put in it its own file, called for example "clickout.php", nothing extra in the file (esp at the end) or it might not work!
To capture the clickout, change your HTML from
<a href="www.thatsite.com">{/code] to [code]<a href="clickout.php?www.thatsite.com"> <?php
header("Location: http://".$_SERVER['QUERY_STRING']);
exit;
?> Larry
I used such a script to weed out the affiliate programs that liked the customers I sent them but didn't like sending the checks. It sure can be eye opening when you see 100s of click-throughs to one affiliate program and somehow they never have any conversions, while a similar affiliate program will have a nice conversion rate.
I tested out the clickout.php file - at first I couldn't see how it worked, but I just checked my log file and saw that the "cs-uri-stem" column now shows the link that was clicked next to "foldername/clickout.php". Opening the log file in Excel allows me to tally all of the links in that column. This is a great start! Many thanks :)
My thirst for data is sated - for now!
Cheers,
mo.
(...snip...) GET /foldername/clickout.php www.example.com (...snip...) msnbot/0.3+(+http://search.msn.com/msnbot.htm)
Where the URL in question is www.mydomain.com/foldername/clickout.php?www.example.com
Should I be adding the PHP file into a folder that's blocked with a robots.txt? Or is this just the bot following links off to another site? I get dozens of these entries, one after the other, in my logs, so it looks like it's indexing each one.
Thanks for your thoughts!
mo.
Do you care?
Good point! Maybe not... I guess I like to keep everything as clean as possible, and I worry about getting strange pages showing up as search results. What prompted it was a sudden drop in SE referrals over the last day or so - but I think it's coincidence.
Thanks for all your help Larry!
mo.