I often find that knowing the host portion is much more useful than knowing the full URI of the referer, and trying to squeeze the full URI onto a widget can get cluttered real fast.
substring(substring(${app_event.referer},position(${app_event.referer},"//")+2,length(${app_event.referer})),0,position(substring(${app_event.referer},position(${app_event.referer},"//")+2,length(${app_event.referer})),"/")-1)
That custom field could be simplified by referencing other custom fields containing substrings of the URI, but the version above is fully self-contained.