Hello,
i need help regarding WEB PAGE hits, view and visit. i'm currently doing a project that needs to calculate the home page Hits perday, view perday and visit perday. i'm very blur whats the different between hits, view and visit. Can someone help me? explain to me!
When we do programming in php, how......
1) how could we programme it to count the HITS of the website?
2) how could we programme it to count the VIEW of the website?
3) how could we programme it to count the VISIT of the website?
what kind of function that require to use? whats the fomula. Can someone please code an example for me!
Thanks in advance!
joel
Hits, View and Visit.
Moderator: General Moderators
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
Google is your friend...
Found this site explaining the difference between hits, views and visits.
As for coding something that can do this, it might be a bit unreliable, but there are web site stat apps out there that you could learn from. You would essentially need to use cookies, possibly IP's and a database to monitor who is coming to your site, from where they are coming and how often (also keeping track of unique views in addition to total traffic).
Found this site explaining the difference between hits, views and visits.
As for coding something that can do this, it might be a bit unreliable, but there are web site stat apps out there that you could learn from. You would essentially need to use cookies, possibly IP's and a database to monitor who is coming to your site, from where they are coming and how often (also keeping track of unique views in addition to total traffic).
Hrmm, a toughy.
Either way, you're not going to get truely accurate data. If you use cookies... some people disable them. If you go by IP, some people have dynamic IPs, use a dynamic web proxy, or even the AOL browser.
Some coding examples...
Cookies:
IPs
Perhaps you could combine them. You're also going to need a backend database to do the storing and come up with any useful data presentation.
Either way, you're not going to get truely accurate data. If you use cookies... some people disable them. If you go by IP, some people have dynamic IPs, use a dynamic web proxy, or even the AOL browser.
Some coding examples...
Cookies:
Code: Select all
if(isset($_COOKIE['beenHere'])){
// user has been here before
} else {
// new user
setcookie("beenHere",1,time()+60*60); // one hour cookie
}Code: Select all
$ip = $_SERVER['REMOTE_ADDR']; // most genericly
//query for ip in a database
if($foundip){
//returning user
} else {
//new user
}Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.