Skip to content

Commit 890a89a

Browse files
committed
Proxy the analytics calls
1 parent ed953c1 commit 890a89a

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

src/utils/analytics.js

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
1-
import Analytics from "analytics";
2-
import googleAnalyticsPlugin from "@analytics/google-analytics";
3-
4-
const analytics = Analytics({
5-
debug: process.env.NODE_ENV !== "production",
6-
plugins: [
7-
googleAnalyticsPlugin({
8-
trackingId: "UA-195006-22",
9-
}),
10-
],
11-
});
1+
const analytics = {
2+
track(...args) {
3+
if (typeof window !== "undefined" && window.plausible) {
4+
window.plausible.apply(this, [...args]);
5+
}
6+
},
7+
};
128

139
export default analytics;

0 commit comments

Comments
 (0)