Logo

dev-resources.site

for different kinds of informations.

Analytics Tool For React Devs (Vercel Analytics Alternative)

Published at
1/9/2025
Categories
webdev
nextjs
analytics
react
Author
kartikmalik0
Categories
4 categories in total
webdev
open
nextjs
open
analytics
open
react
open
Author
12 person written this
kartikmalik0
open
Analytics Tool For React Devs (Vercel Analytics Alternative)

As a React developer, I often found myself wishing for more detailed geographical insights for my applications. This need became particularly apparent when working on my portfolio website hosted on Vercel. While Vercel's analytics were helpful, they lacked the granular city and region data I craved. That's when the idea for React Lens Analytics was born.

The Journey from Idea to Reality

Over three months, I poured my expertise and passion into creating a solution that would not only solve my problem but potentially help countless other React developers. The result? ReactLens Analytics - a platform-independent analytics tool designed specifically for React applications.

Quick Setup Guide

1. Install the Package

npm install react-lens-analytics
Enter fullscreen mode Exit fullscreen mode

2. Configure Environment Variables

For Next.js:

NEXT_PUBLIC_PROJECT_SECRET=your_project_secret_here
Enter fullscreen mode Exit fullscreen mode

For React:

REACT_APP_PROJECT_SECRET=your_project_secret_here
Enter fullscreen mode Exit fullscreen mode

3. Implementation

Next.js Setup:

// components/AnalyticsWrapper.tsx
'use client'
import React from 'react'
import { Analytics } from 'react-lens-analytics'

export function AnalyticsWrapper() {
  return (
    <Analytics projectId={process.env.NEXT_PUBLIC_PROJECT_SECRET!} />
  )
}

// app/layout.tsx
import React from 'react'
import { AnalyticsWrapper } from '@/components/AnalyticsWrapper'

export default function RootLayout({
  children,
}: {
  children: React.ReactNode
}) {
  return (
    <html lang="en">
      <body>
        {children}
        <AnalyticsWrapper />
      </body>
    </html>
  )
}
Enter fullscreen mode Exit fullscreen mode

React Setup:

// src/components/AnalyticsWrapper.tsx
import React from 'react'
import { Analytics } from 'react-lens-analytics'

export function AnalyticsWrapper() {
  return (
    <Analytics projectId={process.env.REACT_APP_PROJECT_SECRET!} />
  )
}

// src/App.tsx
import React from 'react'
import { AnalyticsWrapper } from './components/AnalyticsWrapper'

function App() {
  return (
    <div>
      <AnalyticsWrapper />
      {/* Your app content */}
    </div>
  )
}

export default App
Enter fullscreen mode Exit fullscreen mode

Key Features That Set ReactLens Apart

  1. Platform Independence: Whether you're using Vercel, Netlify, AWS, or any other hosting platform, React Lens works seamlessly with your setup.
  2. Detailed Geographical Insights: Get the city and region-level data that other analytics tools often miss.
  3. Privacy-Focused: We've built React Lens with a strong emphasis on user privacy, ensuring you can gather insights without compromising ethical standards.
  4. Easy Integration: Set up React Lens in your project in just a few minutes, with minimal code changes required.
  5. Completely Free: Access powerful analytics without any cost, making it accessible for developers at any stage of their journey.

Resources and Community

What's Next for React Lens?

We're actively working on exciting new features:

  • Advanced filtering capabilities
  • Custom event tracking
  • Enhanced data visualization options
  • API improvements for better integration

Join Our Community

ReactLens Analytics is more than just a tool - it's a growing community of developers passionate about understanding their applications better. Your feedback and experiences will be invaluable in shaping its future.

Get Started Today

  1. Visit reactlens.kartikmalik.tech
  2. Create your free account
  3. Follow our simple setup guide
  4. Start discovering insights about your users

Have you faced similar challenges in getting detailed geographical data for your React apps? Share your experiences in our Discord community - we'd love to hear your story!

Remember, great insights lead to better applications. Give React Lens Analytics a try today and discover what you've been missing about your audience!

nextjs Article's
30 articles in total
Favicon
Open-Source TailwindCSS React Color Picker - Zero Dependencies! Perfect for Next.js Projects!
Favicon
Have you ever used `git submodules`?
Favicon
Open-Source React Icon Picker: Lightweight, Customizable, and Built with ShadCN, TailwindCSS. Perfect for Next.js Projects!
Favicon
Run NextJS App in shared-hosting cPanel domain!
Favicon
10 Must-Have VS Code Extensions for 2025 🔥
Favicon
has anyone find a fix for this issue on build of next and payload CMS version 2 (sharp issue) ./node_modules/sharp/build/Release/sharp-win32-x64.node Module parse failed: Unexpected character ' ' (1:2) You may need an appropriate loader to handle this
Favicon
Github Actions with Vercel in 2024
Favicon
Building Production-Grade Web Applications with Supabase – Part 1
Favicon
Simplifying API Routes in Next.js with next-api-gen
Favicon
How to Create and Consume a REST API in Next.js
Favicon
100 Days of Code
Favicon
Nextjs + Openlayers integration
Favicon
Deploying a Next.js UI App on S3 Using Jenkins🤩
Favicon
#Vinnifinni
Favicon
How to Combine English Folders with Polish Paths in Next.js (Rewrites, Redirects, and Middleware)
Favicon
Nextjs 15
Favicon
The "images.domains" Configuration is Deprecated 🐞
Favicon
Shared form with config files in NextJs
Favicon
Page can't be indexed in Google Search Console
Favicon
Why I Chose Node.js Over Next.js for My Website's Back-End
Favicon
How to add Email and Password authentication to Nextjs with Supabase Auth
Favicon
Analytics Tool For React Devs (Vercel Analytics Alternative)
Favicon
Harnessing the Power of Self-Hosted Supabase on Coolify: A Complete Guide to Server Setup and OAuth Providers Integration
Favicon
Smart and Modular Validation Toolkit
Favicon
How to customize Next.js metadata
Favicon
How to Use TensorFlow.js for Interactive Intelligent Web Experiences
Favicon
How to add Github oAuth in Nextjs with Supabase Auth | Login with Github
Favicon
NextJs: How to create a dedicated layout file for index page
Favicon
checa como se hace una conexión entre nextjs y la autenticación de supabase
Favicon
📣 Calling All Programmers!

Featured ones: