We use Google Analytics extensively for tracking and analyzing website statistics. It does a great job of providing really useful information in a way that anyone can understand. Plus, its very easy to setup and has the power to let advanced users segment and drill down through the data to get even more detailed information. But, we've found it's a good idea to get another view of your visitors and traffic using a tool that provides information based on Log Analysis. Log based analytics let your see things that simply can't be tracked by script-based analyzers like Google Analytics.
As a big fan of SmarterMail, we decided to give SmarterStats a try. We've been using SmarterStats for awhile on several of our bigger sites but we also wanted to be able to use it on a few of our portals where we have multiple sites installed on a single instance of DotNetNuke. Before we could do this, we needed to do several things first to get this to work right...
If you have a DotNetNuke installation that only has a single portal or a portal along with child portals, skip to the section on Dynamic Pages with SmarterStats, you won't need to follow the Host Header sections.
Setting up IIS 7 to include Host Header info in the logs
You have to make sure the IIS is including the host header information in the logs it creates and then you have to setup SmarterStats to only analyze hits with that host header.
You can either do this for all sites by doing it at the server level or you can just do it for one particular site.
- In IIS 7, click on the server or the particular site you want to change
- Click on the Logging icon (under the IIS section).
- In the Log File section, click the Select Fields... button
- Check the box next to "Host (cs-host)" and click the OK button
Setting up SmarterStats to only show stats for one host header
In SmarterStats, you'll need to setup a separate Stats site for each website you want to track. Then, follow these steps for each stats site in order to only see the stats for that particular site.
- As an admin for the Stats site, goto the Settings and then select Site Importing
- Select the Import Filtering tab
- Click the Add Inclusion or Exclusion button
- For Type, Select Include a Host Header
- For Host Header, enter your site's address, i.e. www.mysite.com
Dynamic Pages with SmarterStats
At this point you'll probably notice that none of the reports are breaking out page views the way you would expect. This is because, DNN is serving most pages from /default.aspx. So, you need to help SmartStats parse out your pages by doing two things
First, you need to setup the dynamic page filter. To do this,
- Go into the Stats site's "Settings" area and click on Site Importing
- Click on the Dynamic Pages tab
- Click the Add Dynamic Pages button
- For Match Type select "Contains",
- For page, type default.aspx
- For Query String Variables, enter tabid.
- Hit the Save button
Now you need to setup Page Aliases
- Under Site Settings, click on Page Aliases
- Click on the New button
- For the Page, use this format, /default.aspx?tabid=219
- For Alias, you can type whatever you like (i.e. "Home" or "/default.aspx"). This is what will display in the page reports
- Repeat steps 2-4 for each page.