Substring as custom dimension
I've been trying to make a substring of a preexisting dimension its own dimension and am running into some trouble. The url's of article pages on my site look like this
I'm trying to create a custom dimension that groups any two urls with the same article name together so that I can evaluate the performance of each article page and ignore the source. I've tried to create a custom dimension with the following formula:
CASE WHEN REGEXP_MATCH(Landing Page, '.*\?.*') THEN REGEXP_EXTRACT(Landing Page, '/^[^\?]*/') ELSE Landing Page END
I'm new to regular expressions, but I essentially want to identify urls with a '?' and take a substring of those urls that includes all characters before the '?'. This function returns an error. Any thoughts? I'm thinking it has something to do with the regular expressions. Thanks!