Step-by-step: From notes to working screen. The first draft of the new dashboard — the first report shown when viewing a site’s stats in W3Counter 4.
I start out with a couple notes — what information do I want in the screen, and an initial idea for how it should be presented. The dashboard is the first thing you’ll see after logging in to a copy of W3Counter tracking one website. It’s your overview of what’s going on today — how many visitors, how many are new, where they’re coming from, and what they’re doing. My initial idea is to have a chart area above a tabular area like the Visitors by Date report I’ve shown before. I’ll split it in half and have a pie chart for the new versus returning visitors, and another for the sources of those visits. Then, in tabular form, a list of the top pages viewed today — for a blog like this, that’d be the top posts people are reading.
I add the action to my controller, create a blank template for the page, and edit the application configuration files to add the new page.
The dashboard will have some fundamental differences between the rest of the reports in W3Counter. The date range options are different, there’s no paging, there are no modes to switch between, it won’t be exportable to CSV or XML format since everything it shows is available in detail elsewhere, and it will have two charts. That means I need to tell Symfony to use a different layout to decorate the template with than the rest of the pages, a simple change in the view configuration. I copy the date range template fragment and make a version specific to the dashboard and its three options — today, last 7 days and last 30 days.
With the new layout in place, I edit the template for the dashboard and add the area for the charts to appear, and the header for a data table that will list the most popular pages. These are all pieces I’ve created already for other pages, so it’s just a matter of including template fragments which are already encapsulated for just that purpose.
Next, I get the popular pages list up. I hadn’t created that report yet, but doing so takes no time at all. All I have to do is add a method to the database layer that pulls out that information. The rest of the work was done when I created the first few reports and refactored the common portions into reusable methods and template fragments. There’s no fundamental difference between a popular pages report and a top referrers report except the title of the page and the data in each row.
With that done, I can reuse the method I just wrote for the Popular Pages report to add the 10 most popular for the day, week or month to the dashboard.
Now to the two charts. I still haven’t made a decision on what to do about generating pie charts, but I’m leaning towards buying a license for amCharts, so I used that. I dropped their SWF and JavaScript files into my project and adjust the settings to get the desired look. I’ve broken out the sources into searches, direct visits from type-ins or bookmarks, and other sources.
I initially do the same for another chart on the left side showing new versus returning visitors. But it doesn’t look quite right. It’s not obvious how many visitors the site’s actually received that day, and even with mousing over the chart, nobody would take the time to add the two sections to figure that out. I also wanted to get across the number of page views which doesn’t fit well on the same chart.
Bars didn’t look right either because of the scale — some sites receive very large numbers of page views from each visitor. Instead, I decided to make the left hand side a text display of the relevant information. I use large, bold text to make it clear and the focal point of the page.
Finally, a few finishing touches: link the two headers to the reports with more detail, and add a link to the full Popular Pages report.
I’m sure I’ll revisit this screen several times before it’s truly ready, but I’m satisfied with it enough now to move on to the next set of reports. It’s time to start collecting data to build some of the all-new features — outbound click tracking and analysis.












Gersitz
January 15th, 2007
Thanks for the invite, put it on one of my new sites. I am glad to see you working on 4.0 because I think the current version is a little confusing. If you need a tester for this version let me know. Hook me up with an email.. I got AIM and MSN… No Prob.
Dan
January 16th, 2007
Thanks for the offer - I’ll definitely send you an e-mail when it’s ready for testing.
Carlos
January 26th, 2007
Perhaps I may have missed the answer elsewhere, but what will the price be for the down loadable version of this script?
Dan
January 26th, 2007
I won’t be setting a price until it’s actually available for sale.
Johnny Boursiquot
March 9th, 2007
Hey Dan, I’m wondering if you’re aware of the current down time and performance issues plaguing w3counter.com. I am one of your paying customers and have tried getting in touch with you via the email provided on w3coutner.com but have not received any response for nearly a week. I’m sorry to be using this medium for communication but I’m left with no choice. I like your service but am not sure if I’m going to wait until it becomes a production-ready offering. Perhaps the problems are with your host, perhaps not. In either case, a reply to my first correspondence (or this one) would be greatly appreciated.
Dan
March 9th, 2007
Johnny,
Yes, I’m aware there are still performance problems with W3Counter. I mentioned them in one of my posts yesterday. I closed the service to new free accounts at the end of 2006 to prevent load from climbing any higher, but occasionally the batch processes still kill response times.
Specifically to you, I can’t find your mail. I searched both your name and the e-mail you used on your comment here, in both my inbox and junk folder. It’s possible the mail server dropped messages when W3Counter was under high load (I’ve had to restart it a few times in the past). Please mail again, and feel free to poke me out in the public here if I don’t get that either. The forums are available as well.
- Dan
Johnny Boursiquot
March 15th, 2007
Thanks for the response Dan. Good to hear you’ve shut off new free accounts. I’ll try sending you another email momentarily. Let me know if you do not receive it. Thanks much.
Elmer Thomas
May 21st, 2007
Thank you for the step-by-step. I greatly appreciate these types of posts, they are highly educational.
We did a similar thing while launching our product at our blog..
A couple questions:
1. Who do you use for your current host, and are you happy? (we use layeredtech (for production), mediatemple (for experimental use) and dreamhost (for the cheap space and bandwidth))
)
2. Is your blog linked up to http://www.symfony-project.org? These types of posts would be welcome there (at least by me