I have several controller actions in my MVC3 site that use an ID in the URL, like so:
/mobile/businessprofile/100000
/mobile/setreminders/100000
/mobile/somethingelse/100000
I want to tell Google to ignore the ID part, but the Google Analytics filter system is really confusing and there’s no way to test your filter ahead of time. How might I go about this?
Method 1: do it on-page with javascript
You can do it in your page code by specifying a value in your _trackPageview push.
Example:
.
Method 2: do it with a filter
I assume based on your post you know how to actually go in and create a filter, you just don’t know what to use as values…
Filter Name: whatever you wanna call it
Filter Type: Custom filter > Search and Replace
Filter Field: Request URI
Search String: /[0-9]+$
Replace String: /
Case Sensitive: No (but it doesn’t matter which you choose)