aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--packages/instant/src/constants.ts1
-rw-r--r--packages/instant/src/util/analytics.ts6
2 files changed, 7 insertions, 0 deletions
diff --git a/packages/instant/src/constants.ts b/packages/instant/src/constants.ts
index 994be9788..f46b0ca21 100644
--- a/packages/instant/src/constants.ts
+++ b/packages/instant/src/constants.ts
@@ -16,6 +16,7 @@ export const BUY_QUOTE_UPDATE_INTERVAL_TIME_MS = ONE_SECOND_MS * 15;
export const DEFAULT_GAS_PRICE = GWEI_IN_WEI.mul(6);
export const DEFAULT_ESTIMATED_TRANSACTION_TIME_MS = ONE_MINUTE_MS * 2;
export const ETH_GAS_STATION_API_BASE_URL = 'https://ethgasstation.info';
+export const ANALYTICS_ENABLED = true; // TODO: change when we can switch on dev
export const HEAP_ANALYTICS_DEVELOPMENT_APP_ID = '507265531';
export const COINBASE_API_BASE_URL = 'https://api.coinbase.com/v2';
export const PROGRESS_STALL_AT_WIDTH = '95%';
diff --git a/packages/instant/src/util/analytics.ts b/packages/instant/src/util/analytics.ts
index 3e2a996cf..6b6115abe 100644
--- a/packages/instant/src/util/analytics.ts
+++ b/packages/instant/src/util/analytics.ts
@@ -1,9 +1,15 @@
import { ObjectMap } from '@0x/types';
import { logUtils } from '@0x/utils';
+import { ANALYTICS_ENABLED } from '../constants';
+
import { HeapAnalytics, heapUtil } from './heap';
const evaluteHeapCall = (heapFunctionCall: (heap: HeapAnalytics) => void): void => {
+ if (!ANALYTICS_ENABLED) {
+ return;
+ }
+
const curHeap = heapUtil.getHeap();
if (curHeap) {
try {