Skip to content

Commit

Permalink
Merge pull request #6 from datainsider-co/upgrade_tracking
Browse files Browse the repository at this point in the history
update: version of di analytics to 0.8.6
  • Loading branch information
tvc12 authored Jan 16, 2023
2 parents 2c2b063 + 73341a1 commit be5b652
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "di-web-analytics",
"version": "0.8.5",
"version": "0.8.6",
"description": "Data insider web analytics",
"repository": {
"type": "git",
Expand Down
6 changes: 2 additions & 4 deletions src/service/analytics_core_impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,8 @@ export class AnalyticsCoreImpl extends AnalyticsCore {

private setupWorker() {

document.addEventListener('readystatechange', event => {
window.addEventListener('beforeunload', async (event) => {
await this.worker.stop();
});
window.addEventListener('beforeunload', async (event) => {
await this.worker.stop();
});
}

Expand Down
2 changes: 1 addition & 1 deletion src/service/di_analytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,11 @@ export class DiAnalytics {
properties?: Properties,
): Promise<void> {
try {
await this.identify(customerInfo.id);
await this.track(SystemEvents.Login, {
...customerInfo,
...properties
});
await this.identify(customerInfo.id);
} catch (ex) {
Logger.error('DiAnalytics.login failed', ex);
}
Expand Down

0 comments on commit be5b652

Please sign in to comment.