Skip to content

Commit

Permalink
feat: session replay
Browse files Browse the repository at this point in the history
  • Loading branch information
yongenaelf committed Oct 15, 2024
1 parent 55e133f commit bc6b40a
Show file tree
Hide file tree
Showing 3 changed files with 122 additions and 0 deletions.
115 changes: 115 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"dependencies": {
"@amplitude/analytics-browser": "^2.11.7",
"@amplitude/plugin-ga-events-forwarder-browser": "^0.3.4",
"@amplitude/plugin-session-replay-browser": "^1.8.0",
"@docusaurus/core": "3.4.0",
"@docusaurus/preset-classic": "3.4.0",
"@mdx-js/react": "^3.0.0",
Expand Down
6 changes: 6 additions & 0 deletions src/theme/analytics.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
import * as amplitude from "@amplitude/analytics-browser";
import { gaEventsForwarderPlugin } from "@amplitude/plugin-ga-events-forwarder-browser";
import { sessionReplayPlugin } from "@amplitude/plugin-session-replay-browser";
import ReactGA from "react-ga4";
import TagManager from "react-gtm-module";

export const analytics = () => {
const gaEventsForwarder = gaEventsForwarderPlugin();
amplitude.add(gaEventsForwarder);
amplitude.init("7652218546e8f6cc3d045e43a68830f6", { autocapture: true });
const sessionReplayTracking = sessionReplayPlugin({
sampleRate: 0.01,
});
amplitude.add(sessionReplayTracking);

ReactGA.initialize("G-PFZ0BCQHMY");
TagManager.initialize({
gtmId: "GTM-NKWDMQ52",
Expand Down

0 comments on commit bc6b40a

Please sign in to comment.