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


From 71aeb7cddcd2a1faf7a4dc46d828ad8471019f37 Mon Sep 17 00:00:00 2001
From: Steve Klebanoff <steve.klebanoff@gmail.com>
Date: Thu, 15 Nov 2018 11:35:47 -0800
Subject: Linting

---
 packages/instant/src/components/zero_ex_instant_provider.tsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(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 c187f98ee..cfc542a59 100644
--- a/packages/instant/src/components/zero_ex_instant_provider.tsx
+++ b/packages/instant/src/components/zero_ex_instant_provider.tsx
@@ -12,8 +12,8 @@ import { DEFAULT_STATE, DefaultState, State } from '../redux/reducer';
 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 { assetUtils } from '../util/asset';
 import { errorFlasher } from '../util/error_flasher';
 import { gasPriceEstimator } from '../util/gas_price_estimator';
 import { Heartbeater } from '../util/heartbeater';
-- 
cgit v1.2.3


From 37d60dc39ea6476c3185e124175cb02d5e830250 Mon Sep 17 00:00:00 2001
From: Steve Klebanoff <steve.klebanoff@gmail.com>
Date: Fri, 16 Nov 2018 08:51:41 -0800
Subject: Typesafe analytic actions

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

(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 cfc542a59..77adca472 100644
--- a/packages/instant/src/components/zero_ex_instant_provider.tsx
+++ b/packages/instant/src/components/zero_ex_instant_provider.tsx
@@ -19,6 +19,7 @@ import { gasPriceEstimator } from '../util/gas_price_estimator';
 import { Heartbeater } from '../util/heartbeater';
 import { generateAccountHeartbeater, generateBuyQuoteHeartbeater } from '../util/heartbeater_factory';
 import { providerStateFactory } from '../util/provider_state_factory';
+import { analyticsMiddleware } from '../redux/analytics_middleware';
 
 fonts.include();
 
@@ -129,7 +130,7 @@ export class ZeroExInstantProvider extends React.Component<ZeroExInstantProvider
             networkId: state.network,
             providerName: state.providerState.name,
         });
-        analytics.track('Widget - Opened');
+        analytics.widgetOpened();
     }
     public componentWillUnmount(): void {
         if (this._accountUpdateHeartbeat) {
-- 
cgit v1.2.3


From 74254636b4e9918eeb5dd8ccc238de8bba74585f Mon Sep 17 00:00:00 2001
From: Steve Klebanoff <steve.klebanoff@gmail.com>
Date: Fri, 16 Nov 2018 10:11:00 -0800
Subject: Remove unused import

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

(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 77adca472..8bcdc214e 100644
--- a/packages/instant/src/components/zero_ex_instant_provider.tsx
+++ b/packages/instant/src/components/zero_ex_instant_provider.tsx
@@ -19,7 +19,6 @@ import { gasPriceEstimator } from '../util/gas_price_estimator';
 import { Heartbeater } from '../util/heartbeater';
 import { generateAccountHeartbeater, generateBuyQuoteHeartbeater } from '../util/heartbeater_factory';
 import { providerStateFactory } from '../util/provider_state_factory';
-import { analyticsMiddleware } from '../redux/analytics_middleware';
 
 fonts.include();
 
-- 
cgit v1.2.3


From 42565869a452fcf2f498a3ff396f76c43aadfa29 Mon Sep 17 00:00:00 2001
From: Steve Klebanoff <steve.klebanoff@gmail.com>
Date: Fri, 16 Nov 2018 10:19:16 -0800
Subject: Report on git sha and npm version of build

---
 packages/instant/src/components/zero_ex_instant_provider.tsx | 2 ++
 1 file changed, 2 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 8bcdc214e..e85efb422 100644
--- a/packages/instant/src/components/zero_ex_instant_provider.tsx
+++ b/packages/instant/src/components/zero_ex_instant_provider.tsx
@@ -128,6 +128,8 @@ export class ZeroExInstantProvider extends React.Component<ZeroExInstantProvider
             embeddedUrl: window.location.href,
             networkId: state.network,
             providerName: state.providerState.name,
+            gitSha: process.env.GIT_SHA,
+            npmVersion: process.env.NPM_PACKAGE_VERSION,
         });
         analytics.widgetOpened();
     }
-- 
cgit v1.2.3


From 31ffa65f59fc6d2c6c7f79c1ac0e2abe0c5ed4ab Mon Sep 17 00:00:00 2001
From: Steve Klebanoff <steve.klebanoff@gmail.com>
Date: Fri, 16 Nov 2018 15:06:11 -0800
Subject: Getting rid of unused function, and using track prefix

---
 packages/instant/src/components/zero_ex_instant_provider.tsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(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 5fa64aa45..74e42bb40 100644
--- a/packages/instant/src/components/zero_ex_instant_provider.tsx
+++ b/packages/instant/src/components/zero_ex_instant_provider.tsx
@@ -132,7 +132,7 @@ export class ZeroExInstantProvider extends React.Component<ZeroExInstantProvider
             gitSha: process.env.GIT_SHA,
             npmVersion: process.env.NPM_PACKAGE_VERSION,
         });
