Google Analytics and ASP.NET MVC - filtering the ID out of the URL -


i have several controller actions in mvc3 site use id in url, so:

/mobile/businessprofile/100000 /mobile/setreminders/100000 /mobile/somethingelse/100000 

i want tell google ignore id part, google analytics filter system confusing , there's no way test filter ahead of time. how might go this?

method 1: on-page javascript

you can in page code specifying value in _trackpageview push.

example:

_gaq.push(['_trackpageview',window.location.pathname.replace(/\d+$/,'')]); 

.

method 2: filter

i assume based on post know how go in , create filter, don't know use values...

filter name: whatever wanna call it

filter type: custom filter > search , replace

filter field: request uri

search string: /[0-9]+$

replace string: /

case sensitive: no (but doesn't matter choose)


Comments