Skip to content
This repository has been archived by the owner on Sep 22, 2023. It is now read-only.

Commit

Permalink
feat(App): Remove Google Analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeDabrowski committed Nov 2, 2018
1 parent 27d67cd commit b9e9077
Show file tree
Hide file tree
Showing 22 changed files with 5 additions and 163 deletions.
2 changes: 0 additions & 2 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import apiFactory from './api';
import actions from './actions';
import MenuFactory from './lib/Menu';
import TouchBarFactory from './lib/TouchBar';
import * as analytics from './lib/analytics';

import I18N from './I18n';
import AppLayoutContainer from './containers/layout/AppLayoutContainer';
Expand Down Expand Up @@ -59,7 +58,6 @@ window.addEventListener('load', () => {
api,
menu,
touchBar,
analytics,
render() {
const preparedApp = (
<Provider stores={stores} actions={actions}>
Expand Down
1 change: 0 additions & 1 deletion src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export const CHECK_INTERVAL = 1000 * 3600; // How often should we perform checks
export const LOCAL_API = 'http://localhost:3000';
export const DEV_API = 'https://dev.franzinfra.com';
export const LIVE_API = 'https://api.franzinfra.com';
export const GA_ID = 'UA-74126766-6';

export const APP_THEMES = {
'theme-regular': 'Regular',
Expand Down
5 changes: 0 additions & 5 deletions src/containers/auth/ImportScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,9 @@ import PropTypes from 'prop-types';
import { inject, observer } from 'mobx-react';
import Import from '../../components/auth/Import';
import UserStore from '../../stores/UserStore';
import { gaPage } from '../../lib/analytics';

@inject('stores', 'actions') @observer
export default class ImportScreen extends Component {
componentDidMount() {
gaPage('Auth/Import');
}

render() {
const { actions, stores } = this.props;

Expand Down
4 changes: 0 additions & 4 deletions src/containers/auth/InviteScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,9 @@ import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { inject, observer } from 'mobx-react';
import Invite from '../../components/auth/Invite';
import { gaPage } from '../../lib/analytics';

@inject('stores', 'actions') @observer
export default class InviteScreen extends Component {
componentDidMount() {
gaPage('Auth/Invite');
}

render() {
const { actions } = this.props;
Expand Down
5 changes: 0 additions & 5 deletions src/containers/auth/LoginScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import PropTypes from 'prop-types';
import { inject, observer } from 'mobx-react';
import Login from '../../components/auth/Login';
import UserStore from '../../stores/UserStore';
import { gaPage } from '../../lib/analytics';

import { globalError as globalErrorPropType } from '../../prop-types';

Expand All @@ -13,10 +12,6 @@ export default class LoginScreen extends Component {
error: globalErrorPropType.isRequired,
};

componentDidMount() {
gaPage('Auth/Login');
}

render() {
const { actions, stores, error } = this.props;
return (
Expand Down
5 changes: 0 additions & 5 deletions src/containers/auth/PasswordScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,9 @@ import PropTypes from 'prop-types';
import { inject, observer } from 'mobx-react';
import Password from '../../components/auth/Password';
import UserStore from '../../stores/UserStore';
import { gaPage } from '../../lib/analytics';

@inject('stores', 'actions') @observer
export default class PasswordScreen extends Component {
componentDidMount() {
gaPage('Auth/Password Retrieve');
}

render() {
const { actions, stores } = this.props;

Expand Down
5 changes: 0 additions & 5 deletions src/containers/auth/PricingScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { RouterStore } from 'mobx-react-router';
import Pricing from '../../components/auth/Pricing';
import UserStore from '../../stores/UserStore';
import PaymentStore from '../../stores/PaymentStore';
import { gaPage } from '../../lib/analytics';

import { globalError as globalErrorPropType } from '../../prop-types';

Expand All @@ -16,10 +15,6 @@ export default class PricingScreen extends Component {
error: globalErrorPropType.isRequired,
};

componentDidMount() {
gaPage('Auth/Pricing');
}

render() {
const { actions, stores, error } = this.props;

Expand Down
5 changes: 0 additions & 5 deletions src/containers/auth/SignupScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { inject, observer } from 'mobx-react';

import Signup from '../../components/auth/Signup';
import UserStore from '../../stores/UserStore';
import { gaPage } from '../../lib/analytics';

import { globalError as globalErrorPropType } from '../../prop-types';

Expand All @@ -14,10 +13,6 @@ export default class SignupScreen extends Component {
error: globalErrorPropType.isRequired,
};

componentDidMount() {
gaPage('Auth/Signup');
}

render() {
const { actions, stores, error } = this.props;
return (
Expand Down
4 changes: 0 additions & 4 deletions src/containers/auth/WelcomeScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,9 @@ import { inject, observer } from 'mobx-react';
import Welcome from '../../components/auth/Welcome';
import UserStore from '../../stores/UserStore';
import RecipePreviewsStore from '../../stores/RecipePreviewsStore';
import { gaPage } from '../../lib/analytics';

@inject('stores', 'actions') @observer
export default class LoginScreen extends Component {
componentDidMount() {
gaPage('Auth/Welcome');
}

render() {
const { user, recipePreviews } = this.props.stores;
Expand Down
4 changes: 0 additions & 4 deletions src/containers/settings/AccountScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,13 @@ import { inject, observer } from 'mobx-react';
import PaymentStore from '../../stores/PaymentStore';
import UserStore from '../../stores/UserStore';
import AppStore from '../../stores/AppStore';
import { gaPage } from '../../lib/analytics';

import AccountDashboard from '../../components/settings/account/AccountDashboard';

const { BrowserWindow } = remote;

@inject('stores', 'actions') @observer
export default class AccountScreen extends Component {
componentDidMount() {
gaPage('Settings/Account Dashboard');
}

onCloseWindow() {
const { user, payment } = this.props.stores;
Expand Down
5 changes: 0 additions & 5 deletions src/containers/settings/EditServiceScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import UserStore from '../../stores/UserStore';
import RecipesStore from '../../stores/RecipesStore';
import ServicesStore from '../../stores/ServicesStore';
import Form from '../../lib/Form';
import { gaPage } from '../../lib/analytics';

import ServiceError from '../../components/settings/services/ServiceError';
import EditServiceForm from '../../components/settings/services/EditServiceForm';
Expand Down Expand Up @@ -58,10 +57,6 @@ export default class EditServiceScreen extends Component {
intl: intlShape,
};

componentDidMount() {
gaPage('Settings/Service/Edit');
}

onSubmit(data) {
const { action } = this.props.router.params;
const { recipes, services } = this.props.stores;
Expand Down
5 changes: 0 additions & 5 deletions src/containers/settings/EditSettingsScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import SettingsStore from '../../stores/SettingsStore';
import UserStore from '../../stores/UserStore';
import Form from '../../lib/Form';
import { APP_LOCALES } from '../../i18n/languages';
import { gaPage } from '../../lib/analytics';
import { APP_THEMES, DEFAULT_APP_SETTINGS } from '../../config';


Expand Down Expand Up @@ -79,10 +78,6 @@ export default class EditSettingsScreen extends Component {
intl: intlShape,
};

componentDidMount() {
gaPage('Settings/App');
}

onSubmit(settingsData) {
const { app, settings, user } = this.props.actions;

Expand Down
5 changes: 0 additions & 5 deletions src/containers/settings/EditUserScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import UserStore from '../../stores/UserStore';
import Form from '../../lib/Form';
import EditUserForm from '../../components/settings/user/EditUserForm';
import { required, email, minLength } from '../../helpers/validation-helpers';
import { gaPage } from '../../lib/analytics';

const messages = defineMessages({
firstname: {
Expand Down Expand Up @@ -56,10 +55,6 @@ export default class EditUserScreen extends Component {
intl: intlShape,
};

componentDidMount() {
gaPage('Settings/Account/Edit');
}

componentWillUnmount() {
this.props.actions.user.resetStatus();
}
Expand Down
5 changes: 0 additions & 5 deletions src/containers/settings/InviteScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,9 @@ import PropTypes from 'prop-types';
import { inject, observer } from 'mobx-react';

import Invite from '../../components/auth/Invite';
import { gaPage } from '../../lib/analytics';

@inject('stores', 'actions') @observer
export default class InviteScreen extends Component {
componentDidMount() {
gaPage('Settings/Invite');
}

componentWillUnmount() {
this.props.stores.user.inviteRequest.reset();
}
Expand Down
6 changes: 0 additions & 6 deletions src/containers/settings/RecipesScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import RecipePreviewsStore from '../../stores/RecipePreviewsStore';
import RecipeStore from '../../stores/RecipesStore';
import ServiceStore from '../../stores/ServicesStore';
import UserStore from '../../stores/UserStore';
import { gaPage } from '../../lib/analytics';

import RecipesDashboard from '../../components/settings/recipes/RecipesDashboard';

Expand All @@ -31,20 +30,15 @@ export default class RecipesScreen extends Component {
};

componentDidMount() {
gaPage('Settings/Recipe Dashboard/Featured');

autorun(() => {
const { filter } = this.props.params;
const { currentFilter } = this.state;

if (filter === 'all' && currentFilter !== 'all') {
gaPage('Settings/Recipe Dashboard/All');
this.setState({ currentFilter: 'all' });
} else if (filter === 'featured' && currentFilter !== 'featured') {
gaPage('Settings/Recipe Dashboard/Featured');
this.setState({ currentFilter: 'featured' });
} else if (filter === 'dev' && currentFilter !== 'dev') {
gaPage('Settings/Recipe Dashboard/Dev');
this.setState({ currentFilter: 'dev' });
}
});
Expand Down
4 changes: 0 additions & 4 deletions src/containers/settings/ServicesScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,11 @@ import { RouterStore } from 'mobx-react-router';
// import RecipePreviewsStore from '../../stores/RecipePreviewsStore';
import UserStore from '../../stores/UserStore';
import ServiceStore from '../../stores/ServicesStore';
import { gaPage } from '../../lib/analytics';

import ServicesDashboard from '../../components/settings/services/ServicesDashboard';

@inject('stores', 'actions') @observer
export default class ServicesScreen extends Component {
componentDidMount() {
gaPage('Settings/Service Dashboard');
}

componentWillUnmount() {
this.props.actions.service.resetFilter();
Expand Down
44 changes: 0 additions & 44 deletions src/lib/analytics.js

This file was deleted.

2 changes: 0 additions & 2 deletions src/stores/AppStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import Request from './lib/Request';
import { CHECK_INTERVAL, DEFAULT_APP_SETTINGS } from '../config';
import { isMac, isLinux, isWindows } from '../environment';
import locales from '../i18n/translations';
import { gaEvent } from '../lib/analytics';

import { getServiceIdsFromPartitions, removeServicePartitionDirectory } from '../helpers/service-helpers.js';

Expand Down Expand Up @@ -216,7 +215,6 @@ export default class AppStore extends Store {
console.warn(err);
}
gaEvent('App', enable ? 'enable autostart' : 'disable autostart');
}
@action _openExternalUrl({ url }) {
Expand Down
19 changes: 5 additions & 14 deletions src/stores/PaymentStore.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { action, observable, computed } from 'mobx';

import Store from './lib/Store';
import { action, computed, observable } from 'mobx';
import CachedRequest from './lib/CachedRequest';
import Request from './lib/Request';
import { gaEvent } from '../lib/analytics';

import Store from './lib/Store';

export default class PaymentStore extends Store {
@observable plansRequest = new CachedRequest(this.api.payment, 'plans');
Expand All @@ -30,18 +29,10 @@ export default class PaymentStore extends Store {
}

@action _createHostedPage({ planId }) {
const request = this.createHostedPageRequest.execute(planId);
gaEvent('Payment', 'createHostedPage', planId);
return request;
return this.createHostedPageRequest.execute(planId);
}

@action _createDashboardUrl() {
const request = this.createDashboardUrlRequest.execute();
gaEvent('Payment', 'createDashboardUrl');

return request;
return this.createDashboardUrlRequest.execute();
}
}
8 changes: 0 additions & 8 deletions src/stores/RecipePreviewsStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { debounce } from 'lodash';
import Store from './lib/Store';
import CachedRequest from './lib/CachedRequest';
import Request from './lib/Request';
import { gaEvent } from '../lib/analytics';

export default class RecipePreviewsStore extends Store {
@observable allRecipePreviewsRequest = new CachedRequest(this.api.recipePreviews, 'all');
Expand Down Expand Up @@ -38,13 +37,6 @@ export default class RecipePreviewsStore extends Store {
@action _search({ needle }) {
if (needle !== '') {
this.searchRecipePreviewsRequest.execute(needle);
this._analyticsSearch(needle);
}
}
// Helper
_analyticsSearch = debounce((needle) => {
gaEvent('Recipe', 'search', needle);
}, 3000);
}
Loading

0 comments on commit b9e9077

Please sign in to comment.