Skip to content

Commit 0f43e12

Browse files
authored
Merge pull request #43 from operating-function/analytics-opt-in
Enable analytics by default
2 parents 6c59234 + eed021c commit 0f43e12

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

src/settings-page.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export class SettingsPage extends LitElement {
7171
@state()
7272
private archiveScreenshots = false;
7373
@state()
74-
private analyticsEnabled = false;
74+
private analyticsEnabled = true;
7575
@state()
7676
private skipDomains = "";
7777
@state()
@@ -90,8 +90,16 @@ export class SettingsPage extends LitElement {
9090
this.archiveStorage = storage === "1";
9191
const screenshots = await getLocalOption("archiveScreenshots");
9292
this.archiveScreenshots = screenshots === "1";
93+
9394
const analytics = await getLocalOption("analyticsEnabled");
94-
this.analyticsEnabled = analytics === "1";
95+
if (analytics === null || analytics === undefined) {
96+
// Set default analytics to enabled
97+
await setLocalOption("analyticsEnabled", "1");
98+
this.analyticsEnabled = true;
99+
} else {
100+
this.analyticsEnabled = analytics === "1";
101+
}
102+
95103
const domains = await getLocalOption("skipDomains");
96104

97105
this.skipDomains = Array.isArray(domains)
@@ -239,7 +247,7 @@ export class SettingsPage extends LitElement {
239247
></md-switch>
240248
</label>
241249
<p class="section-desc md-typescale-body-small">
242-
Allow anonymous usage tracking (e.g., page archives, settings changes). When enabled, basic events will be logged. You can disable this at any time to opt-out of data collection.
250+
Allow anonymous usage tracking. When enabled, basic information about app usage will be logged. You can disable this at any time to opt-out of data collection. Please see our website for a <a style="color: var(--md-sys-color-primary-container);" href="https://opfn.co/packrat#privacy-policy" target="_blank">complete list of the events we log</a>!
243251
</p>
244252
</div>
245253

0 commit comments

Comments
 (0)