From ca9bb45327d2c5a8a83f2d261b134bf8489b3395 Mon Sep 17 00:00:00 2001
From: Steve Klebanoff <steve.klebanoff@gmail.com>
Date: Thu, 15 Nov 2018 11:29:11 -0800
Subject: Move where we track widget opened, and report on networkId and
 providerName

---
 packages/instant/src/components/zero_ex_instant_provider.tsx | 10 ++++++++++
 1 file changed, 10 insertions(+)

(limited to 'packages/instant/src/components/zero_ex_instant_provider.tsx')

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) {
-- 
cgit v1.2.3

