Analytics

AiAgentNexus Analytics Overview

Below is a summary of available analytics integrations for the AiAgentNexus open-source project, including details for configuring Vercel Analytics and Google Analytics 4. AiAgentNexus can be deployed across various environments—such as Docker, Vercel, Cloudflare, and custom server configurations—and this guide addresses how to set up analytics in each scenario.


Analytics Services

  1. Vercel Analytics

    • Supported: automatic configuration when hosting on Vercel

    • Purpose: gain insights into overall site engagement, pinpoint performance issues, and collect usage metrics without tracking individuals

  2. Google Analytics 4

    • Requires: manual setup

    • Purpose: detailed analysis of user interactions, measuring retention and feature usage, with possibilities for advanced customization


Vercel Analytics Setup

  • Why Use It: Offers a high-level picture of traffic patterns, common referring sites, rough geographic data, and load performance.

  • Key Metrics: Pages viewed, referring sites, approximate user locations, operating systems, browsers, and page speed data.

  • Privacy Considerations: Designed to be privacy-focused, with no tracking of personal user data.

  • Availability: Vercel Analytics is automatically integrated when you deploy AiAgentNexus on Vercel, provided you have it enabled in your Vercel project settings.

In the AiAgentNexus code, you can see references to Vercel Analytics within src/pages/_app.tsx. Specifically:

These components activate when the environment variable process.env.NEXT_PUBLIC_VERCEL_URL is recognized, indicating that the app is running on Vercel. To use this feature, turn on Analytics in your project’s Vercel dashboard.


Google Analytics 4

  • Why Use It: Offers robust metrics on user engagement, retention rates, and performance, with additional features like personalization and content optimization.

  • Where to Learn More: Google’s Help Center

To enable Google Analytics 4, set the NEXT_PUBLIC_GA4_MEASUREMENT_ID environment variable before you build the app or Docker image. This ID will send analytics data directly to your GA4 property, facilitating a comprehensive view of how users engage with your instance of AiAgentNexus.


Configuration Reference

Deployment Method

Default Setting

Configuration Notes

Local Build from Source

None

- Vercel: Enable Analytics within the Vercel dashboard. - Google Analytics: Provide NEXT_PUBLIC_GA4_MEASUREMENT_ID before building.

Docker Build

None

- Vercel: Not applicable when self-hosting. - Google Analytics: Supply the GA4 measurement ID as an environment variable during docker build.

Vercel & Google

Main website uses both for general metrics. For privacy details, see this policy.

Google Analytics

- Vercel: Not relevant to Docker images. - Google Analytics: Reporting is tied to the AiAgentNexus.com property for analytics and improvement.