Search code examples
regexurlgoogle-analyticstld

Regex for analytics - network domain containing/ending with .ac.uk or .sch.uk


Im setting up a custom report in google analytics to only show results where the network domain ends with .ac.uk or .sch.uk

(So we can see what universities have been on the website).

I just need to know what the regular expression would be for this?

google analytics regex filter


Solution

  • You may use

    \.(ac|sch)\.uk$
    

    Details:

    • \. - a dot
    • (ac|sch) - either ac or sch
    • \. - a dot
    • uk - uk and
    • $ - end of string.