| Property | Type | Required | Description |
| :------------------- | :----------------------- | :------- | :----------------------------------------------------------- |
| **event\_name** | `string` | Yes | The primary name of the event (e.g., `user_signup`). |
| **action\_category** | `string` | Yes | Group similar events (e.g., `ecommerce`, `auth`, `video`). |
| **object\_id** | `string` | No | ID of the object being interacted with (e.g., `product_id`). |
| **status** | `'success' \| 'failure'` | No | Outcome of the action. |
| **message** | `string` | No | Readable description or error message. |
| **additionalData** | `object` | No | Key-value pairs for extra context. |
***
## Usage Examples [#usage-examples]
```javascript
additionalData: {
user_info: { name: "John" } // ❌ Nested objects are NOT allowed
}
```
# Configuration (/docs/getting-started/configuration)
# Configuration [#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 [#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 [#api-key]
To use Ucoder Insight, you need to obtain an API key from the [Ucoder Dashboard](https://insights.ucoder.in). This key is required to authenticate your requests and access the features of Ucoder Insight. Here 3 types 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 identify 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 [#options-reference]
Here is a reference of the available configuration options in Ucoder Insight:
| Option Name | Type | Default Value | Description |
| :----------------- | :--------------------- | :------------ | :-------------------------------------- |
| `notFoundPath` | `string` \| `string[]` | `"/404"` | This is not track your not found path |
| `notTrackPath` | `string` \| `string[]` | `[]` | The paths to exclude from tracking. |
| `debug` | `boolean` | `false` | Enable debug mode for detailed logging. |
| `apiUrl` | `string` | `undefined` | Your custom backend URL. |
| `trackScroll` | `false` | `false` | Disable scroll tracking. |
| `trackPerformance` | `false` | `false` | Disable performance tracking. |
### `notFoundPath` [#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` [#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` [#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 using this option only in the development environment, as it may expose sensitive information in the logs.
| Metric | Page | Value | Insight |
| :-------------- | :------ | :-------- | :----------------------- |
| **Most Viewed** | `Home` | 15 views | Main entry point. |
| **Top Clicked** | `/form` | 17 clicks | High engagement area. |
| **Worst Error** | `Home` | 9 errors | **Needs immediate fix.** |
***
## Performance & Web Vitals [#performance--web-vitals]
This section measures the **Speed** and **User Experience (UX)** of your website based on real user data (RUM - Real User Monitoring).
{[
{
title: "LCP (Largest Contentful Paint)",
icon:
,
value: "306.4ms",
desc: "How long it takes for the largest image or text block to become visible. A fast LCP means users see content quickly.",
link: "https://developer.mozilla.org/en-US/docs/Glossary/Largest_contentful_paint",
},
{
title: "CLS (Cumulative Layout Shift)",
icon:
,
value: "0",
desc: "Measures visual stability. Does the layout shift unexpectedly while loading?",
link: "https://developer.mozilla.org/en-US/docs/Glossary/CLS",
},
{
title: "INP (Interaction to Next Paint)",
icon:
,
value: "0ms",
desc: "Responsiveness. How fast does the site react when a user clicks a button?",
link: "https://developer.mozilla.org/en-US/docs/Glossary/Interaction_to_next_paint",
},
{
title: "TTFB (Time to First Byte)",
icon:
,
value: "38.6ms",
desc: "Server Speed. How long the browser waits before receiving the first piece of data.",
link: "https://developer.mozilla.org/en-US/docs/Glossary/Time_to_first_byte",
},
].map((metric, i) => (
{metric.icon}
{metric.title}
{metric.value}
Status:{" "}
Good
))}
### Performance Benchmarks [#performance-benchmarks]
How do we decide if a score is "Good" or "Bad"? We follow Google's Web Vitals standards.
| Metric | Good | Needs Improvement | Poor |
| :------ | :-------------- | :---------------- | :-------------- |
| **LCP** | Less than 2.5s | 2.5s - 4.0s | More than 4.0s |
| **INP** | Less than 200ms | 200ms - 500ms | More than 500ms |
| **CLS** | Less than 0.1 | 0.1 - 0.25 | More than 0.25 |
| **FCP** | Less than 1.8s | 1.8s - 3.0s | More than 3.0s |