Results 1 to 2 of 2
Thread: Page visit Duration
Oct 1, 2009, 01:31 #1
Page visit Duration
I want to calculate time the visitor stay on each page visit ....Not using google analytics....Using ajax,PHP and jquery
Oct 1, 2009, 01:57 #2
- Join Date
- Oct 2002
- 2 Post(s)
- 0 Thread(s)
PHP can record the date/time the page was served to a specific IP address, by storing the data in a database table.
Then there are two options to record the date/time that page was left ...
2. In each PHP page check the HTTP_REFERER header; if it's value is from your domain then use that to record the date/time of the previous page - this would only work whilst navigating within your site; once the user leaves your site then the last-visited page would never have a "left" date/time record.
Option 1 is neater but not guaranteed to work. Option 2 will almost always work except for when the user leaves your site.
I'm sure there may be other options - I'll leave that for others to propose.Ian Anderson