diff options
author | Tom Schmidt <imtomhschmidt@gmail.com> | 2018-03-10 07:31:21 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-10 07:31:21 +0800 |
commit | 824ee8a3dce2e3bd977edafec30dd9b84efc4280 (patch) | |
tree | abd75e02d19d7c2e9c7b8df1ebe7152e2d364a40 /packages/website/ts/index.tsx | |
parent | 7116f100ee194f46d0e34782afa8f680791adc9c (diff) | |
parent | 47af38ecb8d59789af9db2079e18ee0b6e589786 (diff) | |
download | dexon-sol-tools-824ee8a3dce2e3bd977edafec30dd9b84efc4280.tar dexon-sol-tools-824ee8a3dce2e3bd977edafec30dd9b84efc4280.tar.gz dexon-sol-tools-824ee8a3dce2e3bd977edafec30dd9b84efc4280.tar.bz2 dexon-sol-tools-824ee8a3dce2e3bd977edafec30dd9b84efc4280.tar.lz dexon-sol-tools-824ee8a3dce2e3bd977edafec30dd9b84efc4280.tar.xz dexon-sol-tools-824ee8a3dce2e3bd977edafec30dd9b84efc4280.tar.zst dexon-sol-tools-824ee8a3dce2e3bd977edafec30dd9b84efc4280.zip |
Merge pull request #441 from 0xProject/feature/website/web3-logging
Add web3 provider logging to GA
Diffstat (limited to 'packages/website/ts/index.tsx')
-rw-r--r-- | packages/website/ts/index.tsx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/packages/website/ts/index.tsx b/packages/website/ts/index.tsx index c0539c6d0..1eaf6274b 100644 --- a/packages/website/ts/index.tsx +++ b/packages/website/ts/index.tsx @@ -18,6 +18,8 @@ import { tradeHistoryStorage } from 'ts/local_storage/trade_history_storage'; import { reducer, State } from 'ts/redux/reducer'; import { WebsitePaths } from 'ts/types'; import { muiTheme } from 'ts/utils/mui_theme'; +import { utils } from 'ts/utils/utils'; +import * as Web3 from 'web3'; import 'whatwg-fetch'; injectTapEventPlugin(); @@ -46,6 +48,12 @@ const LazyConnectDocumentation = createLazyComponent('Documentation', async () = ); 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); +}; const store: ReduxStore<State> = createStore(reducer); render( <Router> |