Skip to main content
TayStack

Identify users

Link a visitor to your own user id with taystack("identify", ...): what is sent, what is stored, and a privacy note.

Identify a visitor

Call taystack with identify once you know who the visitor is, for example after they sign in.

JavaScript
taystack('identify', { userId: 'user_8421', email: '[email protected]' })

Fields

  • userId: required. A string or a number, turned into text and cut to 256 characters. An empty value or any other type means nothing is sent.
  • email: optional. Sent only if it is a non-empty string. It is stored with the identify event as a property.
  • Any other field is ignored.

What it does

  • Sends one identify event with that user id (and the email, if given).
  • Saves the user id in a first-party cookie, taystack_user_id, for one year. Later events from the same browser (pageviews and custom events) carry that user id, which links the visitor's earlier anonymous activity to the user.
  • There is no call to clear it. The identity stays until the cookie expires or the visitor clears their cookies.

Privacy note

  • Use an opaque id from your own system as userId, not an email address or a name.
  • Whatever you send as userId and email is stored as you send it. Only send an email if you have the right to, and say so in your own privacy policy.
  • TayStack does not store raw IP addresses.

More on what is stored: Privacy (a draft that has not been legally reviewed).