Merged
Conversation
Installed and configured Vercel Web Analytics for Nuxt ## Changes Made ### 1. Package Installation - Added `@vercel/analytics` version 1.6.1 to dependencies in package.json - Updated yarn.lock with the new dependency ### 2. App.vue Configuration - Added a `<script setup>` section to import Analytics component from '@vercel/analytics/nuxt' - Added `<Analytics />` component to the template alongside existing components (Toaster, NuxtPage) - Preserved existing code structure including the legacy `<script>` section for Toaster component ### Implementation Details The Analytics component was placed at the root level of the app alongside the Toaster component, ensuring it tracks all page views and interactions across the application. The implementation uses Nuxt's native integration path (`@vercel/analytics/nuxt`) for optimal compatibility. ### Testing & Verification ✅ Build completed successfully (yarn build) ✅ Linting passed with no new errors (yarn lint) ✅ All unit tests passed (yarn test - 6/6 test files, 19/19 tests) ✅ Lock file updated (yarn.lock) ## Files Modified - `app.vue` - Added Analytics component and script setup - `package.json` - Added @vercel/analytics dependency - `yarn.lock` - Updated with new dependency resolution The implementation follows Nuxt best practices and preserves all existing functionality while adding Vercel Web Analytics tracking capabilities. Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
Contributor
Author
|
The latest updates on your projects. Learn more about Vercel 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.
Installed and configured Vercel Web Analytics for Nuxt
Changes Made
1. Package Installation
@vercel/analyticsversion 1.6.1 to dependencies in package.json2. App.vue Configuration
<script setup>section to import Analytics component from '@vercel/analytics/nuxt'<Analytics />component to the template alongside existing components (Toaster, NuxtPage)<script>section for Toaster componentImplementation Details
The Analytics component was placed at the root level of the app alongside the Toaster component, ensuring it tracks all page views and interactions across the application. The implementation uses Nuxt's native integration path (
@vercel/analytics/nuxt) for optimal compatibility.Testing & Verification
✅ Build completed successfully (yarn build)
✅ Linting passed with no new errors (yarn lint)
✅ All unit tests passed (yarn test - 6/6 test files, 19/19 tests)
✅ Lock file updated (yarn.lock)
Files Modified
app.vue- Added Analytics component and script setuppackage.json- Added @vercel/analytics dependencyyarn.lock- Updated with new dependency resolutionThe implementation follows Nuxt best practices and preserves all existing functionality while adding Vercel Web Analytics tracking capabilities.
View Project · Web Analytics
Created by Andreas Frøyland (ananords) with Vercel Agent