Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
Chethan-Fyle committed Aug 30, 2024
1 parent 5d4360d commit ba98091
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 19 deletions.
48 changes: 30 additions & 18 deletions src/app/core/services/integration/tracking.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down
4 changes: 3 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@
track_pageview: true,
persistence: 'localStorage'
});
} catch(e) {}
} catch(e) {
console.error('Tracking error:', e);
}
}
</script>
</head>
Expand Down

0 comments on commit ba98091

Please sign in to comment.