I am trying to filter out my own aka internal traffic as a new View in Google Analytics.I was able to filter out my own traffic by excluding my IPv6 address, but not by excluding by public IPv4 address or block. I can see a successful and unsuccessful filter by watching the real-time reporting on content (urls).How does Google Analytics go about registering the IP address of visitors, exactly? Does it prioritize IPv6 over IPv4, or, does it take both?Thanks
Google Analytics Exclusion on IPv4 and IPv6
google analytics;ip address;ipv6
Scenario 1: IPv4 onlySimple.Scenario 2: IPv6 onlySimple.Scenario 3: IPv4 + IPv6 dual stack client AND IPv4 serverClient will fetch resources from server using IPv4.Client will hit Google Analytics using IPv6.IPv6 Filtering ConclusionGoogle Analytics will always abbreviate/shorthand the IPv6 address, so the corresponding filter must also target the abbreviate/shorthand expression of an IPv6 address or block. Note: this is not an official notice, it's just a conclusion based on experimentally trying different representations of an IPv6 exclude filter.The reason my initial attempts at writing a filter failed was because my filter regex was not fully in abbreviate/shorthand form.When dual-stack is a possibility, filter for both IPv4 and IPv6 blocks.Sample solutionI just had an experience where I had to figure out how to filter out an IPv6 block, excluding a /56 range.  The solution was in fact perfectly straightforward string matching regex.Solution -- ^1234:abcd:5:6..:.*$A little more clear for human eyes -- ^1234[:]abcd[:]5[:]6..[:].*$To figure that regex out, I just used a calculator like so -- https://www.ultratools.com/tools/ipv6CIDRToRangeResult?ipAddress=1234%3Aabcd%3A5%3A600%3A%3A%2F56Note the two period . symbols after the 6, used to cover the 00-ff range; followed by a wildcard to match everything else.