My first question is what questions do we want to answer with analytics? Gathering ideas on what we want to find out would help us decide.
Here are my thoughts -
To understand how users are using the documentation
The following data is commonly gathered in order to understand how documentation is used :
what pages are most visited? (e.g. top 10/100)
how long do users spend on each page?
what paths users take through the documentation
With the above data we would be able to understand how the documentation is used, decide on what pages need to be updated frequently, what pages need to be tested with users, what pages can be removed/rationalised.
Helpful, but needs further thought
The following information would be helpful to have, tho' would need to be discussed to make sure it was implemented in the right way.
the language the user speaks or the coarse geographic region the user has visited from
This would give us rough understanding of the language the user may speak - useful when deciding on translation.
the coarse device type information - mobile/tablet/laptop/desktop/other device
This would be useful to understand about information layout
Consent and transparency
My opinion would be analytics would be opt-in for the documentation visitor. Explaining why we requst permission to gather the data should be communicated.
It would also be important to be transparent with the community about what type of data we are gathering, and what it is being used for.
I'd like to suggest discussion about making the above data public. It would be important to make sure we were not gathering IP address, granular geographic information. This would show the community what data is generated, and (I would think) be interesting for the community to see.