Back to Docs
Installation

Identifying Visitors with umami.identify

1 min read
Identifying Visitors with umami.identify

What identify Does

Besides tracking pageviews and events, the tracker exposes umami.identify(), which attaches extra context to the current visitor’s session. Use it to record session-level attributes (like the plan a logged-in user is on, or an internal account ID) so you can segment your analytics by them later.

The global umami object is available on any page where the tracking script is installed.

Basic Usage

Pass a data object with the properties you want to attach to the session:

umami.identify({ plan: 'premium', accountAge: 90 });

You can also pass a string identifier, optionally followed by a data object:

// Identifier only
umami.identify('user-12345');

// Identifier plus extra data
umami.identify('user-12345', { plan: 'premium' });

When to Use It

  • Tag sessions of signed-in users with their plan, role, or cohort.
  • Attach a stable internal ID so repeat visits can be grouped.
  • Record any non-personal attribute you want to break analytics down by.

Privacy Guidance

Do not pass personal data such as full names, email addresses, or phone numbers. EuroMetrics is built on privacy-first, anonymized analytics, so keep identifiers opaque (for example, a hashed account ID) and limit attributes to non-personal context.

Safe Calling

If your code might run before the script has loaded, guard the call:

if (window.umami) {
  umami.identify({ plan: 'premium' });
}

Limits

The same data limits as custom events apply: string values up to 500 characters and up to 50 properties per object.

What’s Next?


Need help? Reach out to us at support@eurometrics.eu.

Ready to get started?

Create your free account and start tracking in minutes.

Start Free