Skip to content

Commit 664755f

Browse files
authored
Add amplitude autocapture plugin to capture button events (#350)
1 parent f04812c commit 664755f

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
lines changed

package-lock.json

Lines changed: 33 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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
},
1313
"dependencies": {
1414
"@amplitude/analytics-browser": "^2.8.1",
15+
"@amplitude/plugin-autocapture-browser": "^0.9.2",
1516
"@codesandbox/sandpack-react": "^2.6.1",
1617
"@cosmjs/cosmwasm-stargate": "^0.31.0",
1718
"@headlessui/react": "^1.7.14",

pages/_app.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { ReactNode, useEffect, useState } from "react";
77
import { WagmiConfig, createConfig } from "wagmi";
88
import { arbitrum, avalanche, mainnet, sepolia } from "wagmi/chains";
99
import * as amplitude from "@amplitude/analytics-browser";
10+
import { autocapturePlugin } from "@amplitude/plugin-autocapture-browser";
1011
import { CosmosChains, GlobalContextProvider } from "../contexts/GlobalContext";
1112
import "../styles/styles.css";
1213
import TagManager from "react-gtm-module";
@@ -44,6 +45,7 @@ export default function Nextra({ Component, pageProps }: NextraAppProps) {
4445
useEffect(() => {
4546
if (AMPLITUDE_API_KEY) {
4647
amplitude.init(AMPLITUDE_API_KEY);
48+
amplitude.add(autocapturePlugin());
4749
}
4850
});
4951

0 commit comments

Comments
 (0)