Analytics opt in for posthog (#6936)
* Add a new flag pseudonymousAnalyticsOptIn replacing analyticsOptIn, stored at account level, so people only need to opt in once. * Show a toast in login to users that have analyticsOptIn set but not yet pseudonymousAnalyticsOptIn prompting them confirm the new method is okay. Update the copy of the existing opt-in toast. Don't notify users that previously opted out. * Update the copy in settings * Add a new learn more dialog * Support a new config flag analyticsOwner which is used in these toasts when explaining which entity the data is sent to ("Help improve %(analyticsOwner)"). If unset, display brand. This allows deployments whose brand differs from the receiver of the analytics to explain the situation to their users (e.g. AcmeCorp badges their app, but explains the data is sent to Element, not them) * The new opt-in and flags are only used when posthog is configured; prior to that there are no changes to UX or tracking behaviour.
This commit is contained in:
parent
961fec9081
commit
5219b6be80
19 changed files with 512 additions and 150 deletions
|
@ -393,16 +393,26 @@ export class Analytics {
|
|||
];
|
||||
|
||||
// FIXME: Using an import will result in test failures
|
||||
const cookiePolicyUrl = SdkConfig.get().piwik?.policyUrl;
|
||||
const ErrorDialog = sdk.getComponent('dialogs.ErrorDialog');
|
||||
const cookiePolicyLink = _t(
|
||||
"Our complete cookie policy can be found <CookiePolicyLink>here</CookiePolicyLink>.",
|
||||
{},
|
||||
{
|
||||
"CookiePolicyLink": (sub) => {
|
||||
return <a href={cookiePolicyUrl} target="_blank" rel="noreferrer noopener">{ sub }</a>;
|
||||
},
|
||||
});
|
||||
Modal.createTrackedDialog('Analytics Details', '', ErrorDialog, {
|
||||
title: _t('Analytics'),
|
||||
description: <div className="mx_AnalyticsModal">
|
||||
<div>{ _t('The information being sent to us to help make %(brand)s better includes:', {
|
||||
{ cookiePolicyUrl && <p>{ cookiePolicyLink }</p> }
|
||||
<div>{ _t('Some examples of the information being sent to us to help make %(brand)s better includes:', {
|
||||
brand: SdkConfig.get().brand,
|
||||
}) }</div>
|
||||
<table>
|
||||
{ rows.map((row) => <tr key={row[0]}>
|
||||
<td>{ _t(
|
||||
<td className="mx_AnalyticsModal_label">{ _t(
|
||||
customVariables[row[0]].expl,
|
||||
customVariables[row[0]].getTextVariables ?
|
||||
customVariables[row[0]].getTextVariables() :
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue