PHP script equivalent to Godaddy's AWstats inside cPanel

hey guys,

This is the first time I have viewed this stuff from GD. and, of course, it’s not useful whatsoever, and that’s to be expected. all hosters by from cPanel, and they in turn by from other companies and roll their products into the cPanel software and put icons on the homepage. Attached are two images of traffic stats on one of my sites that I want to produce with PHP code. The other 2 images are small snippets of traffic report code that I’ve had written for a long time. this is very simple. Can anyone give me resources to help mirror the report from AWstats shows in the 2 images below? thanks.




Well, tracking is easy and hard at the same time. First, a visitor? Do you mean a visitor logged into your pages or just someone who goes to the page? This depends on how you want to handle tracking. For instance, if you use a login system, you don’t care where the IP is, so the valid user can use their device be it a desktop, phone, friends computer, etc.
Next, keeping track of visitor’s time on a page could be tricky if they leave the computer or it goes to sleep. There is a simple way around that. You can use a small JS script to resave the client’s cookie at a regular interval which would be a “still-active” flag to insure they are still there. Or capture every single thing they can do on a page. ( not practical! ) Here is a link to code that does the stay alive checking. Might help you create a tracking system. This one checks every 10 seconds and updates the database where you track their active time on the page. SO - Visitor Duration Tracking It could be altered to include more than one page and keep other info as needed. It uses an interest Ping system to check the local cookie often and update data on the server… Hope it helps


The only motivation here for me is to keep all the crap out as much as I can. I know full well there are bots running rampant all over for various purposes. from what I’ve seen in 10 years at this point, 50% are legit and 50% are criminal. no surprise there, obviously. I’ve even seen some come from universities across the world! LOL. makes you wonder what they’re doing doesn’t it? the next profit scheme? the next big thing of how to manipulate kids into buying useless education? =(

but, back on point…you said:

I have no interest in that. That would be something you have to pay for. If you want to know who is the most up-to-date folks doing it, it would be these guys:

a guy at a hilton hotel told me about them. they market their stuff in really low quality areas of the world. literally, it allows corporate execs to watch people BEHAVE inside the web app. very sad. real time monitoring. =(


I’m not sure I care about keeping them ““alive”” or not. ignorant users are everywhere and I can’t do anything about it. Thus, what I’m really trying to get at here are metrics that actually MEAN something. so, that would be these I believe:

their journey from page to page (navigation)
how long users stay on each page
how they GOT to any given page on my site (e.g. - the REFERRER in PHP)

these are the only 3 things I care about, because that gives me all the business sales knowledge I need. lets us remember that ignorant buyers lose interest in 3-5 seconds nowadays. they’re not smart. and although this site will be offering very sophisticate services, some of the services will be very simple and things that very panicky and indicisive people would want to buy. thanks.

got anything else for me?

Well, the “keeping alive” part every 10 seconds was so you can update the cookie and track that the person is still on the page. Once the page is sent to the client (browser), you can not track it with PHP. Therefore, using JS on the client’s page, it will refresh the saved value in the database time-wise so you know how long they are on that one page. And, the code is minimal.
Also, you can just place a small section in the header of your site. I mean, assuming you have the same header at the top of every page which is how most of us do it now. You could just save the datetime and name of the page in a log with the ip and REFERRER info. I did something like that once because a site was being hit by thousands of spams. Turned out to be two servers, one in Russia and one in China. I just banned their IP’s and it worked fine after that. But, with a logging section in the header, it would look the journey from page to page, when they switched pages, meaning how long they were on the previous page and how they got there. Sounds simple enough to do. I think I also added some code to remember the device they used, but, don’t remember how I did that. There’s code for that somewhere out there.
You can just list the log for one user/device/ip and sort from oldest date first and you should see how they transversed the site. Make sense?

The info you want is already being logged by the server. Have you thought about parsing the server logs?

I use godaddy’s crap services, and they are so huge that they literally make customers mad every day, all day long because their running massive automation to stop the criminals trying to hack their servers. makes good sense. they’re way too big. and no one I’ve ever talked to there has any brains whatsoever. that’s why I don’t call anymore. it’s not their job to answer questions about this stuff, nor do they know how. I’m not even sure I have access to the serv logs on a share env.

kind of. give me a bit of time to sort it out. I’m no expert here.

Nothing says you cant use something else.

like what Ben? all hosting companies are terrible. they are not supposed to be good. no one who works at those places have competence and I don’t expect them to. are you saying to manage my own server?

Yes, running your own server or VPS is the best option

well I realize that Ben, but that is overly expensive if you buy it from a hoster. furthermore, it’s un-necessary. But other than getting access to the config files on a VPS like PHP.INI and such, what other good would it do me?

You can get a VPS for 5 bucks a month. What it does for you is give you complete control and eliminates all your shared hosting problems.

yes I realize that Ben but I don’t think what you realize, unless you work with godaddy, is that GoDaddy is so big and so rich that they cause a serious amount of problems for many many people that don’t know crap about anything because the hackers are always coming up with new techniques to get inside those networks direct havoc or get money from criminals that are paying them either one.that’s exactly why GoDaddy sucks but all the other hosting companies are not any better because they all employ very unintelligent people. and there’s a good reason for that obviously because you don’t need any intelligence to click buttons and scan networks with software that’s just installed on your machine and you given instructions on what to do from the management.

But I will consider getting a VPS at some point based on your words but I’m pretty sure it costs more than $5 a month because I made that call a long time ago to this company. but at this time the business is not big enough and the site is not big enough to justify that type of server thanks for the answers.

It took me 2 seconds to find VPS for 5 bucks or less.

thanks. I will refer to your words later. when I get this set up. but I’m sure you realize that smaller hosters than Godaddy generally employ people that are not that smart. Like I said, they’re not supposed to be. their jobs are 90% automated. they are button clickers. =( That’s why Godaddy is the least risky to use. I have accounts with accuWeb and GD. not with a2, but I’ve talked to them. thanks ben. =)

Sponsor our Newsletter | Privacy Policy | Terms of Service