Google Analytics
- Ask a GCP admin to create a new
property
for you in Google Analytics underAptos Labs
. Provide the following - Website name (e.g., docs.aptos.dev)
- Once the
property
is created, ask for theMeasurement ID
The Measurement ID
is then used in pages/_app.tsx
.
- _meta.ts
- _app.tsx
pages/_app.tsx
export default function App({ Component, pageProps }) {
return (
<>
<GoogleAnalytics gaId="G-A1B2C3D4E5" />
<Component {...pageProps} />
</>
)
}
GCP Admins (PE)
Ignore the steps below unless you have Admin access
- Navigate to analytics.google.com
- In Google Analytics Admin (
Admin
button is the gear icon in the bottom left of the screen), click Create, then selectProperty
. - Provide a property name.
- For the section on
Choose your business objectives
, selectGenerate leads
andExamine user behavior
- For the section on
Start collecting data
, chooseWeb
as the platform - Setup the data stream