What's the best way to have RESTful URLs and track your pageviews with analytics?

What i wanted

I was going to use urls like /item/xxx

(view item) and /item/xxx/photo

(view full screen image of item) because I thought it looked better and more RESTful.


  • I realized that I would not be able to keep track of the common views of the elements because the urls would overlap with each other (i.e. you can see the common hits you had for all urls starting from /item/

    , but that would include the urls - photo addresses).

  • I wouldn't be able to track overall photo views because the url would have an id in front of the photo part (i.e., I can't look at all urls starting with /item/xxx/photo


Am I wrong? Can I find these numbers (I am using Google Analytics)? Or am I better off changing urls to /item/view/xxx

and /item/photo/xxx

? This is for an iPhone app, so the URLs are really arbitrary (I can set them to whatever I want and no one will see them except analytics).


source to share

1 answer

If you only want metrics for structured URLs /item/xxx

excluding /item/xxx/photo

ones, instead of just typing in the filter field, you can use the advanced filter option for 'Matching RegExp' . (Click on the text "advanced" next to the text entry field).

And use regex to exclude /item/xxx/photo

as well /item/xxx


  • Exclude page mapping RegExp: item/(.)*/photo$

  • And include a page containing: item/



All Articles