Actually, why are you doing this at all? Server logs were invented for a reason :)
Main Topics
Browse All TopicsHello,
i would like to know are there any possibilities or methods to follow client location.href during visit on my site. I have made a function which writes document.location.href to txt file using xmlhttprequest and php.
That function is called by setInterval and it works fine. But i have thousands of generated pages and i don't want to import .js file to each of them. Is there any solution that js can read client locations while he stays at website but that js to be included only at one page (index.html).
Can i run that function on "global level" until the client left my site.
Thanks a lot
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
i know i can include the script but it isnt what i was looking for :(
i'm doing this because i'd like to watch where do my visitors usually go after current page ...
well, i guessed it isn't before i asked is it impossible, but i tried to consult professionals in this area ...
so, final answer is "no way" :/, right ?
Business Accounts
Answer for Membership
by: cwolvesPosted on 2008-05-09 at 11:19:38ID: 21535282
No, if you want to run js on every page it needs to be included in every page. The easiest way is to use a server-side include and rename your pages to .shtml or .php or whatever your server supports:
"-->
<!--#include file="/someHeaderFile.html
The advantage to this over just including a .js file is that you can put the entire header of your site in one location and change it across the site as a whole.
Your other option is frames :-/