mirror of
https://github.com/mintlify/docs.git
synced 2026-09-14 13:35:46 +08:00
f8e015ff62
* Improve SEO metadata: update descriptions to 130-155 chars across 177 pages Generated-By: mintlify-agent * Apply suggestion from @ethanpalm * Apply suggestions from code review Co-authored-by: Ethan Palm <56270045+ethanpalm@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Ethan Palm <56270045+ethanpalm@users.noreply.github.com> * 💅 --------- Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> Co-authored-by: Ethan Palm <56270045+ethanpalm@users.noreply.github.com>
48 lines
1.9 KiB
Plaintext
48 lines
1.9 KiB
Plaintext
---
|
|
title: "Google Analytics 4"
|
|
description: "Integrate Google Analytics 4 with your Mintlify documentation to track visitor behavior, page views, and content engagement with your GA4 ID."
|
|
keywords: ["GA4 integration", "measurement ID", "web stream", "Universal Analytics"]
|
|
---
|
|
|
|
You need to generate a new <Tooltip tip="Google Analytics 4">GA4</Tooltip> property to use with Mintlify. The data collected goes into the same project as your other Google Analytics data.
|
|
|
|
If you are using the old version of Google Analytics, Universal Analytics, you can still generate a <Tooltip tip="Google Analytics 4">GA4</Tooltip> property. <Tooltip tip="Google Analytics 4">GA4</Tooltip> data is slightly different from UA data but still gets collected in the same project.
|
|
|
|
## Connect GA4 to Mintlify
|
|
|
|
### Create a web stream
|
|
|
|
You need to create a web stream to get the Measurement ID to put into Mintlify.
|
|
|
|
Click the cog at the bottom left of the Google Analytics screen. Then click Data Streams.
|
|
|
|
<Frame></Frame>
|
|
|
|
Create a Web Stream and put the URL of your Mintlify docs site as the stream URL.
|
|
|
|
Your Measurement ID looks like `G-XXXXXXX` and appears under Stream Details immediately after you create the Web Stream.
|
|
|
|
### Put measurement ID in docs.json
|
|
|
|
Add your Measurement ID to your `docs.json` file like so:
|
|
|
|
```json docs.json
|
|
"integrations": {
|
|
"ga4": {
|
|
"measurementId": "G-XXXXXXX"
|
|
}
|
|
}
|
|
```
|
|
|
|
### Wait
|
|
|
|
Google Analytics takes two to three days to show your data.
|
|
|
|
You can use the [Google Analytics Debugger](https://chrome.google.com/webstore/detail/google-analytics-debugger/jnkmfdileelhofjcijamephohjechhna?hl=en) to check your analytics configuration. The extension logs to your browser's console every time GA4 makes a request.
|
|
|
|
<Note>
|
|
|
|
Preview links have analytics turned off.
|
|
|
|
</Note>
|