Overview
The Sunflower Capital website integrates two analytics solutions:- Vercel Analytics - Privacy-friendly, zero-config web vitals tracking
- Google Analytics 4 - Comprehensive user behavior and traffic analysis
Current Implementation
Both analytics providers are integrated in the root layout:src/app/layout.tsx
Vercel Analytics
Features
Web Vitals
Track Core Web Vitals (LCP, FID, CLS)
Privacy-First
GDPR compliant, no cookies required
Zero Config
Works automatically on Vercel deployments
Real User Data
Monitor actual user experience metrics
Installation
The package is already installed:package.json
Setup Steps
Component Already Integrated
The
<Analytics /> component is already added to layout.tsx (line 96).
No additional configuration needed!Enable in Vercel Dashboard
- Go to your project in Vercel
- Navigate to “Analytics” tab
- Click “Enable Analytics”
- Free tier includes 1 million events/month
Vercel Analytics starts collecting data immediately after enabling. No code changes required beyond the initial
<Analytics /> component.Development Mode
By default, Vercel Analytics only runs in production. To enable in development:Optional: Enable in Development
Google Analytics 4
Current Configuration
The site uses Google Analytics with ID:G-SR59L3T5LT
src/app/layout.tsx (line 98)
Package Details
Using Next.js official Google Analytics integration:package.json
This package provides optimized, performance-friendly Google Analytics integration specifically designed for Next.js applications.
Environment Variable Configuration (Recommended)
For better configuration management, consider moving the GA ID to an environment variable:Features Tracked
With this integration, Google Analytics automatically tracks:- Page views (including SPA navigation)
- User sessions and demographics
- Traffic sources and referrals
- Device and browser information
- Geographic location
- User engagement metrics
Viewing Analytics Data
Access Google Analytics
- Go to analytics.google.com
- Select your property (Sunflower Capital)
- View real-time and historical reports
Privacy Considerations
GDPR Compliance
GDPR Compliance
Google Analytics 4 is GDPR compliant when properly configured:
- Enable IP anonymization (enabled by default in GA4)
- Add privacy policy link to your website
- Consider adding cookie consent banner for EU visitors
- Configure data retention settings in GA4 admin
Cookie Usage
Cookie Usage
Data Privacy Settings
Data Privacy Settings
In your GA4 property settings, review:
- Data retention period (default: 2 months)
- Google signals (cross-device tracking)
- Data sharing settings
- User deletion requests handling
Custom Events (Optional)
To track custom interactions, you can add events:Custom events require
'use client' directive since they involve browser interactions.Performance Impact
Both analytics solutions are optimized for performance:Vercel Analytics
- ~1KB gzipped
- No impact on Core Web Vitals
- Loads asynchronously
Google Analytics
- ~17KB with @next/third-parties
- Script loaded with
afterInteractivestrategy - Minimal render-blocking
Troubleshooting
Vercel Analytics Not Showing Data
Vercel Analytics Not Showing Data
- Verify Analytics is enabled in Vercel dashboard
- Check that
<Analytics />component is inlayout.tsx - Wait 24-48 hours for initial data collection
- Ensure deployment is on Vercel (not local dev)
Google Analytics Not Tracking
Google Analytics Not Tracking
- Verify GA ID is correct (
G-SR59L3T5LT) - Check browser console for errors
- Disable ad blockers when testing
- View “Realtime” report in GA4 for immediate verification
- Ensure
@next/third-partiespackage is installed
Analytics in Development
Analytics in Development
Neither analytics service tracks development by default:
- Vercel Analytics: Add
mode="development"prop - Google Analytics: Will track but may be blocked by browser extensions
- Consider using separate GA4 properties for dev/prod
Analytics Comparison
| Feature | Vercel Analytics | Google Analytics 4 |
|---|---|---|
| Privacy | Cookieless, GDPR-friendly | Cookie-based |
| Setup | Zero config | Requires GA ID |
| Web Vitals | Built-in | Manual setup needed |
| User Journeys | Limited | Comprehensive |
| Custom Events | Basic | Advanced |
| Cost | Free tier: 1M events/mo | Free (unlimited) |
| Data Ownership | Vercel | |
| Real-time | Limited | Full real-time dashboard |
Using both provides the best of both worlds: privacy-friendly web vitals monitoring plus comprehensive user behavior analytics.
Next Steps
Vercel Deployment
Learn how to deploy to Vercel
Vercel Analytics Docs
Official Vercel Analytics documentation
GA4 Documentation
Google Analytics 4 help center
Next.js Third Parties
Optimize third-party scripts