Coupons, referral credit and sign-up bonuses go to new customers, not to the same person with ten accounts.
What you will build: a check on the action you protect that allows normal users, asks doubtful ones to verify, and blocks the clear cases. See the promo and bonus abuse overview for the attack in pictures.
Before you start
Finish one Web quickstart (for example JavaScript or React) and one Server quickstart (for example Node.js). The decision code below is TypeScript; every server SDK returns the same event.
How the attack works
- Coupon farming. New accounts just to reuse a first-order code.
- Referral loops. Inviting yourself from a second browser.
- Bonus hunting. Claim, withdraw, repeat with a fresh email.
What to look at
| Field | Why it matters here |
|---|---|
deviceId | One id for every browser on the machine. Shared by every browser on one device. Store it with the account or the action. |
multiAccount | Too many accounts on one device. |
privacyBrowser | Explains lower confidence, never a block on its own. |
- 1
Identify on the action
Call the browser SDK when the user performs the action, not on page load, and send the
eventIdwith the request. Pass your own user id aslinkedIdwhenever you have one: the account signals count by it.TypeScriptconst { eventId } = await trace.get({ linkedId: user?.id, tags: { action: 'promo-abuse' } }); - 2
Verify on your server
import { verifyEvent } from '@trace-id/sdk-node'; const event = await verifyEvent(eventId, { secretKey: process.env.TRACE_SECRET_KEY!, endpoint, timeoutMs: 1500 }).catch(() => null);try: event = client.get_event(event_id) except trace_device.VerifyError: event = None # fail opentry { $event = $client->getEvent($eventId); } catch (Trace\VerifyError $e) { $event = null; }Map<String, Object> event = null; try { event = trace.getEvent(eventId); } catch (Trace.VerifyException e) { /* fail open */ }const event = await trace.verify(eventId).catch(() => null);Events can be verified for 60 minutes. If verification fails, decide whether to fail open or closed; for most of this flow, fail open.
- 3
Decide
TypeScriptconst event = await trace.verify(eventId); const used = await db.redemptions.exists({ code, deviceId: event.deviceId }); if (used) return reject('Offer already used on this device'); await db.redemptions.insert({ code, deviceId: event.deviceId, userId });trace.verify()is the embedded call; with a server SDK, use theeventfrom step 2 instead. The thresholds are yours. Trace scores and explains;event.reasonslists which signals added how much, so log it with every decision.
Example decisions
Redemptions of WELCOME20, illustrative:
| Account | Device | Decision | Why |
|---|---|---|---|
| acct_1042 | Device A | Allow | First redemption on device A |
| acct_1043 | Device B | Allow | Different device |
| acct_1051 | Device A | Block | Code already used on this device |
| acct_1066 | Device A, Firefox | Block | Linked browser on device A |
Roll it out
- Ship steps 1 to 3 with logging only: record the decision, block nothing.
- After a week, look at who would have been blocked or asked to verify. Shared computers, offices and privacy tools are the usual false positives.
- Turn on Verify first, then Block for the clearest cases.