How do you exclude traffic from a certain directory (and everything under it) from an entire Google Analytics profile?
Example:
http://www.thesite.com – should be tracked
http://www.thesite.com/directory/ – should not be tracked, along with anything below it
After lots of experimenting I found a way to do this. I hope this can help someone else later.
Under Profile >> Filters there are predefined filters and custom filters. The predefined exclude would not work for me no matter how I wrote it, but I didn’t manage to get the custom filter to work.
I used:
Filter type: Custom filter – Exclude
Filter Field: Request URL
Filter Pattern: (^/directory/)
This works for both excludes, and to “include only”, i.e. to create a profile that ONLY tracks things going to http://www.thesite.com/directory/