diff options
author | 2019-08-21 09:39:39 +0200 | |
---|---|---|
committer | 2019-08-21 09:39:39 +0200 | |
commit | c4768a221f93d534f4d0454414cdf073af8a2356 (patch) | |
tree | 77fdf9eb3cbfa72c8fe40e45c88af61299004609 /src/lib | |
parent | Update dev-app-update.yml (diff) | |
download | ferdium-app-c4768a221f93d534f4d0454414cdf073af8a2356.tar.gz ferdium-app-c4768a221f93d534f4d0454414cdf073af8a2356.tar.zst ferdium-app-c4768a221f93d534f4d0454414cdf073af8a2356.zip |
Remove analytics
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/Menu.js | 4 | ||||
-rw-r--r-- | src/lib/analytics.js | 55 |
2 files changed, 0 insertions, 59 deletions
diff --git a/src/lib/Menu.js b/src/lib/Menu.js index 22d788918..f1b8894c8 100644 --- a/src/lib/Menu.js +++ b/src/lib/Menu.js | |||
@@ -5,7 +5,6 @@ import { defineMessages } from 'react-intl'; | |||
5 | import { isMac, ctrlKey, cmdKey } from '../environment'; | 5 | import { isMac, ctrlKey, cmdKey } from '../environment'; |
6 | import { GA_CATEGORY_WORKSPACES, workspaceStore } from '../features/workspaces/index'; | 6 | import { GA_CATEGORY_WORKSPACES, workspaceStore } from '../features/workspaces/index'; |
7 | import { workspaceActions } from '../features/workspaces/actions'; | 7 | import { workspaceActions } from '../features/workspaces/actions'; |
8 | import { gaEvent } from './analytics'; | ||
9 | import { announcementActions } from '../features/announcements/actions'; | 8 | import { announcementActions } from '../features/announcements/actions'; |
10 | import { announcementsStore } from '../features/announcements'; | 9 | import { announcementsStore } from '../features/announcements'; |
11 | 10 | ||
@@ -850,7 +849,6 @@ export default class FranzMenu { | |||
850 | accelerator: `${cmdKey}+D`, | 849 | accelerator: `${cmdKey}+D`, |
851 | click: () => { | 850 | click: () => { |
852 | workspaceActions.toggleWorkspaceDrawer(); | 851 | workspaceActions.toggleWorkspaceDrawer(); |
853 | gaEvent(GA_CATEGORY_WORKSPACES, 'toggleDrawer', 'menu'); | ||
854 | }, | 852 | }, |
855 | enabled: this.stores.user.isLoggedIn, | 853 | enabled: this.stores.user.isLoggedIn, |
856 | }, { | 854 | }, { |
@@ -865,7 +863,6 @@ export default class FranzMenu { | |||
865 | checked: !activeWorkspace, | 863 | checked: !activeWorkspace, |
866 | click: () => { | 864 | click: () => { |
867 | workspaceActions.deactivate(); | 865 | workspaceActions.deactivate(); |
868 | gaEvent(GA_CATEGORY_WORKSPACES, 'switch', 'menu'); | ||
869 | }, | 866 | }, |
870 | }); | 867 | }); |
871 | 868 | ||
@@ -878,7 +875,6 @@ export default class FranzMenu { | |||
878 | checked: activeWorkspace ? workspace.id === activeWorkspace.id : false, | 875 | checked: activeWorkspace ? workspace.id === activeWorkspace.id : false, |
879 | click: () => { | 876 | click: () => { |
880 | workspaceActions.activate({ workspace }); | 877 | workspaceActions.activate({ workspace }); |
881 | gaEvent(GA_CATEGORY_WORKSPACES, 'switch', 'menu'); | ||
882 | }, | 878 | }, |
883 | })); | 879 | })); |
884 | } | 880 | } |
diff --git a/src/lib/analytics.js b/src/lib/analytics.js deleted file mode 100644 index c305fdb00..000000000 --- a/src/lib/analytics.js +++ /dev/null | |||
@@ -1,55 +0,0 @@ | |||
1 | import { remote } from 'electron'; | ||
2 | import querystring from 'querystring'; | ||
3 | |||
4 | import { GA_ID, STATS_API } from '../config'; | ||
5 | import { isDevMode } from '../environment'; | ||
6 | |||
7 | const debug = require('debug')('Franz:Analytics'); | ||
8 | |||
9 | const { app } = remote; | ||
10 | |||
11 | /* eslint-disable */ | ||
12 | (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ | ||
13 | (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), | ||
14 | m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) | ||
15 | })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); | ||
16 | /* eslint-enable */ | ||
17 | |||
18 | const GA_LOCAL_STORAGE_KEY = 'gaUid'; | ||
19 | |||
20 | ga('create', GA_ID, { | ||
21 | storage: 'none', | ||
22 | clientId: localStorage.getItem(GA_LOCAL_STORAGE_KEY), | ||
23 | }); | ||
24 | |||
25 | ga((tracker) => { | ||
26 | localStorage.setItem(GA_LOCAL_STORAGE_KEY, tracker.get('clientId')); | ||
27 | }); | ||
28 | ga('set', 'checkProtocolTask', null); | ||
29 | ga('set', 'version', app.getVersion()); | ||
30 | ga('send', 'App'); | ||
31 | |||
32 | export function gaPage(page) { | ||
33 | ga('send', 'pageview', page); | ||
34 | debug('GA track page', page); | ||
35 | } | ||
36 | |||
37 | export function gaEvent(category, action, label) { | ||
38 | ga('send', 'event', category, action, label); | ||
39 | debug('GA track event', category, action, label); | ||
40 | } | ||
41 | |||
42 | export function statsEvent(key, value) { | ||
43 | const params = { | ||
44 | key, | ||
45 | value: value || key, | ||
46 | platform: process.platform, | ||
47 | version: remote.app.getVersion(), | ||
48 | }; | ||
49 | |||
50 | debug('Send Franz stats event', params); | ||
51 | |||
52 | if (!isDevMode) { | ||
53 | window.fetch(`${STATS_API}/event/?${querystring.stringify(params)}`); | ||
54 | } | ||
55 | } | ||