Identify customers

Tell Clakta who the visitor is with clakta.identify(), so their journey follows the person instead of the browser.

Clakta tracks anonymous visitors by default. When someone logs in or signs up on your site, clakta.identify() tells Clakta who they are, so what they did before and after logging in belongs to one customer.

This only works in full attribution projects, and it needs a developer to add it to your site.

How to use it

Call it as soon as you know who the visitor is, such as on login or signup:

You can call it right after init(). Clakta waits until it is ready and then sends it.

Identifiers

You must send at least one of these, or the call is ignored:

FieldUse it for
externalIdThe customer's id in your own system. The most reliable option.
claktaCustomerIdA Clakta customer id you already have, such as cust_1234567890.
emailThe customer's email, when you have nothing more stable.

You can also send name and phone (with country code, such as +5511999999999). Anything else you send is saved as extra information:

Prefer externalId to email. People change their email, and the same customer would then become two.

Where to call it

  • On login: the most useful place. It links what the visitor did before logging in to the person.
  • On signup: the moment a visitor becomes a customer.
  • On any page where the user is logged in: calling it again is harmless.

Calling it again with the same identifier is safe, and updates the extra information you send.

Why nothing shows up

identify() does nothing in privacy-friendly projects, or when the visitor refused consent. If you call it and the Users section stays empty, check the project's tracking mode first. With debug: true, the browser console shows Skipping identify (privacy_friendly mode or consent withheld). See Tracking modes.

Related articles