From ba9809104e6bb051bb7a1a1f3f8f2c4826f0fd95 Mon Sep 17 00:00:00 2001 From: Chethan Date: Fri, 30 Aug 2024 15:45:26 +0530 Subject: [PATCH] minor --- .../services/integration/tracking.service.ts | 48 ++++++++++++------- src/index.html | 4 +- 2 files changed, 33 insertions(+), 19 deletions(-) diff --git a/src/app/core/services/integration/tracking.service.ts b/src/app/core/services/integration/tracking.service.ts index e02064f..087b681 100644 --- a/src/app/core/services/integration/tracking.service.ts +++ b/src/app/core/services/integration/tracking.service.ts @@ -45,33 +45,45 @@ export class TrackingService { ...flattenedObject, Asset: 'Partner Dashboard Web' }; - if (this.tracking) { - this.tracking.track(action, properties); + try { + if (this.tracking) { + this.tracking.track(action, properties); + } + } catch (e) { + console.error('Tracking error:', e); } } onSignIn(email: string | undefined, partnerOrgId: number, partnerOrgName: string, orgId: string): void { - if (this.tracking) { - this.tracking.identify(email); - this.tracking.people.set({ - partnerOrgId, - partnerOrgName, - orgId - }); - this.identityEmail = email; + try { + if (this.tracking) { + this.tracking.identify(email); + this.tracking.people.set({ + partnerOrgId, + partnerOrgName, + orgId + }); + this.identityEmail = email; + } + } catch (e) { + console.error('Tracking error:', e); } this.eventTrack('Sign In'); } onSignUp(email: string | undefined, partnerOrgId: number, partnerOrgName: string, orgId: string): void { - if (this.tracking) { - this.tracking.identify(email); - this.tracking.people.set({ - partnerOrgId, - partnerOrgName, - orgId - }); - this.identityEmail = email; + try { + if (this.tracking) { + this.tracking.identify(email); + this.tracking.people.set({ + partnerOrgId, + partnerOrgName, + orgId + }); + this.identityEmail = email; + } + } catch (e) { + console.error('Tracking error:', e); } this.eventTrack('Sign Up'); } diff --git a/src/index.html b/src/index.html index 15ee80c..af93cc1 100644 --- a/src/index.html +++ b/src/index.html @@ -31,7 +31,9 @@ track_pageview: true, persistence: 'localStorage' }); - } catch(e) {} + } catch(e) { + console.error('Tracking error:', e); + } }