Issue appending domain name to URI in Google Analytics

84 views Asked by At

Our Google Analytics environment was setup with an append hostname to URI filter which would append as follow:

/cincinnatibell.com/ and example would be /cincinnatibell.com/discover

An IT developer overwrote our filter and caused an issue with the appending. All of the pageview URIs were reset to /discover, /plans-and-pricing, etc. Instead of including the domain name

I am trying to restore it. Right now, I followed these instructions to append hostname to URI (https://www.bounteous.com/insights/2015/12/10/basic-google-analytics-filters-every-site/) however, I am now getting /www.cincinnatibell.com/discover

How do I remove the www. from the URI? I tried a Search and Replace to remove the www. from the hostname but that only changed the hostname, it didn't fix it for the URI as well

July Data the way we want it

August Data messed up

August Data with append hostname to URI, better but we want it the way July looked

1

There are 1 answers

0
bogdan_b On

The fix should be fairly easy. You just need to split the hostname into 2 parts, the www. and the cincinnatibell.com and then only extract the second piece.

Field A - Extract A: Hostname; ^(www\.)?(.*)
Field B - Extract B: {leave blank}; {leave blank}
Output to - Constructor: Hostname; $A2

The ? checks if there is either 0 or 1 instances of www., so if you have different versions of the hostname (one with the www, one without), this will match either.

The $A2 extracts the second part of the hostname, anything after the www. (whether it's there or not).

You then use this extract to prepend to your Request URI.