aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant
diff options
context:
space:
mode:
authorSteve Klebanoff <steve.klebanoff@gmail.com>2018-11-16 03:29:11 +0800
committerSteve Klebanoff <steve.klebanoff@gmail.com>2018-11-16 03:29:11 +0800
commitca9bb45327d2c5a8a83f2d261b134bf8489b3395 (patch)
treeae030fc12adef345d2fc006b1695dc0cc2415948 /packages/instant
parent450814ad80bb22332579e8ba54b58e1c06f34f71 (diff)
downloaddexon-sol-tools-ca9bb45327d2c5a8a83f2d261b134bf8489b3395.tar
dexon-sol-tools-ca9bb45327d2c5a8a83f2d261b134bf8489b3395.tar.gz
dexon-sol-tools-ca9bb45327d2c5a8a83f2d261b134bf8489b3395.tar.bz2
dexon-sol-tools-ca9bb45327d2c5a8a83f2d261b134bf8489b3395.tar.lz
dexon-sol-tools-ca9bb45327d2c5a8a83f2d261b134bf8489b3395.tar.xz
dexon-sol-tools-ca9bb45327d2c5a8a83f2d261b134bf8489b3395.tar.zst
dexon-sol-tools-ca9bb45327d2c5a8a83f2d261b134bf8489b3395.zip
Move where we track widget opened, and report on networkId and providerName
Diffstat (limited to 'packages/instant')
-rw-r--r--packages/instant/src/components/zero_ex_instant_container.tsx4
-rw-r--r--packages/instant/src/components/zero_ex_instant_provider.tsx10
2 files changed, 10 insertions, 4 deletions
diff --git a/packages/instant/src/components/zero_ex_instant_container.tsx b/packages/instant/src/components/zero_ex_instant_container.tsx
index d977b0690..8c3bdc6b6 100644
--- a/packages/instant/src/components/zero_ex_instant_container.tsx
+++ b/packages/instant/src/components/zero_ex_instant_container.tsx
@@ -69,10 +69,6 @@ export class ZeroExInstantContainer extends React.Component<{}, ZeroExInstantCon
</React.Fragment>
);
}
- // tslint:disable-next-line:prefer-function-over-method
- public componentDidMount(): void {
- analytics.track('Widget - Opened');
- }
private readonly _handleSymbolClick = (): void => {
this.setState({
tokenSelectionPanelAnimationState: 'slidIn',
diff --git a/packages/instant/src/components/zero_ex_instant_provider.tsx b/packages/instant/src/components/zero_ex_instant_provider.tsx
index 18e71edb6..c187f98ee 100644
--- a/packages/instant/src/components/zero_ex_instant_provider.tsx
+++ b/packages/instant/src/components/zero_ex_instant_provider.tsx
@@ -13,6 +13,7 @@ import { store, Store } from '../redux/store';
import { fonts } from '../style/fonts';
import { AccountState, AffiliateInfo, AssetMetaData, Network, OrderSource } from '../types';
import { assetUtils } from '../util/asset';
+import { analytics } from '../util/analytics';
import { errorFlasher } from '../util/error_flasher';
import { gasPriceEstimator } from '../util/gas_price_estimator';
import { Heartbeater } from '../util/heartbeater';
@@ -120,6 +121,15 @@ export class ZeroExInstantProvider extends React.Component<ZeroExInstantProvider
gasPriceEstimator.getGasInfoAsync();
// tslint:disable-next-line:no-floating-promises
this._flashErrorIfWrongNetwork();
+
+ // Analytics
+ analytics.addEventProperties({
+ embeddedHost: window.location.host,
+ embeddedUrl: window.location.href,
+ networkId: state.network,
+ providerName: state.providerState.name,
+ });
+ analytics.track('Widget - Opened');
}
public componentWillUnmount(): void {
if (this._accountUpdateHeartbeat) {