MCPcopy Create free account
hub / github.com/mailvelope/mailvelope / initAnalytics

Function initAnalytics

src/lib/analytics.js:64–84  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

62let ci;
63
64export function initAnalytics() {
65 if (!ciActive) {
66 return;
67 }
68 store = new BrowserStoreWithKV();
69 ci = new CleanInsights({
70 'server': 'https://metrics.cleaninsights.org/cleaninsights.php',
71 'siteId': 22,
72 'persistEveryNTimes': 1,
73 'campaigns': {
74 [ONBOARDING_CAMPAIGN]: {
75 'start': '2024-03-01T00:00:00-00:00',
76 'end': '2024-12-31T23:59:59-00:00',
77 'aggregationPeriodLength': 1, // days
78 'numberOfPeriods': 30,
79 },
80 }
81 }, store);
82 // By calling this when the extension is initialized, we can make sure we flush the last events out.
83 ci.persistAndSend();
84}
85
86export function binInto10sIncrements(milliseconds) {
87 return Math.floor(milliseconds / (10 * 1000)) * 10;

Callers 1

mainFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected