Skip to main content

Include the SDK

Add the following <script> tag inside your HTML’s <head> (or just before </body>) to load the Experro Analytics library:
Once the script is loaded and ready, it dispatches an exp-analytics-loaded event on both the document and window objects. You can listen to this event to begin tracking analytics events.
- Placing it in <head> ensures tracking begins as soon as possible.

- If you’re concerned about page‑render performance, you can move it just before </body>, but make sure your initialization code runs after the script has loaded.

Prerequisites

Before initializing the SDK, you’ll need the following from the Experro admin panel:
  • Tenant ID (tenantId) Your unique identifier for billing and data partitioning.
  • Workspace ID (workspaceId) Choose or create a workspace to segment events by functional area.
  • Environment ID (environmentId) Use distinct values (e.g. dev, staging, prod) to isolate test data from production.
  • Channel ID (channelId) Typically "web", but you can define custom channels (e.g. "mobile-web", "kiosk-app").
  • Language / Locale (language) A locale code (e.g. "en-US", "fr-FR") to help you segment by user region.
Make sure you have these five values handy in your application’s configuration before moving on to next step.