LearnIdentify Visitors

Identify Visitors

Link a consented visitor's sessions to an identity after login, signup, or consent.

Identify a visitor

By default, Hardal tracks anonymous sessions. After a visitor grants consent and logs in or signs up, you can send identity fields. Hardal can then preserve the supplied user ID and recognize later activity for the same tenant and source.

Only identify a visitor who has granted consent. Without consent, Hardal keeps the session anonymous. See Consent Signals.

<script>
virgo.identify("USR_8827", {
  email: "alex@example.com",
  firstName: "Alex",
  lastName: "Rivera"
});
</script>

The first argument is your stable user or customer ID. The second argument contains optional traits. Calling virgo.identify() with only an object sends traits but does not set userId.

Server-side identify calls use "type": "identify", "eventName": "identify", and payload.userId. See Send Events API for the full payload shape.

Identify fields

When to identify a visitor

Call virgo.identify() immediately after a visitor:

  • logs in
  • signs up
  • gives consent while already signed in

With granted consent, future collected events can carry the same visitor identity.