I have a local business directory site. I'm trying to segment my incoming traffic by page-type such that I can find out what percentage of traffic is going to zip code pages exclusively and what percentage is going to city/state level pages. I basically want to filter by URL structure to find out what percentage of total traffic zip code pages account for. The reason for doing this is to find out if Google Tag Manager can help with this?

Here are the two URL paths:

2 Answers 2


You can do this with a "custom report". Here are the steps:

  1. Log into Google Analytics
  2. Click on "Customization" in the orange bar near the top
  3. Click on "+ New Custom Report" in the gray bar underneath
  4. Name the report "Zip Code Pages"
  5. Set the "Metric Group" to "Visits"
  6. Use "+ Add Filter" with "Content" -> "Landing Page"
  7. Change the filter match type drop down menu from "Exact" to "Regex"
  8. Enter the regular expression: [0-9]{5}\/$

Create a second custom report for "City/State pages" with the regular expression: [a-z]{2}\/[a-z0-9\-]+\/$

To view the reports, click on "Customization" and select the report that you wish to view.


Tag Manager won't help (with that, Tag Management is still a great idea). Filters and regular expressions will help.

You can go to the content report (which is now under "behavior"), click "advanced filter" and set the match type to regexp.


will give you the numbers for the numbers for pageview without zip codes (the tiny "roof" means "starts with", the dollar sign means "ends with", so this matches the exact address).

I think (haven't tested, but the principle is sound) that


will give you the pages with zip codes. The numbers in the square brackets are a character class (basically that means the numbers zero to nine), the asterisk (star) character means "any number of the preceding characters".

There is a handy cheat cheat for regular expressions in Google Analytics, so if the above doesn't quite work you can look it up and experiment a bit.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.