Skip to Content
Getting StartedConfiguration

Configuration

Powerful Customization

Customize how Ucoder Insight captures and processes data. The SDK comes with sensible defaults, but you can fine-tune almost every aspect of tracking behavior.

Options are passed to the config prop in the Provider or the init method in Vanilla JS. Start with the defaults and customize only what you need.


API key

  • Public Traking ID : This is a public identifier for your project and is safe to include in client-side code. It allows the SDK to send data to the correct project on our servers.

  • Secret Key : This is a private key used for server-side authentication and should never be exposed in client-side code. Our future server-side features will require this key, but for client-side tracking, you only need the public Traking ID.

Options Reference

Below is the full list of available configuration options. Each option can be customized to match your tracking requirements.

OptionTypeDefaultDescription
notFoundPathstring | string[]autoCustom path patterns for 404 error pages.
notTrackPathstring | string[][]Routes or folders to exclude from tracking.
Not Found Path

The notFoundPath option allows you to manually specify paths for 404 pages. Wildcards are supported (e.g., /not-found/*). By default, the SDK attempts to autodetect 404s, but this option offers more control for Single Page Applications (SPAs).

Not Track Path

The notTrackPath option lets you define specific routes that should be completely ignored by the analytics engine. This is useful for admin dashboards, draft previews, or sensitive internal routes.

Performance Optimization Tip

Avoid adding large arrays of specific URLs (e.g., listing 100s of user IDs). This can negatively affect initialization time.


Best Practice: Always use wildcards (e.g., /admin/*) to exclude entire folders at once. Keeping your configuration concise ensures the SDK remains lightweight and fast.


Implementation

Choose your framework

Select your framework below to see the recommended configuration approach.

Next.js Configuration

Pass options via the config prop in initProject.

app/layout.tsx
import {initProject} from 'ucoder-insight'; initProject("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/*'] });

Not track elements

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