Skip to content

Commit e843dd9

Browse files
committed
Add Amplitude
1 parent 176587b commit e843dd9

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

packages/app/src/app/pages/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ class Routes extends React.Component<Props> {
9393
if (typeof window.ga === 'function' && !DNT) {
9494
window.ga('set', 'page', location.pathname + location.search);
9595

96-
send('pageview');
96+
send('pageview', { path: location.pathname + location.search });
9797
}
9898
}
9999
return null;

packages/common/utils/analytics.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,9 @@ export const DNT = !!(
77
export default function track(eventName, secondArg: any) {
88
if (window.ga && !DNT) {
99
window.ga('send', secondArg);
10+
11+
if (typeof window.amplitude !== 'undefined') {
12+
window.amplitude.logEvent(eventName, secondArg);
13+
}
1014
}
1115
}

0 commit comments

Comments
 (0)