Identifying users
By default, Strabber knows your visitors only by a random UUID that it stores in their browser. If your website has accounts, you can also tell Strabber who the visitor is, such as their user ID, email address or name. Strabber then:
- Shows the user's identifier and name on their recordings, logs and events.
- Lists them on the Users page.
- Lets you find all sessions of a user, even across devices and browsers, since each of them has its own UUID.
Identify a user
The Strabber tracking code must be installed on the page. Then, once you know who the visitor is, for example right after they log in or on any page they open while logged in, call:
strabber('user.identify', 'USER_ID');
Replace USER_ID with a value that is unique to the user in your system and doesn't change, such as their database ID or email address. Strabber treats two different identifiers as two different users. Avoid the / character in identifiers.
To also save the user's name and other details, use user.set instead:
strabber('user.set', {
identifier: 'USER_ID',
name: 'Jane Doe',
customData: [
{ param: 'Plan', value: 'Pro' },
{ param: 'Company', value: 'Acme Inc.' }
]
});
- identifier (required): the user's unique ID, as a string or a number, up to 255 characters.
123and'123'are the same user. - name (optional): the name shown on the Users page and in recordings, up to 255 characters.
- customData (optional): up to 100 extra details. Each one has a name, the
param(up to 50 characters), and avalue(up to 5,000 characters). Values can be strings, numbers ortrue/false. Entries with an empty name or value are skipped.
You can also pass customData as a plain object, which is the same as the list above:
customData: { Plan: 'Pro', Company: 'Acme Inc.' }
Each call that includes customData replaces the user's custom data with the new set. Calls without it, such as user.identify, keep the custom data that's already saved. Custom data is shown on the Users page and in the User section of the recording player. You can filter users, recordings and logs by it, use it in audiences, and import and export it.
A typical setup adds the call right after the tracking code, on pages where the visitor is logged in:
<script>
strabber('start', 'YOUR_SITE_ID');
strabber('user.identify', '<?= $user->id ?>');
</script>
How identification works
- You can call
user.identifyoruser.setat any time, even before the tracking script has finished loading. Strabber sends the identity as soon as recording starts. - The identity applies to the visitor's whole visit to the page. On single-page applications, it stays in place when the visitor moves between routes, so you only need to call it once per page load.
- If a visitor logs out and logs in as someone else without reloading the page, call
user.identifyagain with the new identifier. Strabber attributes the rest of the visit to the new user. - Calling it again with the same identifier updates the user's name and custom data.
- The user is saved when the page they're on stops being recorded. A user who has just been identified appears on the Users page once they leave the page or move to another one.
- Users are only saved for pages that are recorded. If a visit isn't recorded, for example because of traffic filters or your recording limits and schedule, the user isn't identified for that visit.
Don't send passwords, payment details or other sensitive data as the identifier, name or custom data.
The Users page
The Users page lists everyone you've identified on the current site, newest first. Each row shows:
- A View user button that opens a panel with all of the user's details: identifier, name, UUID, when they were first and last seen, tags, all custom data fields, and counts of script errors, console messages and rage clicks. Click the filter icon next to a custom data field to find recordings with that value.
- View recordings and View logs buttons that open the recordings list or Logs and errors filtered to this user.
- Created at: when the user was first identified.
- Name and Identifier.
- Tags you've added.
- Custom data: the first three fields. Hover over them to see all of them.
- UUID: the browser ID from the user's most recent visit.
Click a name, identifier or UUID to filter users, recordings or logs by that value.
To sort the table, click the Created at, Name, Identifier or UUID column header. To choose how many users each page shows, use the Display rows menu.
Find users
- Type in the search box to search by identifier, name, UUID or custom data values.
- Click Filters to open the sidebar and filter by Tag, UUID, User identifier, User name or Custom data.
To filter by Custom data, enter the field name, such as Plan, then choose a condition and enter a value. Field names and values are compared without regard to case. Is greater than and Is less than compare numbers, so Seats greater than 10 finds users with 11 seats or more. Is empty finds users who don't have the field. The same filter is available on the Recordings and Logs pages, where it finds the sessions and entries of users with that data.
- Save a set of filters to reuse it later, from the top of the sidebar.
Tag users
Check the users you want to tag, click Add tags and enter the tags. You can then filter users by tag. Tags you add here belong to the user. They're separate from recording tags.
Delete users
Check the users and click Delete selected, or choose Delete from the menu of a single user. Deleting a user only removes them from the Users page: their recordings stay. If the user visits your website again and is identified, they're added back.
Find a user's sessions
Besides the View recordings and View logs buttons on the Users page, you can find a user's activity:
- In recordings: the recordings list shows the user identifier, and marks sessions with an identified user. Use the User identifier, User name and Custom data filters, or search for the identifier.
- In the player: the User section of the recording player shows the visitor's UUID, identifier, name and custom data. Click any of them, including a custom data field, to filter recordings or logs by it.
- In logs: the Logs and errors page can show a User column and filter by user.
Import and export users
You can add users in bulk, for example to set their names before they visit, or download your list of users.
To import, click Import users and select one or more files in CSV, XML or JSON format. Each user needs an identifier. A name and custom data are optional. Users that already exist, matched by identifier, are updated. A user's custom data is only replaced if the file has custom data for them.
- CSV: one user per line, without a header row. In the import window, choose whether the identifier or the name comes first. Custom data goes in the third column, as
field=valuepairs separated by semicolons, or in the same JSON format as an export. Wrap values that contain commas in double quotes.
1001,Jane Doe,Plan=Pro;Seats=12
1002,John Smith
- JSON: a list of objects:
[
{ "identifier": "1001", "name": "Jane Doe", "custom_data": { "Plan": "Pro" } },
{ "identifier": "1002", "name": "John Smith" }
]
- XML: a
<user>element per user:
<?xml version="1.0" encoding="UTF-8"?>
<users>
<user>
<identifier>1001</identifier>
<name>Jane Doe</name>
<custom_data>Plan=Pro;Seats=12</custom_data>
</user>
</users>
To export, click Export users, choose CSV, XML or JSON, and click Export. The file includes each user's identifier, name, UUID, tags and custom data. For CSV, the order you choose sets whether the identifier or the name comes first. Custom data follows in the third column, so you can import the file again later.