Web Page Bounce Rate

  • wpas
  • Graduate
  • Graduate
  • User avatar
  • Joined: Jul 12, 2010
  • Posts: 214
  • Loc: Canada
  • Status: Offline

Post November 9th, 2010, 11:59 pm

Hi All

I a wondering if there is a way to measure the bounce rate (time spent on a web page before exit) for a web page using a PHP script.

I know there is Google Analytics and all that, but what I am looking for is something that will give me an idea of the bounce rate.

I can detect the instant a visitor accesses my web page.

Any thoughts would be appreciated

Thanks
http://www.schembrionics.com
The Ultimate Solutions Center
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post November 9th, 2010, 11:59 pm

  • joebert
  • Sledgehammer
  • Genius
  • No Avatar
  • Joined: Feb 10, 2004
  • Posts: 13455
  • Loc: Florida
  • Status: Offline

Post November 10th, 2010, 12:26 am

With PHP, no. The only thing you can do with PHP in this scenario is log anything coming from the browser to a file/database.

Now, if you want to mess with say, Apache modules and C programming, you might be able to play around with using abnormally long Keep-Alive requests and logging when a client disconnects. This probably wouldn't be feasible on a large scale, but it should be fairly accurate.

I'm not sure where to suggest starting on something like that though. I'd just stick with Google Analytics and be done with it.
Strong with this one, the sudo is.
  • wpas
  • Graduate
  • Graduate
  • User avatar
  • Joined: Jul 12, 2010
  • Posts: 214
  • Loc: Canada
  • Status: Offline

Post November 10th, 2010, 12:34 am

thanks for the reply

How about something like a timer using php
Starts when visitor lands on a page.
Stops when exits, no matter how he exists
http://www.schembrionics.com
The Ultimate Solutions Center
  • righteous_trespasser
  • Scuffle
  • Genius
  • User avatar
  • Joined: Mar 12, 2007
  • Posts: 6228
  • Loc: South-Africa
  • Status: Offline

Post November 10th, 2010, 4:16 am

From what I recall, PHP has no function to check when a visitor closes a page. Maybe some jQuery with an ajax call to store the time could work.
Let's leave all our *plum* where it is and go live in the jungle ...
  • SpooF
  • ٩๏̯͡๏۶
  • Bronze Member
  • User avatar
  • Joined: May 22, 2004
  • Posts: 3415
  • Loc: Richland, WA
  • Status: Offline

Post November 10th, 2010, 7:57 am

The best you could probably do with PHP is to measure the time between page requests and check the referal. If the referrer is your own site then the time between pages would be the time spent on your site. This approch does not work for single visits or the last requested page.
#define NULL (::rand() % 2)
  • joebert
  • Sledgehammer
  • Genius
  • No Avatar
  • Joined: Feb 10, 2004
  • Posts: 13455
  • Loc: Florida
  • Status: Offline

Post November 10th, 2010, 9:13 am

Well, there's this where you could track the time by keeping visitors in an endless loading state. I just want to make it clear I think it's a bad idea though. :)
Strong with this one, the sudo is.

Post Information

  • Total Posts in this topic: 6 posts
  • Users browsing this forum: No registered users and 135 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.