Identify Users
Attach known user identity for reporting and conversion matching.
Use identify() when your app knows who the visitor is.
import { identify } from "@hellyeah/x-ray";
identify("user-123", {
email: "user@example.com",
phone: "+14155551234",
});Script tag
For a script-tag install, queue identify before the conversion call. Pass the email and phone you know. The queue keeps both calls in order until the deferred tracker script loads:
window._hy = window._hy || [];
window._hy.push(["identify", {
email: "user@example.com",
phone: "+14155551234",
}]);For Google Tag Manager, put the queue call in a Custom HTML tag:
<script>
window._hy = window._hy || [];
window._hy.push(["identify", { email: "user@example.com", phone: "+14155551234" }]);
</script>What gets stored
Email and phone values are normalized and hashed before storage. Raw email addresses and phone numbers are not stored.
When to call it
- After sign-up
- After login
- After checkout
- When a user submits a lead form
Why it matters
Identity improves reporting and conversion matching. It helps connect anonymous ad clicks to known outcomes while keeping raw contact details out of stored event data.