Group by language in Google Analytics

I would like to see the data in the Demographic -> Language grid , grouped by ISO 3316, with no difference between the national variant (optional) of the national ISO639 country code.

For example, instead of seeing:

| Language | Visits |
|----------|--------|
| it       | 56,027 |
| it-it    | 35,130 |
| en-us    | 5,878  |
| en       | 1,211  |
| es       | 897    |
| es-es    | 576    |
| ...      | ...    |

      

I would like to see something like this:

| Language | Visits |
|----------|--------|
| it       | 91,157 |
| en       | 7,089  |
| es       | 1473   |
|----------|--------|

      

Is it possible?

+3


source to share


2 answers


You can make an advanced filter at the profile level that will search and replace the language input field and only store the first 2 letters.



+1


source


If you want to keep the original language variations in your reports, you need to define your own dimension and use the tracking code (or Google Tag Manager) to populate it from the browser language:

// this will extract 'it' from 'it-IT' or 'it-CH'
var primaryLanguage = navigator.language.match(/[^-]+/)[0];

ga('set', 'dimension1', primaryLanguage);

      



https://developers.google.com/analytics/devguides/collection/analyticsjs/custom-dims-mets

HTTP uses the IEFT Language Tag , so the main language can be provided in different standards. It can be 8 letters long. This is usually not the case, but if you need to take that into account, you need additional logic to group languages ​​from different standards.

0


source







All Articles