Monday, April 26, 2010

Customizing Fiddler for Omniture scripts

 

 

One of the best ways to investigate your Omniture implementation is to watch the actual traffic that is being sent by your site. To assist with this, Omniture provides a JavaScript debugger (search “Debugger” in the SiteCatalyst Knowledge Base). But sometimes, you need to break out the good ol’ packet sniffer to watch the actual traffic being sent.

The trouble with Fiddler is that it will watch all of your requests, making it difficult to isolate the Omniture requests that you’re looking for.

Fortunately, you can configure a custom filter in Fiddler, which will exclude non-Omniture calls. This makes is more convenient to use Fiddler to look at server requests sent to Omniture. Creating the filter is a little bit geeky, but very easy to do. Here’s how you do it:

1. Open Fiddler


2. From the Main Menu, select Rules > Customize Rules…

 

3. Add the following code to the class handlers. This adds the menu item, and turns it on by default.

public static RulesOption("&Omniture Only")
var m_OmnitureOnly: boolean = true;

4. Add the following code to the static function OnBeforeRequest. This is the logic for the filter. It tells Fiddler to only include requests that match the pattern 2o7.net. You can change the filter value by changing the value of var re.

if (m_OmnitureOnly){
  var re = /2o7.net/;
    if (!re.test(oSession.host)){ 
         }
}

5. Fiddler will now show you only Omniture requests, as long as the “Omniture Only” rule is selected in the Rules menu.

Once you have configured Fiddler to show you the Omniture server requests, be sure to check out the Debugger white paper in the SiteCatalyst knowledge base for more information on what the different parameters mean.

No comments:

Post a Comment