Web Page Bounce Rate

  • wpas
  • Proficient
  • Proficient
  • User avatar
  • Posts: 327
  • Loc: Canada

Post 3+ Months Ago

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
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13504
  • Loc: Florida

Post 3+ Months Ago

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.
  • wpas
  • Proficient
  • Proficient
  • User avatar
  • Posts: 327
  • Loc: Canada

Post 3+ Months Ago

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
  • righteous_trespasser
  • Scuffle
  • Genius
  • User avatar
  • Posts: 6229
  • Loc: South-Africa

Post 3+ Months Ago

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.
  • SpooF
  • ٩๏̯͡๏۶
  • Bronze Member
  • User avatar
  • Posts: 3422
  • Loc: Richland, WA

Post 3+ Months Ago

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.
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13504
  • Loc: Florida

Post 3+ Months Ago

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. :)

Post Information

  • Total Posts in this topic: 6 posts
  • Users browsing this forum: No registered users and 51 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
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.