Ignoring crawlers - How to

Is there any way to stop visits from specific User Agents being recorded? Yes there is.

The global configuration (Settings table) includes an IgnoreCrawlers setting (which defaults to true). If this is enabled, the profiler checks the HttpBrowserCapabilities class to see if the user agent is a crawler and in that case ignores it.

You can add your own crawler user agent definition by adding a .browser file in the App_Browsers folder.

See here for information on how to create a custom .browser file: http://msdn.microsoft.com/en-us/library/ms228122(v=vs.100).aspx

You should add <capability name="crawler" value="true"/> to mark the user agent as a crawler, and Spindoctor will ignore its requests.

Thanks to Phil Dye @ Etch UK for asking :)



Comments