Click to See Complete Forum and Search --> : how to capture the url address that a user is going to after they leave your website
dsdsdsdsd
11-21-2006, 01:16 PM
hello;
my goal is to determine the amount of time a user spends on a webpage;
my approach is :
<?php
$gvs_ip = $_SERVER['REMOTE_ADDR'] ;
$gvi_seconds = time() ;
?>
<body onunload="document.getElementById('visit_time_form').submit()">
<form name="visit_time_form"
method="post"
action="http://www.blah.com/visit_time_submitter.php">
<input type="hidden" name="ip" <? print "value='$gvs_ip'" ?> >
<input type="hidden" name="start" <? print "value='$gvi_seconds'" ?> >
</form>
</body>
my problem is that this is preventing the user from leaving; they get stuck on my php page;
I would like to capture the url that the user is wanting to go and then have my php page re-direct the user there;
any thoughts?
thanks
dsdsdsdsd
SandDancer
11-21-2006, 02:23 PM
I'd be interested to find this out too. I want to do analysis of time spent, pages visited etc. and I don't want to install 3rd party software to accomplish it.
Maybe this question would be better asked in the PHP section though
dsdsdsdsd
11-21-2006, 03:23 PM
Sanddancer, I am hoping that there is some native HTML object that captures the value; I checked the location object, the document, object, and the window object - but nothing;
Demon
11-21-2006, 03:23 PM
Can non of this be found out in the logs?
Hilly_Daz
11-22-2006, 04:54 AM
You need to create a hyperlink to any search engine as hyperinks are the only way to allow people to leave your website. Call it Exit site. What is the url or your website?
sincilite
11-22-2006, 08:24 AM
Hilly_Daz,
Moving from page is regarded as an exit so even if you are moving from page to page within the same site.
hello;
my goal is to determine the amount of time a user spends on a webpage;
my approach is :
<?php
$gvs_ip = $_SERVER['REMOTE_ADDR'] ;
$gvi_seconds = time() ;
?>
<body onunload="document.getElementById('visit_time_form').submit()">
<form name="visit_time_form"
method="post"
action="http://www.blah.com/visit_time_submitter.php">
<input type="hidden" name="ip" <? print "value='$gvs_ip'" ?> >
<input type="hidden" name="start" <? print "value='$gvi_seconds'" ?> >
</form>
</body>
my problem is that this is preventing the user from leaving; they get stuck on my php page;
I would like to capture the url that the user is wanting to go and then have my php page re-direct the user there;
any thoughts?
thanks
dsdsdsdsd
Most web logs, as Demon pointed out, will determine the Visitors time within the website.
One that I'm using is Google Analytics (http://www.google.com/analytics/). It's a simple script placed you can place only on the pages you want to monitor. You can get tons of information from this little bitty script.
dsdsdsdsd
11-22-2006, 10:35 AM
I found my weblogs through my webhost's webserver interface, VDeck they call it; as best as I could tell it did not include the length of time spent on the page, but only the time when the page was called; furthermore it included calls to my css page, and my external .js page, as well as other erronious info;
Hilly Daz, users are also able to leave a website by simply shutting down the browser, or by using the address bar; though I see your point I believe in that as long as a user is within a site and using links in the site to navigate, then you can capture their target location and stop by a php script on the way to log their time out;
KDLA, I will take a look at the google app; I prefer to stay away from third party apps though; but I will look at it;
thanks
dsdsdsdsd
http://www.goodflagbetsy.com
SandDancer
11-23-2006, 01:13 PM
Same as me too I prefer to stay away from 3rd part links and tools on my sites. I'm on a linux box and one thing I'm doing at the moment is playing around with the access.log file to see if I can do the analysis sort of 'offline' if you know what I mean.
gregleo
11-23-2006, 02:08 PM
From my experience, weblogs usually record the date and time of these things.
kiwibrit
11-24-2006, 06:48 AM
Couldn't you do this with php and sessions?
dsdsdsdsd
11-24-2006, 01:25 PM
kiwibrit, thanks for responding; I do not know what you mean by 'sessions'; could you please explain;
thanks
dsdsdsdsd
kiwibrit
11-25-2006, 04:37 AM
Well, I don't have time to get stuck into your specific problem, but if you have access to php, sessions are a way of following user activity from one page to another. Maybe they could be useful to you for what you want to do. More here (http://www.tizag.com/phpT/phpsessions.php). If you want to follow up on that , I suggest you go to the php section of this forum (http://www.webdeveloper.com/forum/forumdisplay.php?f=16).
dsdsdsdsd
11-25-2006, 12:39 PM
fair enough;
dsdsdsdsd