Google Analytics 4
Integrate Google Analytics 4 with your Mintlify documentation to track visitor behavior, page views, and content engagement with your GA4 ID.
You need to generate a new GA4Google Analytics 4 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 GA4Google Analytics 4 property. GA4Google Analytics 4 data is slightly different from UA data but still gets collected in the same project.
Connect GA4 to Mintlify
Section titled “Connect GA4 to Mintlify”Create a web stream
Section titled “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.
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
Section titled “Put measurement ID in docs.json”Add your Measurement ID to your docs.json file like so:
"integrations": {
"ga4": {
"measurementId": "G-XXXXXXX"
}
}Google Analytics takes two to three days to show your data.
You can use the Google Analytics Debugger to check your analytics configuration. The extension logs to your browser's console every time GA4 makes a request.