Vercel Web Analytics Troubleshooting
Issue: If you are experiencing a situation where data is not visible in the analytics dashboard or a 404 error occurs while loading script.js, it could be due to deploying the tracking code before enabling Web Analytics.
How to fix:
- Make sure that you have enabled Analytics in the dashboard.
- Re-deploy your app to Vercel.
- Promote your latest deployment to production. To do so, visit the project in your dashboard, and open Deployments in the sidebar. From there, select the three dots to the right of the most recent deployment and select Promote to Production.
We do not recommend placing a reverse proxy in front of Vercel. A proxy can affect IP-based data, including country. It can also affect visitor identification, which uses a hash created from the incoming request.
It can also prevent Web Analytics from receiving events if it does not forward the requests.
Point your domain directly to Vercel. If you must use a proxy, review the reverse proxy guidance for supported options and requirements. Make sure your proxy forwards all pages you want to track, plus requests to /_vercel/insights/* and /<unique-path>/*, to your Vercel deployment.
Issue: Not all data is visible in the Web Analytics dashboard
How to fix:
- Verify that you are using the latest version of the
@vercel/analyticspackage. - Make sure you are using the correct import statement.
import { Analytics } from '@vercel/analytics/next'; // Next.js importimport { Analytics } from '@vercel/analytics/react'; // Generic React importWas this helpful?