Welcome Guest, you are in: Namespace

This How-To explains Sueetie Analytics Page Rules and how they can help you enforce consistent page urls and titles in your Analytics Reports.

Data Integrity Insurance with Page Rules

Data Integrity is a big deal in Sueetie Analytics. To provide accurate site analytics reports we need to ensure we're capturing accurate data. We also want to eliminate redundancy in our analytic logging data. Page Rules gives us the ability to assign a single page url to multiple variations of the same url. Rules also provide a means to assign a more descriptive title to pages which have duplicate or generic titles.

What Bad Data Looks Like

Let's start by looking at some bad data, without any page rules applied. An easy example for understanding page rules the site login page as you see below. A Page Rule has three elements: Url Excerpt, Recorded Url and Page Title, which for the Login Page would be "/members/login.aspx," "/members/login.aspx" (removing any returnUrl query string), and "Login Page."

Image

Another example of applying a Page Rule would be the Forum Post Message Page. This is what is looks like in the Request Logs without any Page Rules applied. We don't need to record every unique Post Message Url, or even display the title of the post message. We are gathering that data in Sueetie Analytics elsewhere. So we're going to apply to Page Rule to Forum Post Messages Pages.

  • Url Excerpt: /yaf_postmessage.aspx
  • Recorded Url: /util/misc/yaf_postmessage.aspx
  • Page Title: Discussions - Post Message

"/util/misc/yaf_postmessage.aspx" is a dummy page, used for consistency and giving us the ability to add the page later. Using the actual /forum/yaf_postmessage.aspx without the required query string would generate an error. Applying this Page Rule to Forum Posts keeps our Request Logs smaller, report generation performance faster, and our analytics reports cleaner.

Image

Page Rules Page

Here is the Page Rules Page in Sueetie Analytics. The list of existing rules is at the top of the page, with the ability to edit or delete, followed by the Create Page Rule form at left and a Clear Page Log form at right to remove discovered redundant urls from the Request Log. At bottom are Request Log Pages for review.

Image

A Closer Look

Here's a closer look of the Page Rule list and Create Page Rule form.

Image

Using CONTAINS verses EQUALS

As we pointed out earlier, the default comparison type of the rawurl with the url excerpt is CONTAINS. Page Rules also supports EQUALS comparison. This would be used in the following example when specifying the home page title.

Image

The EQUALS comparison is important, otherwise any rawurl containing a "default.aspx" (a lot of them) would be logged as /default.aspx with the title of Home Page. Definitely not what we want.

Pre-processing Rules In Play

Currently there are a few hard-coded rules that affect how page Urls are logged. The current code is below for those interested. A helpful pre-processing point to remember is that any rawurl that ends with "/" gets a default.aspx appended to it for logging consistency. Also, any "/?" occurrence is replaced with "/default.aspx?"

     public static string DefaultAspxIt(string _url)
        {
            string _urlOut = _url;
            if (_url.EndsWith("/"))
                _urlOut = _url + "default.aspx";
            if (_url.Contains("/?"))
                _urlOut = _url.Replace("/?", "/default.aspx?");                
            if ((_url.Contains("wiki/default.aspx?page=", StringComparison.OrdinalIgnoreCase) ||
                _url.Contains("wiki/history.aspx?page=", StringComparison.OrdinalIgnoreCase) ||
                _url.Contains("wiki/edit.aspx?page=", StringComparison.OrdinalIgnoreCase) ||
                _url.Contains("wiki/diff.aspx?page=", StringComparison.OrdinalIgnoreCase)) && (_url.IndexOf("&") > 0))
                _urlOut = _url.Substring(0, _url.IndexOf("&")).ToLower();
            if (_url.Contains("aspx?hl=", StringComparison.OrdinalIgnoreCase))
                _urlOut = _url.Substring(0, _url.IndexOf("?")).ToLower();
            return _urlOut;
        }

Final Takeaway

A good way to look at Sueetie Analytics Page Rules is that they serve to eliminate redundant pages being stored because their query string varies. These pages are generally utility pages like search pages, or pages listing non-specific Sueetie Content (a list of Forum Topics as opposed to a single SueetieForumTopic Content Item.) Page Rules remove query strings that serve no value and cause unnecessary redundancy and dilute analytics results.

ScrewTurn Wiki version 3.0.4.560.

Copyright © 2008-2012 Sueetie LLC. All rights reserved.
Sueetie