-        analytics.widgetOpened();
+        analytics.trackWidgetOpened();
     }
     public componentWillUnmount(): void {
         if (this._accountUpdateHeartbeat) {
-- 
cgit v1.2.3


From e8be70da10c887956d6e200f7d551d3d7bbafb93 Mon Sep 17 00:00:00 2001
From: Steve Klebanoff <steve.klebanoff@gmail.com>
Date: Fri, 16 Nov 2018 15:29:07 -0800
Subject: Widget -> Instant

---
 packages/instant/src/components/zero_ex_instant_provider.tsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(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 74e42bb40..1d5e7fe6f 100644
--- a/packages/instant/src/components/zero_ex_instant_provider.tsx
+++ b/packages/instant/src/components/zero_ex_instant_provider.tsx
@@ -132,7 +132,7 @@ export class ZeroExInstantProvider extends React.Component<ZeroExInstantProvider
             gitSha: process.env.GIT_SHA,
             npmVersion: process.env.NPM_PACKAGE_VERSION,
         });
-        analytics.trackWidgetOpened();
+        analytics.trackInstantOpened();
     }
     public componentWillUnmount(): void {
         if (this._accountUpdateHeartbeat) {
-- 
cgit v1.2.3


From 3f0d94c83872ae80d6377fd4f712efa4c174a284 Mon Sep 17 00:00:00 2001
From: Steve Klebanoff <steve.klebanoff@gmail.com>
Date: Fri, 16 Nov 2018 16:44:23 -0800
Subject: Add way to disable via props

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

(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 1d5e7fe6f..52454148f 100644
--- a/packages/instant/src/components/zero_ex_instant_provider.tsx
+++ b/packages/instant/src/components/zero_ex_instant_provider.tsx
@@ -12,7 +12,7 @@ import { DEFAULT_STATE, DefaultState, State } from '../redux/reducer';
 import { store, Store } from '../redux/store';
 import { fonts } from '../style/fonts';
 import { AccountState, AffiliateInfo, AssetMetaData, Network, OrderSource } from '../types';
-import { analytics } from '../util/analytics';
+import { analytics, disableAnalytics } from '../util/analytics';
 import { assetUtils } from '../util/asset';
 import { errorFlasher } from '../util/error_flasher';
 import { gasPriceEstimator } from '../util/gas_price_estimator';
@@ -37,6 +37,7 @@ export interface ZeroExInstantProviderOptionalProps {
     additionalAssetMetaDataMap: ObjectMap<AssetMetaData>;
     networkId: Network;
     affiliateInfo: AffiliateInfo;
+    disableAnalyticsTracking: boolean;
 }
 
 export class ZeroExInstantProvider extends React.Component<ZeroExInstantProviderProps> {
@@ -124,6 +125,9 @@ export class ZeroExInstantProvider extends React.Component<ZeroExInstantProvider
         this._flashErrorIfWrongNetwork();
 
         // Analytics
+        if (this.props.disableAnalyticsTracking) {
+            disableAnalytics();
+        }
         analytics.addEventProperties({
             embeddedHost: window.location.host,
             embeddedUrl: window.location.href,
-- 
cgit v1.2.3


From 2bfd03e64f20905b0526d65813f78eff3e924727 Mon Sep 17 00:00:00 2001
From: Steve Klebanoff <steve.klebanoff@gmail.com>
Date: Mon, 19 Nov 2018 09:54:59 -0800
Subject: Change disabled analytics name, add assertion, and always set

---
 packages/instant/src/components/zero_ex_instant_provider.tsx | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

(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 52454148f..9435d8c7c 100644
--- a/packages/instant/src/components/zero_ex_instant_provider.tsx
+++ b/packages/instant/src/components/zero_ex_instant_provider.tsx
@@ -37,7 +37,7 @@ export interface ZeroExInstantProviderOptionalProps {
     additionalAssetMetaDataMap: ObjectMap<AssetMetaData>;
     networkId: Network;
     affiliateInfo: AffiliateInfo;
-    disableAnalyticsTracking: boolean;
+    shouldDisableAnalyticsTracking: boolean;
 }
 
 export class ZeroExInstantProvider extends React.Component<ZeroExInstantProviderProps> {
@@ -125,9 +125,7 @@ export class ZeroExInstantProvider extends React.Component<ZeroExInstantProvider
         this._flashErrorIfWrongNetwork();
 
         // Analytics
-        if (this.props.disableAnalyticsTracking) {
-            disableAnalytics();
-        }
+        disableAnalytics(this.props.shouldDisableAnalyticsTracking || false);
         analytics.addEventProperties({
             embeddedHost: window.location.host,
             embeddedUrl: window.location.href,
-- 
cgit v1.2.3

