Skip to main content

Customer User IDs

Customer User IDs.svg

Assign internal User IDs to tracked sessions

You can now assign your own internal user IDs to the visitors tracked by the fraud0 tag. This can support improved attribution, cross-session analysis, and help you connect data more effectively in your backend systems. The ID is sent client-side and linked to the current session on our servers — giving you a straightforward way to reference known users once they’ve been identified (e.g. after login).

What’s new? We’ve added a method to our Onsite script that allows you to send a customer_user_id once the user is known (e.g. after login). The ID is automatically associated with the session server-side.


Step 1: Include the fraud0 tag early on your page

HTML
<script async src="https://api.fraud0.com/api/v2/fz.js?cid=YOUR_TAG_ID"></script>

Step 2: Once the user logs in or is identified, call:

JS
window.fraud0?.setCustomerUserId?.("your-user-id");

Example:

JS
login().then(() => {
  const userId = getCurrentUserId();
  window.fraud0?.setCustomerUserId?.(userId);
});

Step 3: Track conversions as usual

JS
window.fraud0 = window.fraud0 || [];
window.fraud0.push(['purchase', 'order-123']);

You can call setCustomerUserId() before or after a conversion — as long as it's in the same session, the ID will be included during session aggregation.

Note

  • You can call setCustomerUserId() multiple times; the latest value is used for the session.

  • The value must be a string, 1–255 characters long.

  • This feature is backward-compatible with all existing conversion tracking methods (e.g., fraud0.push(['purchase'])).


Need support?

Do you still have questions or require further details? Contact our support team for assistance!

Send us an email →

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.