Google Analytics
- Ask a GCP admin to create a new
propertyfor you in Google Analytics underAptos Labs. Provide the following - Website name (e.g., aptos.dev)
- Once the
propertyis 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 (
Adminbutton 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 leadsandExamine user behavior - For the section on
Start collecting data, chooseWebas the platform - Setup the data stream