-2

I want to know how many user enter to my webpage directly and how many by search engines or other sites.

How i can do that?

3 Answers3

2

Your obvious choice would be Google Analytics, although not a "PHP" solution, it should give you all of the information you need.

It's widely supported across the internet and is pretty easy to use too!

Here's the "traffic sources" page:

enter image description here

Jamie Taylor
  • 4,709
  • 5
  • 44
  • 66
0

You can use Google analytics http://www.google.co.in/analytics/ You can monitor everything on your web page using google analytics

0

Do this:

$referer = $_SERVER['HTTP_REFERER']'

You can then store this in a database.

It will be blank if the end user:

  • The address is entered into the URL bar itself
  • Visited by bookmark
  • Switching of protocols (e.g. https to http)
  • Software installed that removes all referrer from requests

Google analytics:

How Does Google Analytics Collect Data?

The data that Google Analytics uses to provide all the information in your reports comes from these sources:

The HTTP request of the visitor Browser/system information First-party cookies : You can get these all from the $_SERVER global.

Patrick Geyer
  • 1,515
  • 13
  • 30
  • Not reliable because not all user-agents support it. – user2857863 Oct 08 '13 at 10:19
  • 1
    So you want to track referrals to your site, without using `$_SERVER['http_referer'];` or outside tools and you want it to work with all browsers. I feel you're going to be disappointed. – Jamie Taylor Oct 08 '13 at 10:49