Getting started
Embed & Configure the SDK
Embed the SDK into your website.
Trigger tracking events
Use predefined and custom methods for user events tracking.
Functional Verification
Simple steps to check if the SDK works properly.
Embed & Configure the SDK
Follow these steps to integrate the Web Tracker SDK into your website.
1. Include the SDK Script
First, you need to include the Web Tracker SDK script in your website's HTML. Place the following script tag in the `` section of your HTML file. This will load the SDK and make it available for use.
<script src="https://assets.revosurge.com/js/web-tracker-prod.js"></script> 2. Initialize the SDK
Next, initialize the SDK by creating a new `WebTracker` instance. You'll need to provide your unique tracker ID and other configuration options. This should be done in a script tag in the `` of your HTML, after the SDK script has been included.
const tracker = new WebTracker({
trackerId: 'example'
});
Parameters
Identifier assigned to your RevoSurge tracker.
Trigger tracking events
The SDK captures a baseline of behavior automatically and gives you hooks for the key business milestones you want to measure.
Automatic events tracking
With autoTrack enabled, these events fire without additional code and provide a complete journey timeline.
Emitted once per browser when no uv_{trackerId} marker exists in storage (with cookie fallback).
Dispatched on SDK init with full page metadata whenever auto tracking is enabled.
Captures every document click with element identifiers and pointer coordinates.
Sent on debounced scroll events with scroll_top and calculated scroll_percent.
Tracks form submissions and reports the form ID, action URL, and field count.
Raised when the document visibility switches to hidden (tab backgrounded/navigation away).
Raised when the page becomes visible again after a visibility change.
Triggered on beforeunload/pagehide once per session with the session duration.
Manual events tracking
There are also predefined user events to log business-specific milestones:
Event register
REGISTER
Primary identifier issued once the user has an account in your system.
Hashed email or phone captured pre-signup to aid identity stitching.
tracker.trackRegister({
user_id: 'user_123',
identifier: '422be6ee64996639ccb75b562c08a32479c16f8fd91ecc6eb8c954d1f737fd32'
});
Event download_click
DOWNLOAD_CLICK
Channel where the download happened, e.g. app_store, play_store.
tracker.trackDownloadClick({
store_type: 'App Store'
});
Event login
LOGIN
User ID used to authenticate and resume a session.
tracker.trackLogin({
user_id: 'user_123'
});
Event deposit
DEPOSIT
Currency used for the funding action, e.g. USDT.
Blockchain or payment network, e.g. TRON, ETH.
Numeric value of the deposit denominated in the selected currency.
tracker.trackDeposit({
currency: 'USDT',
network: 'TRON',
amount: 100.00
});
Event enter_game
ENTER_GAME
Currency selected for gameplay transactions.
Internal identifier for the game title.
Name of the partner studio or provider.
tracker.trackEnterGame({
currency: 'USDT',
game_id: 'gamer_123',
game_provider: 'provider_xyz'
});
In addition, SDK provides a custom event tracker method for self-defined events.
Event CUSTOM_EVENT
tracker.trackCustomEvent('custom_event_type', {
event_detail: 'details'
});
Functional Verification
Run these checks in your browser to confirm the SDK is embedded and emitting events:
Confirm the SDK bundle loads
Open your page, launch DevTools (Cmd+Option+I / Ctrl+Shift+I), and verify web-tracker-1.2.0.js renders under the Sources panel without 404s.
Check initial auto tracking
With DevTools open, switch to the Network tab, reload, and filter for /collect. A successful page_view POST returning 2xx confirms automatic bootstrapping.
Exercise built-in events
Click around, scroll past mid-page, or submit a form and watch follow-up requests report the matching event_type values (e.g. click, scroll, form_submit).
Validate manual triggers
Run any manual snippets you integrated and confirm they emit additional /collect POSTs without console errors or blocked network calls.