Skip to content

Commit 816baec

Browse files
committed
refactor: adding packages and modifying code
1 parent ab55e02 commit 816baec

File tree

5 files changed

+59
-4
lines changed

5 files changed

+59
-4
lines changed

package-lock.json

Lines changed: 22 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@
6565
"rxjs": "~6.6.7",
6666
"tslib": "^2.3.1",
6767
"uuid": "^8.3.2",
68-
"zone.js": "~0.11.4"
68+
"zone.js": "~0.11.4",
69+
"@fullstory/browser": "^1.4.9",
70+
"mixpanel-browser": "^2.41.0"
6971
},
7072
"devDependencies": {
7173
"@angular-builders/jest": "^11.2.0",

projects/common/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
"zone.js": "~0.11.4",
2121
"lodash-es": "^4.17.21",
2222
"d3-interpolate": "^2.0.1",
23-
"d3-color": "^1.4.0"
23+
"d3-color": "^1.4.0",
24+
"@fullstory/browser": "^1.4.9",
25+
"mixpanel-browser": "^2.41.0"
2426
},
2527
"devDependencies": {
2628
"@hypertrace/test-utils": "^0.0.0"

projects/common/src/telemetry/providers/freshpaint/freshpaint-provider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export class FreshPaintTelemetry<InitConfig extends TelemetryProviderConfig>
2323
}
2424

2525
public trackPage(name: string, eventData: Dictionary<unknown>): void {
26-
this.freshPaint?.page('', name, eventData);
26+
this.freshPaint?.page(name, name, eventData);
2727
}
2828

2929
public trackError(name: string, eventData: Dictionary<unknown>): void {

projects/common/src/telemetry/providers/google-analytics/google-analytics-provider.ts

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { Dictionary } from './../../../utilities/types/types';
12
import { TelemetryProviderConfig, UserTelemetryProvider, UserTraits } from '../../telemetry';
23
import { loadGA } from './load-snippet';
34

@@ -9,5 +10,33 @@ export class GoogleAnalyticsTelemetry<InitConfig extends TelemetryProviderConfig
910
ga('send', 'pageview');
1011
}
1112

12-
public identify(_userTraits: UserTraits): void {}
13+
public identify(userTraits: UserTraits): void {
14+
ga('set', 'userId', userTraits.email);
15+
}
16+
17+
public trackEvent(name: string, eventData: Dictionary<unknown>): void {
18+
ga('send', {
19+
hitType: 'event',
20+
eventCategory: 'user-actions',
21+
eventAction: name,
22+
...eventData
23+
});
24+
}
25+
26+
public trackPage(name: string, eventData: Dictionary<unknown>): void {
27+
ga('send', {
28+
hitType: 'pageview',
29+
page: name,
30+
...eventData
31+
});
32+
}
33+
34+
public trackError(name: string, eventData: Dictionary<unknown>): void {
35+
ga('send', {
36+
hitType: 'event',
37+
eventCategory: 'error',
38+
eventAction: name,
39+
...eventData
40+
});
41+
}
1342
}

0 commit comments

Comments
 (0)