IP Address Regular Expressions Generator for Google Analytics

  • report
    Disclaimer
    Click for Disclaimer
    This Custom Built Tool is over a year old (first published about 5 years ago). As such, please keep in mind that some of the information may no longer be accurate, best practice, or a reflection of how I would approach the same thing today.
  • infoFull Custom Built Tool Details
    info_outlineClick for Full Custom Built Tool Details
    Date Posted:
    Mar. 31, 2019
    Last Updated:
    Mar. 31, 2019
  • classTags
    classClick for Tags

I threw together this tool (took about 15 minutes to make) for a related post about filtering traffic by IP address in Google Analytics views. Excluding multiple IP addresses at the same time with a single filter in GA is only possible by using a custom IP address filter pattern, which uses regular expression pattern matching. This tool is for those that want to quickly generate a regex pattern to use based on a list of IP addresses.

Simply paste your list of addresses into the left box, and than copy the generated pattern from the right box and paste right into your new Google Analytics filter!

Click the “Demo” button to see an example. You can validate results using this tool.

 

The code behind this tool can be found here.

5 thoughts on “IP Address Regular Expressions Generator for Google Analytics”

  1. Richard says:

    Fantastic tool. Thanks for creating it!

    1. joshuatz says:

      Thanks for the compliment! Glad it provided value!

  2. Jon says:

    Super helpful – thanks!!!

  3. HARLEY says:

    I’m so sad it’s broken! I could’ve really used this!

    1. joshuatz says:

      Could you please clarify how the tool is broken for you? It seems to still be working for me.

Leave a Reply

Your email address will not be published.