Move where we track widget opened, and report on networkId and providerName

This commit is contained in:
Steve Klebanoff
2018-11-15 11:29:11 -08:00
parent 450814ad80
commit ca9bb45327
2 changed files with 10 additions and 4 deletions

View File

@@ -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',

View File

@@ -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) {