By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,996 Members | 1,193 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,996 IT Pros & Developers. It's quick & easy.

Help with logging stata of external link visits from my site.

P: n/a
I am using Statcounter to log site visits
Upon enquiring whether the service logged visits from my site to external
sites using site links I was given the following information:-
"You have to provide a means to capture that information.
There are 2 ways to do it: onClick event handlers placed on all the links to
external pages with an appropriate javascript function which will perform
the logging before redirecting to the external link or, better yet, to
channel each page meant to be linked through an intermediate page
(perferably written in php) where you log and then redirect to the desired
external link.
Using php instead of javascript ensures that even those who disable
javascript will be channelled in that manner."

As I am not a professional programmer I would appreciate any pointers,
examples, or any type of help in achieving my objective.
Hoping someone can help
Brian Tozer

Jul 24 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Tue, 12 Apr 2005 18:04:49 +1200, "KiwiBrian" <br******@ihug.co.nz>
wrote:
As I am not a professional programmer I would appreciate any pointers,
examples, or any type of help in achieving my objective.


Do it the second way (server side). Mainly because it's _much_
easier to maintain your page content. You'll need to change all your
externally pointing links to have URLs of the form:
http:///redirector.php?url=http%3A%2...p%3D1%26q%3D23

which is simply the URL encoded form of
http://foo.com/bar/bat.html?p=1&q=23

The redirector page itself is probably downloadable from somewhere.
You only need one for the whole site and it just needs to log simply
the referrer page and the target URL. before performing a 301 redirect
to the supplied URL.

It's even optional to bother doing any logging - you could always pull
this information from the main server logs.
If you do it with events on the page, it needs to have scripting
running on the clients and it also needs more changes made to each
page of content.
Jul 24 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.