diff options
author | Fabio Berger <me@fabioberger.com> | 2018-03-12 18:28:34 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-12 18:28:34 +0800 |
commit | 76a31b6fd69038779166a2532d6d6ee677a91406 (patch) | |
tree | 85d37695519c18c9e66e53667c69eb5dd9c8c92b /packages/website/ts/index.tsx | |
parent | 0ad3d06ef969904ce1121b76ca129d25839af781 (diff) | |
parent | 8a58ffda86289d8126fa5ff56ea24f7b31f3757f (diff) | |
download | dexon-sol-tools-76a31b6fd69038779166a2532d6d6ee677a91406.tar dexon-sol-tools-76a31b6fd69038779166a2532d6d6ee677a91406.tar.gz dexon-sol-tools-76a31b6fd69038779166a2532d6d6ee677a91406.tar.bz2 dexon-sol-tools-76a31b6fd69038779166a2532d6d6ee677a91406.tar.lz dexon-sol-tools-76a31b6fd69038779166a2532d6d6ee677a91406.tar.xz dexon-sol-tools-76a31b6fd69038779166a2532d6d6ee677a91406.tar.zst dexon-sol-tools-76a31b6fd69038779166a2532d6d6ee677a91406.zip |
Merge pull request #447 from 0xProject/refactorAnalytics
Refactor Website Analytics
Diffstat (limited to 'packages/website/ts/index.tsx')
-rw-r--r-- | packages/website/ts/index.tsx | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/packages/website/ts/index.tsx b/packages/website/ts/index.tsx index 1eaf6274b..b24517e39 100644 --- a/packages/website/ts/index.tsx +++ b/packages/website/ts/index.tsx @@ -2,7 +2,6 @@ import { MuiThemeProvider } from 'material-ui/styles'; import * as React from 'react'; import { render } from 'react-dom'; -import * as ReactGA from 'react-ga'; import { Provider } from 'react-redux'; import { BrowserRouter as Router, Redirect, Route, Switch } from 'react-router-dom'; import * as injectTapEventPlugin from 'react-tap-event-plugin'; @@ -17,9 +16,9 @@ import { trackedTokenStorage } from 'ts/local_storage/tracked_token_storage'; import { tradeHistoryStorage } from 'ts/local_storage/trade_history_storage'; import { reducer, State } from 'ts/redux/reducer'; import { WebsitePaths } from 'ts/types'; +import { analytics } from 'ts/utils/analytics'; import { muiTheme } from 'ts/utils/mui_theme'; import { utils } from 'ts/utils/utils'; -import * as Web3 from 'web3'; import 'whatwg-fetch'; injectTapEventPlugin(); @@ -47,13 +46,9 @@ const LazyConnectDocumentation = createLazyComponent('Documentation', async () = System.import<any>(/* webpackChunkName: "connectDocs" */ 'ts/containers/connect_documentation'), ); -ReactGA.initialize('UA-98720122-1'); -window.onload = () => { - const providerName = (window as any).web3 - ? utils.web3ProviderToString((window as any).web3.currentProvider) - : 'NONE'; - ReactGA.ga('set', 'dimension1', providerName); -}; +analytics.init(); +// tslint:disable-next-line:no-floating-promises +analytics.logProviderAsync((window as any).web3); const store: ReduxStore<State> = createStore(reducer); render( <Router> |