When we find a website with a domain with and without www, to improve SEO On Page and that Google does not consider duplicate content, before we could choose the preferred domain with Google Search Console. But since the 2018 update, this option no longer exists. Now the correct thing to do is to do a 301 redirect and use canonical rel.

The problem is that despite having made these corrections that guarantee the SEO of our site, we suffer a decrease in the analysis capacity in Google Analytics through the “Host name” dimension, since both domains will be considered separately.

In fact, in the Analytics Notifications we will get a notice of Redundant Host Names, with the clarification that the property www.yourdomain.com receives data from redundant host names.

Actually, if not, we would not realize this problem. Since, by default, in Google Analytics, in the Behavior Reports / Content / Page, what is displayed is the “URI” dimension (part of the URL that is immediately after the domain or “Host name”):

https: // www.yourdomain.com/URI
https://yourdomain.com/URI

In this way, the page views of both URLs are added as both URIs are common.

 

Filters for tracking Subdomains and Multidomain in the same Google Analytics property

The point is that when we do subdomain tracking or multidomain tracking, it is not enough for us to see the contents broken down by URI, but we want to see the full URL (with host name). Otherwise, the data will be inconsistent (eg visits to pages with identical URIs, such as index, contact, etc., despite being in different domains will be added). To achieve this, we can use the Google Analytics Filter to see the full URL:

filtros google analytics seguimiento multidominio

  1. In Field A -> Extract A ($ A1) we capture the host’s man, and in Field B -> Extract B ($ B1) we capture the value of the URI
  2. Send results to -> Constructor: URI >> $ A1 $ B1.

So we join the two parts of the URL and show it in the URI in the reports. That although this is not semantically correct, in practice, the reports will be.

With this filter we overwrite, in all reports where it is displayed, the URI by the complete URL (and there is no going back). It is advisable to test it first in a test view, and review it in the real-time reports. To ensure that we get the expected result.

This is when the importance of the “Hostname” dimension is really demonstrated. If the domain is not correctly redirected with and without www from the server, we will find that these two URLs are shown in different lines, which should be a single one, which will make the analysis difficult.

To avoid this error, unify the hostname with and without www, and get Google Analytics to add the data of the two, we will apply (first and before the previous one) the Filter to unify hostname with and without www:

filtros google analytics seguimiento multidominio

  1. In Field A -> Extract A ($ A1) ($ A2) we capture the host’s man, but dividing it into two parts:
    1. $ A1 -> ^ (www.)? -> We capture the www and the point (in case they are in the domain)
    2. $ A2 -> (. *) -> We capture the rest of the domain name
  2. Send results to -> Constructor: Hostname >> $ A2.

In this way, we are left with only the second part of the domain name, which comes after “www”. With what we do not care if it has www or not.

 

Special attention to the order of the filters. The second (Remove www) must come before the other (full URL), as they are applied in the order that we establish. If not, it would not make sense:

filtros google analytics seguimiento multidominio

Francesc es el responsable de Content Marketing de Sinapsis. Con más de diez años de dedicación al copywriting ha acumulado una gran experiencia en diversos temas aunque su mayor pasión sigue siendo el marketing online. Friky de corazón, ha encontrado en el SEO una nueva forma de seguir "jugando".