> ## Documentation Index
> Fetch the complete documentation index at: https://help.experro.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

### What Is Experro Analytics Pixel?

Experro Analytics SDK is a lightweight JavaScript library for capturing user interactions on your website — page views, link clicks, eCommerce actions, authentication events, and any custom events you define — and streaming them in real time to your Experro Analytics service for reporting and insights. It’s a self‑hosted, tenant‑scoped solution that gives you full control over your data pipeline and event schema.

### Key Concepts

* **Tenant ID**
  Every organization in Experro Analytics is scoped under a tenant. The `tenantId` you pass to the SDK determines which account your events are billed to and which workspace configurations apply.

* **Workspace ID**
  A tenant can host multiple workspaces (for example, “Shopping”, “Blog”, “Support”). The `workspaceId` enables you to segment events by area, with independent dashboards and settings.

* **Environment ID**
  Use separate `environmentId`s (for example, “dev”, “staging”, “prod”) so that development‑time events don’t mix with your production analytics.

* **Channel ID**
  A channel represents the delivery medium—typically “web” for browser‑based tracking, but you can define other channels (for example, “kiosk‑app”, “mobile‑web”) to split out traffic sources in your reporting.

* **Locale / Language**
  The `language` tag on each event helps you filter or segment your analytics by user locale, useful for internationalized sites.

### How It Works at a High Level

1. **Include the SDK**

   Add a single script tag pointing to our CDN:

```html theme={null}
<script>
window.ExpConfigs = {
  analyticsUrl: 'https://YOUR_BASE_URL/analytics-service/v1',
  tenantId: 'YOUR_TENANT_ID',
  workspaceId: 'YOUR_WORKSPACE_ID',
  envId: 'YOUR_ENV_ID',
  channelId: 'YOUR_CHANNEL_ID',
  channelLocale: 'YOUR_CHANNEL_LOCALE',
  currency: 'YOUR_CURRENCY'
}

const script = document.createElement("script");
script.src = "https://cdn22.myexperro.com/experro-analytics-library/analytics-sdk-v1.min.js";
document.head.appendChild(script);
</script>
```

2. **Automatic Event Capture**

   By default, the SDK will:

   * Begin a new session (`track_sessions`)
   * Track clicks on `<a>` elements (`track_links`)
   * Optionally capture device orientation if enabled

3. **Manual Event Logging**

   Use the `add_event` function to push any custom event with counts, sums, durations, and segmentation to your dashboard.

4. **Payload Delivery**

   Events are sent immediately (or buffered if offline/batching is enabled), with the appropriate headers (`x-tenant-id`, `x-workspace-id`, etc.) so your backend can authenticate and route them correctly.
