From 8aef9cbc465b5dc98158b85f8b51ea4f62f83296 Mon Sep 17 00:00:00 2001 From: 0xAsimetriq Date: Mon, 9 Oct 2023 11:58:23 +0300 Subject: [PATCH] Wrap up analytics --- .../core/src/controllers/EventsController.ts | 20 +++++++++---------- packages/core/src/utils/CoreHelperUtil.ts | 4 ++-- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/packages/core/src/controllers/EventsController.ts b/packages/core/src/controllers/EventsController.ts index 4c255568d9..9f9f838f69 100644 --- a/packages/core/src/controllers/EventsController.ts +++ b/packages/core/src/controllers/EventsController.ts @@ -38,26 +38,24 @@ export const EventsController = { } }, - _sendAnalyticsEvent(payload: EventsControllerState) { - if (excluded.includes(payload.data.event) || typeof window === 'undefined') { - return - } - - api - .post({ + async _sendAnalyticsEvent(payload: EventsControllerState) { + try { + if (excluded.includes(payload.data.event) || typeof window === 'undefined') { + return + } + await api.post({ path: '/event', headers: EventsController._getApiHeaders(), body: { url: window.location.href, domain: window.location.hostname, - product: 'WEB3MODAL', timestamp: payload.timestamp, props: payload.data } }) - .catch(_error => { - // Silent error handling - }) + } catch { + // Catch silently + } }, sendEvent(data: EventsControllerState['data']) { diff --git a/packages/core/src/utils/CoreHelperUtil.ts b/packages/core/src/utils/CoreHelperUtil.ts index 38c7a96424..b1a2832925 100644 --- a/packages/core/src/utils/CoreHelperUtil.ts +++ b/packages/core/src/utils/CoreHelperUtil.ts @@ -165,7 +165,7 @@ export const CoreHelperUtil = { getAnalyticsUrl() { return CoreHelperUtil.isRestrictedRegion() - ? 'https://analytics-api-cf-workers-staging.walletconnect-v1-bridge.workers.dev' - : 'https://analytics-api-cf-workers-staging.walletconnect-v1-bridge.workers.dev' + ? 'https://pulse.walletconnect.org' + : 'https://pulse.walletconnect.com' } }