View Full Version : /scripts/outphp?LinkID=23
michael_gersitz
11-22-2003, 09:21 AM
I have noticed on websitepublisher and other sites using URLS like this.... I need one like this that will allow me to track how much traffic I sent to other sites...
I was wondering if There was a script you downloaded or can you give me hint how you made this script.
THank You in Advance! :)
michael_gersitz
11-22-2003, 09:21 AM
Example page - http://www.websitepublisher.net/article/charging_content/
"Link
Two popular turnkey credit card processors:
2Checkout
Revecom "
GCT13
11-22-2003, 10:06 AM
My out.php script uses two databases and a .php file.
Create two databases:
urls (id,url)
LinkTracker (id,lid)
Db "urls" will list all your external links.
Db "LinkTracker" will be updated whenever someone clicks an external link. So if Google's entry in "urls" is:
id url
9 http://www.google.com
"LinkTracker" will be inserted with:
id lid
1000 9
Where lid is the link's id in "urls"
"LinkTracker" will grow and you'll be able to see how many times users leave your site and what link they click. You could even add the current data to LinkTracker to plot clicks over time.
Now to the out.php file. For example:
out.php?LinkId=9
will forward to http://www.google.com
if(isset($_GET['LinkID'])){
// the querystring is set, then execute the script
$LinkID = (int) $_GET['LinkID'];
dbConnect(); // this is the function call to connect to your database
$query = "insert LinkTracker set lid = $LinkID";
@mysql_query($query);
$query = "select url from urls where id = $LinkID";
$result = sql_query($query);
$rd = $result[0][0];
header("Location: $rd");
}else{ // no querystring, send back to WebSitePublisher.net
header("Location: http://www.websitepublisher.net");
}
If you want to use the script I use michael, PM me.
incka
03-04-2004, 12:59 AM
Thanks for this, I'll use it tonight when making my new sites :)
chrispian
03-04-2004, 06:42 PM
Wouldn't it be easier (and more efficient) to just use one table?
tbl_urls (id, url, count)
GCT13
03-04-2004, 10:21 PM
Originally posted by chrispian
Wouldn't it be easier (and more efficient) to just use one table?Easier perhaps short term, but not more efficient since the DB technically wouldn't be normalized.
For those of you using AXS Visitor Tracking, there is a feature that allows you to track clicks.
Say your AXS file are located here: /cgi-bin/axs/
Then tag all your outgoing links like so:
http://www.yoursite.com/cgi-bin/axs/ax.pl?http://www.somewhereelse.com
And voila. All outgoing clicks show up in your log reports. I've started tracking clicks way.
More info on AXS can be found here (http://www.websitepublisher.net/forums/showthread.php?threadid=600).
chrispian
03-05-2004, 07:46 AM
Since we aren't trying to relate anything, it sems to me normal order doesn't apply. It would be different if we were trying to do a join on, say, id, with details about the url or something. I suppose anything that "changes" should be in it's own table according to first normal order, but this is a bit of an extreme case ;)
You are right, of course, it's more correct to do it your way.
incka
03-28-2004, 11:51 AM
Can't get the script to work.
Powered by vBulletin® Version 4.2.2 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.