Install Vercel Web Analytics - #29
Draft
vercel[bot] wants to merge 1 commit into
Draft
Conversation
## Vercel Web Analytics Integration
Successfully installed and configured Vercel Web Analytics for this Docusaurus project.
### Changes Made
**Modified Files:**
1. **package.json**
- Added `@docusaurus/plugin-vercel-analytics` (version 3.9.2) to dependencies
- This is the official Docusaurus plugin for Vercel Analytics
2. **package-lock.json**
- Updated to include the Vercel Analytics plugin and its dependencies
- Ensures consistent dependency resolution across environments
3. **docusaurus.config.js**
- Added Vercel Analytics plugin to the plugins array
- Configured with options:
- `debug: false` - Disables console logging of analytics events in production
- `mode: 'auto'` - Automatic environment detection
### Implementation Details
Following the official Docusaurus documentation for Vercel Analytics integration, I used the dedicated `@docusaurus/plugin-vercel-analytics` plugin rather than the generic React implementation. This is the recommended approach for Docusaurus sites.
The plugin was added as the first plugin in the configuration array, before the existing client-redirects plugin. It operates exclusively in production builds and remains inactive during development to prevent skewing analytics data.
### Configuration
```javascript
[
'@docusaurus/plugin-vercel-analytics',
{
debug: false,
mode: 'auto',
},
]
```
### Next Steps
1. Deploy the site to Vercel
2. Enable Web Analytics in the Vercel dashboard:
- Navigate to the project settings
- Go to Analytics section
- Click "Enable" button
3. After deployment, verify analytics are working by checking the browser's Network tab for requests to `/_vercel/insights/*`
### Verification
- ✓ Configuration file loads successfully without syntax errors
- ✓ Plugin is properly registered and configured
- ✓ Package dependencies are installed correctly
- ✓ Lock file is updated
- ✓ No vulnerabilities detected
The analytics will automatically start tracking page views and Web Vitals metrics once the site is deployed to Vercel and analytics are enabled in the dashboard.
Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
Author
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Vercel Web Analytics Integration
Successfully installed and configured Vercel Web Analytics for this Docusaurus project.
Changes Made
Modified Files:
package.json
@docusaurus/plugin-vercel-analytics(version 3.9.2) to dependenciespackage-lock.json
docusaurus.config.js
debug: false- Disables console logging of analytics events in productionmode: 'auto'- Automatic environment detectionImplementation Details
Following the official Docusaurus documentation for Vercel Analytics integration, I used the dedicated
@docusaurus/plugin-vercel-analyticsplugin rather than the generic React implementation. This is the recommended approach for Docusaurus sites.The plugin was added as the first plugin in the configuration array, before the existing client-redirects plugin. It operates exclusively in production builds and remains inactive during development to prevent skewing analytics data.
Configuration
Next Steps
/_vercel/insights/*Verification
The analytics will automatically start tracking page views and Web Vitals metrics once the site is deployed to Vercel and analytics are enabled in the dashboard.
View Project · Web Analytics
Created by contact-1127 with Vercel Agent