Jaybe
Jaybe

Reputation: 329

How to merge www domains with non www domains in Google Analytics report

I’ve encounter an issue with google analytics, I’ve created a custom report, for my domain with these parameters:

metric : pageviews dimension: hostname filters: none

The results are the table below which is exactly what I want, except that GA dissociates hostnames with www and without www.

enter image description here

In my example, I want the first and the second rows should be together and the value should be 651. How can I do this in a custom report?

Upvotes: 4

Views: 2109

Answers (1)

nyuen
nyuen

Reputation: 8907

You can set up an Advanced Filter as such (depending on whether you want the www or not). Assuming the latter (ie. you want to remove the www):

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

So in field A, you look for the hostname and break it down into the "www." part, if it exists, and the "domain.com" part (for example), and then the filter returns "domain.com".

Upvotes: 3

Related Questions