Cross-device user tracking

Start with anonymous analytics, then identify a signed-in user so their earlier browser sessions and future activity across devices appear in one linked history.

Set the display name and tracking ID

window.gum.setSessionName("John");
window.gum.setTrackingId(currentUser.id);

Despite the method name, setSessionName sets the display name used across linked visits. The tracking ID should be a stable internal account or user ID, not an email address or another sensitive value.

What happens to earlier anonymous activity?

When a tracking ID is assigned, Gumanalytics updates earlier sessions that share the same project-scoped anonymous visitor identifier. Their existing pageviews, custom events, replays, and heatmap links remain attached through the session ID.

Connect the same user on another device

Call setTrackingId with the same stable value after the user signs in on each device. Their visits appear together on the session detail page, where a device selector is shown when multiple device identities are available.

Review the user history

  • Open Sessions and select the user's name or session ID.
  • Review city, country, device, and operating-system context.
  • Compare journeys from separate visits.
  • Review custom events recorded before and after identification.
  • Follow session links from replay metadata.

Related documentation