Skip to Content
Getting StartedConfiguration

Configuration

In this section, we will explore the various configuration options available in Ucoder Insight. Proper configuration is essential to ensure that you get the most out of the tool and that it fits seamlessly into your development workflow.

General Settings

The general settings allow you to customize the overall behavior of Ucoder Insight. This includes options for data collection, performance optimization, and user interface preferences.

API key

To use Ucoder Insight, you need to obtain an API key from the Ucoder Dashboard . This key is required to authenticate your requests and access the features of Ucoder Insight.Here 3 tyeps of API keys are available:

  • Public Key: This key is used for client-side applications and has limited permissions. It is safe to expose this key in your frontend code.

  • Secret Key: This key is used for server-side applications and has full permissions. It should be kept secure and never exposed in client-side code. It is needed for features that require access to sensitive data or actions, such as managing projects or accessing detailed analytics.

  • Ownership Key: This key is used for idntify the owner of the project. It is used for features that require ownership verification, such as transferring project ownership or accessing certain administrative features.

Options Reference

Here is a reference of the available configuration options in Ucoder Insight:

Option NameTypeDefault ValueDescription
notFoundPathstring | string[]"/404"This is not track your not found path
notTrackPathstring | string[][]The paths to exclude from tracking.
debugbooleanfalseEnable debug mode for detailed logging.

notFoundPath

  • This option allows you to specify a path or an array of paths that should be used for redirecting users when a page is not found. By default, it is set to "/404", which means that users will be redirected to the /404 page when they encounter a 404 error. You can customize this path to fit your application’s structure and design.

notTrackPath

  • This option allows you to specify a path or an array of paths that should be excluded from tracking. By default, it is set to [], which means that all paths will be tracked. You can customize this path to fit your application’s structure and design. For example, if you have certain pages that you do not want to track for analytics purposes, you can add those paths to the notTrackPath option.

debug

  • This option enables debug mode, which provides detailed logging of Ucoder Insight’s operations. By default, it is set to false, meaning that debug mode is disabled. When you set this option to true, you will receive more verbose logs in the console, which can be helpful for troubleshooting and understanding how Ucoder Insight is functioning within your application. But consider to use this option only in development environment, as it may expose sensitive information in the logs.

  • note : Enble ths mode no api call will be send to our server, all data will be log in console. It is useful for development and debugging purpose, but it will not provide accurate data for analytics and insights.

Example Usage

Here is an example of how to configure Ucoder Insight with the notFoundPath and notTrackPath options:

Next.js Configuration

Pass options via the config prop in initUcoderInsight.

app/analysis.tsx
import {initUcoderInsight} from 'ucoder-insight'; initUcoderInsight("YOUR_PROJECT_KEY", { // Optional: Custom 404 path. Supports wildcards e.g. 'notfound/*' // Default is 'autodetect' notFoundPath: '/notFoundPage', // Optional: Paths to ignore. // '/admin/*' will ignore all pages starting with /admin notTrackPath: ['/privacy', '/terms', '/admin/*'] });

Element-Level Tracking Control (Not Track Attribute)

To exclude specific elements from tracking, add the data-uca-track="false" attribute to any HTML element. This is useful for sensitive information or elements that do not require analytics.

<button data-uca-track="false" class="px-4 py-2 bg-red-500 text-white rounded" > This content will not be tracked by Ucoder Insight. </button>

You can also use data-uca-track="true" to force tracking on specific elements even if they are within a not track path.


Input Tracking Policy

Automatically Blocked Inputs

  • type=“password”
  • type=“email”
  • type=“tel”
  • type=“text”
  • type=“number”
  • type=“search”
  • type=“url”
  • type=“date”
  • type=“time”
  • type=“datetime-local”
  • type=“month”
  • type=“week”
  • type=“color”
  • type=“range”
  • type=“file”
  • type=“hidden”

Tracked Input Types

  • type=“checkbox”
  • type=“radio”
  • type=“submit”
  • type=“button”
  • type=“reset”

These input types are safe to track as they don’t contain sensitive user data.

Last updated on