Install
Audience: Developers, tracking engineers, BI / analytics owners Time to install: ~15 minutes
The Web Tracker is a lightweight JavaScript SDK that streams user events from your website to RevoSurge. Once your key events are Live, they become optimization targets for AdWave campaigns and power Source Intelligence, LTV, ROAS, and churn models.
TL;DR
- Add the script to
<head>. - Initialize
WebTrackerwith your Tracker ID intestmode. - Fire events on register, deposit, and other key actions.
- Verify they read Live, then switch to
prod.
Before you start
Make sure you have:
- A RevoSurge account with Product management access
- A Product created for your website domain (this assigns your Tracker ID)
- Access to your website codebase or tag manager
- A list of the key events you want to track (e.g.
register,deposit,withdraw)
Don't have a Tracker ID yet?
Create one first — see Step 1. Your Tracker ID looks like TRA-AWP-20251208-051428-001-6734 and is shown in your product's tracking settings.
Step 1: Create a Product (domain)
- Go to Product → Manage Product.
- Create your product (enter your website domain, e.g.
www.example.com).
This creates the Product and assigns a Tracker ID. You'll paste this ID into the snippet in Step 3, or copy the pre-filled snippet from Product → Install web tracker.
Step 2: Add the tracker script
Add this to the <head> of every page you want to track, as high as possible so it loads before user actions occur.
<script src="https://assets.revosurge.com/js/web-tracker.js"></script>Using Google Tag Manager?
Add a Custom HTML tag with the snippet above, set it to fire on All Pages, and set the tag priority high so the tracker is ready before your event tags run.
Step 3: Initialize the tracker
Initialize once, after the script has loaded. Replace the Tracker ID with your own.
const tracker = new WebTracker({
trackerId: "your-product's-tracker-id",
env: "test" // "prod" | "test" | "dev"
});Start in test while you integrate — test traffic is validated and visible in your dashboard but excluded from campaign optimization. Switch to prod only after your events verify in Step 5.
env | When to use it | Counts toward optimization? |
|---|---|---|
prod | Live production traffic | Yes |
test | Staging / QA during integration | No |
dev | Local development | No |
Step 4: Send key events
Call a tracking method when the corresponding user action happens. Pass a stable user ID as the first argument so events can be tied to the same person over time.
// New account created
tracker.trackRegister("user_123", {
identifier: "hashed_email_or_phone"
});
// Deposit completed
tracker.trackDeposit("user_123", {
currency: "USDT",
network: "TRON",
amount: 100
});The SDK ships a typed helper for each event in the catalog (register, login, deposit, withdraw, and more). For the full list of methods and their fields, see the Web Tracker SDK Reference.
Never send raw PII
Pass identifier as a SHA-256 hash of the user's email or phone — hash it on your side before calling the tracker. Do not send raw emails, phone numbers, or names.
Choosing a user ID
Use the same ID you use internally (e.g. your account/user primary key). Consistent IDs across the Web Tracker and Server Events (S2S) let RevoSurge stitch web and server activity into one user profile.
Step 5: Verify, then go live
Open Tracking → Status and watch for events to arrive (usually within a minute).
Tracker status
| Status | Meaning |
|---|---|
| Active / In-use | Events are flowing |
| Inactive | No recent data received |
Event status
| Status | Meaning |
|---|---|
| Live | Ready to use as a campaign optimization target |
| Inactive / Not ready | Insufficient data or no recent events |
When your key events read Live:
- Change
envto"prod"in your initialization. - Redeploy.
- Your Product is ready for AdWave campaigns.
What your events unlock
The events you send determine which RevoSurge features become available:
| Events you send | Unlocks |
|---|---|
register, login | Source Intelligence · Reg→FTD funnel |
deposit, withdraw, bet | True LTV · ROAS · Predicted LTV / churn · Bonus Engine |
The more of the catalog you cover, the more accurate targeting and optimization become.
Troubleshooting
Events aren't showing up
- Confirm the script tag is in
<head>and loads (check the Network tab forweb-tracker.js). - Make sure
new WebTracker({...})runs after the script loads. - Check the
trackerIdmatches the one in your product settings exactly. - Remember
testevents won't appear in production/optimization views — check the test view.
Events show as "Not ready" / never go Live
An event needs enough recent volume to be marked Live. Send real (or realistic test) traffic and give it time to accumulate. Sparse or one-off events stay inactive.
Can I track from my server instead of the browser?
Yes. For backend-generated events (payments confirmed server-side, KYC, bonuses), use the Server Events API (S2S) instead of — or alongside — the Web Tracker.
Next steps
- Web Tracker SDK Reference — every method and field
- Server Events API (S2S) — send events from your backend
- Campaign Setup — launch your first AdWave campaign