Controlling What Gets Tracked
The SDK tracks automatically, but you control what gets captured.
Pause and resume tracking
You can turn tracking on or off at any time:
import { disableSDK, enableSDK } from "@omni-analytics/sdk";
// Stop all tracking
disableSDK();
// Resume tracking
enableSDK();When disabled, the SDK stops collecting everything—no clicks, no page views, no session recordings.
When to disable tracking
Common use cases:
- During local development — avoid polluting analytics with test data
- Internal users — disable tracking for admins or support staff
- Sensitive workflows — pause tracking during checkout or authentication
You can also disable tracking at initialization:
initializeSDK({
projectId: "your-project-id",
endpoint: "https://omnioptimize-vdvv.onrender.com/ingest",
writeKey: "omni-public-write-key-here",
enabled: false, // Start with tracking disabled
});Protect sensitive elements
Use CSS classes to control what gets tracked. Add these to any element you want to protect:
om-no-capture
Completely exclude an element from tracking.
Use this when you don’t want Omni to track clicks or record this element at all.
<!-- This button won't be tracked -->
<button class="om-no-capture">Delete Account</button>
<!-- This entire form will be ignored -->
<form class="om-no-capture">
<input type="email" placeholder="Enter email" />
<button>Submit</button>
</form>om-mask
Hide text content in session recordings.
Protected by default:
- All input fields are masked — form values, passwords, and sensitive data are automatically hidden in recordings. You don’t need to do anything.
<!-- Text will be masked in recordings -->
<div class="om-mask">Your email: user@example.com</div>
<p class="om-mask">Billing address: 123 Main St, City, State 12345</p>om-ignore
Exclude elements from session recordings.
Use this to completely hide elements from recordings. They won’t appear at all.
<!-- Won't appear in session replays -->
<form class="om-ignore">
<input type="password" placeholder="Enter password" />
<button>Login</button>
</form>
<div class="om-ignore">
<!-- Payment details won't be recorded -->
<input type="text" placeholder="Credit card number" />
</div>When to use each class
| Class | Blocks clicks | Hides in recordings | Use for |
|---|---|---|---|
om-no-capture | âś… | âś… | Sensitive actions (delete, cancel, etc.) |
om-mask | ❌ | ✅ (text only) | Personal data (emails, addresses, names) |
om-ignore | ❌ | ✅ | Passwords, payment forms, auth pages |
Example: Protect a checkout page
<div class="checkout-page">
<h1>Checkout</h1>
<!-- Mask personal info in recordings -->
<div class="om-mask">
<p>Name: John Doe</p>
<p>Email: john@example.com</p>
</div>
<!-- Hide payment form completely -->
<form class="om-ignore">
<input type="text" placeholder="Card number" />
<input type="text" placeholder="CVV" />
<button>Pay Now</button>
</form>
<!-- Don't track cancel action -->
<button class="om-no-capture">Cancel Order</button>
</div>Important: These classes only work if you add them to your HTML. The SDK cannot retroactively protect data that’s already been captured.
What is tracked by default
When enabled, the SDK automatically captures:
- Page views — every navigation and URL change
- Clicks — what users click and where
- Sessions — anonymous user sessions with replay recordings
Your users’ sensitive data is protected automatically. The CSS classes (om-mask, om-ignore, om-no-capture) let you add extra protection when needed.