Browser language reporting: Let me see the different language codes · Issue #6097 · matomo-org/matomo · GitHub
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Browser language reporting: Let me see the different language codes #6097

Closed
matsbla opened this issue Aug 31, 2014 · 16 comments
Closed

Browser language reporting: Let me see the different language codes #6097

matsbla opened this issue Aug 31, 2014 · 16 comments
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. Help wanted Beginner friendly issues or issues where we'd highly appreciate community's help and involvement.

Comments

@matsbla
Copy link

matsbla commented Aug 31, 2014

Would be great to get a new widget where visitor languages are specified with local versions of languages, and to see the specific browser language codes used. See image:
widget

Think about it as the "Browser version" widget. We have one widget for "Visitor Browser" and another one for specific versions used. So then we could also have a widget that list different language versions used. Would be great to easily see this information with language code to be able to build better multilingual improvements for the visitors! :)

@mattab mattab added this to the Short term milestone Sep 2, 2014
@mattab
Copy link
Member

mattab commented Sep 2, 2014

Thank you for the suggestion! This report is possible to generated since we store the full list of Accepted language.

Maybe we could process this report by giving each language in the list a hit. eg. when accept-language is en,fr,es-ar,es-es we would credit each language a hit or otherwise credit as a ratio.

@matsbla
Copy link
Author

matsbla commented Sep 2, 2014

Are you not planning to stop store full Accept language string? #5365

Personally I'm most interested in the first language, because I want to make a mapping system to help redirect visitors to the correct website language, so would appreciate to be able to sort out the most frequent first priority for visitors... When this can be segmented to each country later it can give a lot of data to create good multilingual experiences.

But it could of course also be interesting to see what combinations that are normal inside Accept language, or what are most used languages for lower ratio, as long as it can be done with respect for visitors privacy

@mattab
Copy link
Member

mattab commented Sep 3, 2014

Maybe we could have a new cog icon option to append the code name in the labels, when setting has been clicked?

@matsbla
Copy link
Author

matsbla commented Sep 3, 2014

To see language codes could of course be optional. Also then people could change if they want to see statistics for full string or only first language code.

@matsbla
Copy link
Author

matsbla commented Sep 7, 2014

It could be integrated into the already existing browser language widget.

Then make it optional if you want to see language codes, and also show both how many had the language as first priority and how many had it in total (it could be optional to display both or only one of them).

Then add expendable buttons for each language that have more than one code version so you can see number of hits for each language code. At the "top-level" language (when the browser language is collapsed) you can then also see total number of hits for all language locals together.

browser-language

@quba
Copy link
Contributor

quba commented Sep 8, 2014

@matsbla: +1

@mattab
Copy link
Member

mattab commented Sep 8, 2014

I like the solution of the sub-table but unfortunately the sub-table feature is not yet so easy to re-use in Piwik framework. I created a separate issue for this: Make it easy for plugin developers to use sub-tables of any level in their data plugin #6167

Proposed tasks for this new Browser Language code

  • In the Browser Language report, add a new Cog icon option that lets user switch to view Browser Language Codes.
    • when this option is selected, it will be remembered on subsequent visit to the report page, and language codes will be displayed.
  • Archiver: aggregate not by language as currently, but archive will be broken down by language code (it will have more rows than currently).
  • Add new API UserSettings.getLanguageCode to return metrics for all Language codes.
    • the label would be eg French - France, French - Canada, French - Belgium.
    • language code is stored in a metadata column
    • when applicable, add in a metadata the detected country flag icon url
  • Modify API UserSettings.getLanguage to load API UserSettings.getLanguageCode and apply a datatable filter GroupBy (see doc) to group by the language.
    • ie. one blob is used to generate two reports, and the language report is a grouped view of the other language code report.
  • Update tests

What do you think?

@quba
Copy link
Contributor

quba commented Sep 9, 2014

Works for me. Thanks.

@matsbla
Copy link
Author

matsbla commented Sep 9, 2014

Will it be possible to choose between to see only those who have a language as first priority and those who have the language code included in their Accept-language string at all?

For flag icon:

  • Make sure they are only included for languages that have country code locals. Don't make the big mistake of including country flags for languages in general. This can make the report very misleading, e.g. to add a Swedish flag to the Swedish language in general will hide away the fact that many people from Finland also speak Swedish. Etc.
  • Notice that some languages and countries share codes but have nothing to do with each other, e.g. Catalan language ca and the country Canada CA, Northern Sami language se and the country Sweden SE, The language Malay ms and the British overseas territory Montserrat MS etc. So ONLY include flag if the country code is explicitly set, meaning behind a slash after the language code. To be clear: se only means Northern Sami language (NO FLAG), while se-se means Northern Sami language as spoken in Sweden (flag can be included)

@mattab
Copy link
Member

mattab commented Sep 10, 2014

Will it be possible to choose between to see only those who have a language as first priority and those who have the language code included in their Accept-language string at all?

to be compliant with #5365 we will store only one language in the database, ie. the first language of the list. So each visit will have only one language. Note that another plugin could easily be written to store the full accept language list and then create this new report detecting all languages from the string.

I guess the easiest solution therefore is simply to do the following:

Default view (current)

Language Visits
Polish 300
English 200
French 100

Click on footer link View Language codes will load the alternative report:

Language code Visits
Polish - pl 300
English - New Zealand - en-nz 200
French - France - fr-fr 100
French - Switzerland - fr-ch 80
English - Philippines - en-ph 70
  • Piwik already has all country names translations so we can write full name + append the code
  • If we want to display the flag, we could display it at the start of the row, then no need to write the country name in the label. Not sure maybe it would look better.

@matsbla
Copy link
Author

matsbla commented Sep 10, 2014

For myself I would prefer to have country name only
Maybe also make the flag optional?

I think it is good to have name in addition to flag. Flag can maybe help to visually understand what country it is, but it is not very informative in case you don't know the flag that is displayed, so I think it should at least be a written name in addition to the flag.

@mattab
Copy link
Member

mattab commented Sep 10, 2014

good point! let's keep it simple and not even show the flag, only show text for first version.

@gaumondp
Copy link

No flag is the way to go.

Those half UK/USA flags are just the tip of the iceberg. And don't let me
start with Canada CA-FR and CA-EN... ;)

2014-09-10 8:45 GMT-04:00 Matthieu Aubry notifications@github.com:

good point! let's keep it simple and not even show the flag, only show
text for first version.


Reply to this email directly or view it on GitHub
#6097 (comment).

@mattab mattab closed this as completed in 6544dff Sep 23, 2014
mattab pushed a commit that referenced this issue Sep 23, 2014
Implementation of new Browser Reports by Language and Language code fixes #6097
@matsbla
Copy link
Author

matsbla commented Oct 7, 2014

I now upgraded to 2.7.0, and now I can get the language codes, it works very good!

One question: To me it now seem like there are very few that have language locals, I actually just got some few that use "en-us" out of several thousands. From other statistics I've seen this seem strange. my impression is that many uses language locals. Is this because Piwik will start to register language locals only first now after this upgrading? Or did in fact all the previous visitors not use language locals?

@mattab
Copy link
Member

mattab commented Oct 7, 2014

it only works for new data after the upgrade was done

@matsbla
Copy link
Author

matsbla commented Oct 7, 2014

Cool, thanks for clearing that up. Anyway, I think this is a really great improvement!

@innocraft-automation innocraft-automation removed this from the Backlog (Help wanted) milestone Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. Help wanted Beginner friendly issues or issues where we'd highly appreciate community's help and involvement.
Projects
None yet
Development

No branches or pull requests

5 participants