DotNetNuke, ASP.NET, Web Development Blog

Setting up SmarterStats against a multi-portal DotNetNuke installation

Log Based Analytics provide a new perspective

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.

  1. In IIS 7, click on the server or the particular site you want to change
  2. Click on the Logging icon (under the IIS section).
  3. In the Log File section, click the Select Fields... button
  4. 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.

  1. As an admin for the Stats site, goto the Settings and then select Site Importing
  2. Select the Import Filtering tab
  3. Click the Add Inclusion or Exclusion button
  4. For Type, Select Include a Host Header
  5. For Host Header, enter your site's address, i.e.

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,

  1. Go into the Stats site's "Settings" area and click on Site Importing
  2. Click on the Dynamic Pages tab
  3. Click the Add Dynamic Pages button
  4. For Match Type select "Contains",
  5. For page, type default.aspx
  6. For Query String Variables, enter tabid.
  7. Hit the Save button

Now you need to setup Page Aliases

  1. Under Site Settings, click on Page Aliases
  2. Click on the New button
  3. For the Page, use this format, /default.aspx?tabid=219
  4. For Alias, you can type whatever you like (i.e. "Home" or "/default.aspx"). This is what will display in the page reports
  5. Repeat steps 2-4 for each page.


Paul Says:
5/20/2011 2:42:56 PM
David we need a little consulting utilizing smarterstats in multitennent environment to provide some reports back. Would you be interested....
Keston Says:
11/24/2011 5:40:11 AM
isn't there a better way to view friendly url's? With a 500+ page website the Alias solution isn't do-able...
Rob Says:
3/26/2011 2:59:13 AM
Hi, thanks for posting this. I've got it all sorted according to the info, but how exactly do I view stats for different sites in the same DNN instance? Can I add host headers for all of the different domains at step 5 or can I only have a single domain? The stats currently look the same as they did before - no domains are visible and the results are for everything.
Salem Says:
11/11/2011 12:47:01 AM
I really like smartertools especially for my donetnuke website. Have installed it correctly but till have a big issue with it. Mainly that the page views are not viewing properly as the visitors are higher, which is not logical. This issue occurs on a dotnetnuke websites only due to page rendering issues. The main issue to manually add Page Aliases for each page is quite a job especially if one has many pages and is continually updated and new pages added. Is there a way to add Page Alias on the fly ? i.e. without manually adding any page alias Kindly advise.
David O'Leary Says:
3/26/2011 10:03:03 AM
Rob, you need to add a stats site for each portal that you want to track and then follow the instructions for each site. So, if you have 5 portals that you want to track, you'll set up a stats site for each portal and set it up to Include the Host Head for each separate portal.
David O'Leary Says:
10/31/2012 4:46:05 PM
If this is a feature you need, it's probably wise to re-enforce the need for this on this thread:
David O'Leary Says:
10/31/2012 4:24:31 PM
I've submitted feature requests for improvements to SmarterTools. Also take a look at this topic for options for making DNN/IIS write the friendly URL to the Log.
Leave a Comment
Email: (not displayed)

Enter the code shown above:

Return to previous page