-
Notifications
You must be signed in to change notification settings - Fork 756
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
Analytics: set up PostHog #4399
Comments
There's documentation here TL;DRApprovers Designs
When to ask:
For new users:
|
Hey, @deniseal ! In Element you asked for us to make the link in these screens head to https://element.io/cookie-policy but @bmarty had feedback on that link as it may not be the most relelvant. Could you advise? See the screen here:https://www.figma.com/file/nt8rhrQ9arytjKUl5omfYj/%23157-Analytics-prompt?node-id=147%3A19178 |
Hey @daniellekirkwood, could I get permissions to view that, please? For Element Web that is the most relevant document, as it was reviewed by the Web team. I suspect we will need to update the cookie policy to be aligned with all of the different clients. |
Yes, our terms do not have anything in them about analytics. This would be the cookie policy, so I would need to know what exactly will change with posthog for each client and then I can re-do the document accordingly. |
The main problem for the Android implementation is that mobile devices don't use cookies at all, so a cookie policy isn't particularly relevant.
Hrm, what do you mean? I think we need to replace the reference to Matomo with Posthog, but the cookie policy does mention analytics currently.
|
Won't we use identifiers though? The policy can and should go beyond just cookies, the ICO expands it to include: ‘Online identifiers’ can also include (but are not limited to) things like:
I meant the terms of service for Element don't mention analytics, the cookie policy does. They are different documents. |
Looks like the cookie policy now mentions analytics... We'll need to change the language from Matomo to PostHog & then making sure we have the right references to the Android and iOS apps (not just web app) but looks like you're on it, @deniseal and we should go ahead and link to the cookie policy 👍 |
The url is still https://element.io/cookie-policy ? If yes, the content is really strange to me: |
We don't use these types of external identifier to track people outside of their Matrix sessions. We could explain how we're using the analytics ID (located in account data) to track people across devices, but it's kind of like explaining that we use a matrix ID to identify people across devices - is that necessary? The analytics ID is explained here
Thanks! |
@bmarty @daniellekirkwood yes, I can make any changes to the cookie policy to match this. I'm aware the page does not look the best right now, this had to be pushed quickly to address other changes but I am working with Design to improve it. Please let me know what identifiers and/or cookies to add, a brief description and for how long we will retain so I can add it to the policy. |
Good spot, we need to agree on a retention period for Posthog. From a product perspective, its nice to have data going back a couple of years to identify trends.. |
@novocaine on retention - it is always worth having the principle of proportionality in mind. A few questions worth asking:
A couple of years for non-identifiable cookies is not out of the ordinary, but these are things we should be asking ourselves in every process anyway. |
If anyone can confirm that I should still use the URL https://element.io/cookie-policy in Element Android app, this is the only thing I need to be able to do the release. Thanks! |
Yes, I think you should assume we will revise the policy to be more accurate and be suitable for mobile. |
For information: opt-in screen is now displayed to the user in EA 1.3.13 |
Add tracker domains from jsonlint site. Comment gravatar domains by default and remove some subdomains. Remove kspsrky and vjs.zencdn.net used in streaming sites. Remove duplicate hboopenbid.pubmatic.com. Block analytics domain from element matrix client. element-hq/element-android#4399
Context
A note to start: Element Android does not include any analytics library so far. So there is no concern about "migrating" some previous user consent about analytics.
The changes will only occur on the app side, not on the Android Matrix SDK
The issue perimeter is the following:
This issue does not include:
Add the library
Documentation can be found here:
https://posthog.com/docs/integrate/client/android
POSTHOG_HOST
has to be added as a string resource in the file config.xml. If the value is missing, it means that analytics is not enabled (useful for forks)The current values are:
POSTHOG_API_KEY
has to be available on the CI, maybe using GitHub secret (to be confirmed)For now we do not track anything (screen, lifecycle, see https://posthog.com/docs/integrate/client/android#all-configuration-options) and we should not track the device ID, so we will call
.collectDeviceId(false)
User consent
We have to get user consent to let the app collect and send analytics to the server we (Element) host.
The user consent is stored locally, for the lifetime of the application (can also be reset only if user wipe out all the app data). User consent change on Element Android does not update the account data, and the consent from the account data is just ignore by Element Android.
There are 2 use cases, to be discussed with design/product team
No session
We could add a small checkbox at the bottom of the first screen, checked by default, or unchecked if user has already not given their consent (during a previous session for instance)
Existing session
We have to ask for user consent if a session is already set up on the app (upgrade of an existing installation)
TODO: define what is the best strategy here.
User creates a session
Once the account data has been retrieved, we can identify the user with the key provided in the account data.
If the key is absent, Element Android will create it. See https://posthog.com/docs/integrate/client/android#identify to give the info to PostHog
User can revoke their consent
An new entry in the setting of the app will let the user revoke (or give) their consent to send analytics
In Settings/Security & Privacy, add a new section "Analytics" before the section "Other", with one item:
Send analytics data
Element collects anonymous analytics to allow us to improve the application.
All the pref and pref category will contain a key so that it can be hidden if necessary.
FTR this is how the setting looks like on EleWeb so far:
User signs out
In this case, the analytics has to be reset using https://posthog.com/docs/integrate/client/android#reset
The user consent about analytics is not reset on this case.
User Analytics Id from account data
The key and the format will maybe change, but for now the format is describe here: matrix-org/matrix-react-sdk#6936 (comment) (see the following discussion)
Element Android will only deal with the value of "id", other values are ignored. It's worth noting that "id" can be considered as immutable i.e. it should never be updated.
If account data is missing, Element Android can create if the user has already given their consent, or when they do it.
The "id" from the account data will be used for the parameter
distinctID
, see https://posthog.com/docs/integrate/client/android#identifyRefs
Mobile meta issue: element-hq/element-meta#57
ReactSDK PR: matrix-org/matrix-react-sdk#6936
The text was updated successfully, but these errors were encountered: