All Collections
Page Targeting & Segmentation
How to send user attributes and track user actions
How to send user attributes and track user actions
Learn how to create powerful segments by sending custom data to UserGuiding.
Gabriel avatar
Written by Gabriel
Updated over a week ago


User attributes are relevant information about your users that can be sent to UserGuiding, allowing you to target your content to specific audiences.

On the other hand, user action is a custom piece of information about something your user does, which can also be tracked to enhance customization.

This article explains how to send such data to UserGuiding to create powerful user segments.


Sending user attributes

User Identification is enabled

When enabling the User Identification feature in your account, you will call the window.userGuiding.identify() function to identify your end-users.

To send your user attributes to UserGuiding, you just need to include them within the identify function, as shown below. However, please check this article if you prefer to send them through the UserGuiding User API.

Important: We only support strings (only letters), numbers, booleans, and these specific date formats. We do not accept arrays, lists, or nested objects as valid user attributes.

window.userGuiding.identify(userId, {
name: "John Doe",
email: "[email protected]",
created_at: "2022/01/25",
isTrial: false,
numberOfGuides: 3

User Identification is not enabled

If you don't want to identify your users by enabling User Identification, you can still send user attributes without passing a unique ID.

Important: When proceeding with this method, you won't get the benefits of User Identification.

name: "John Doe",
email: "[email protected]",
created_at: "2022/01/25",
isTrial: false,
numberOfGuides: 3

Tracking user actions

If you want to target UserGuiding content based on actions people have or have not taken in your application, you will need to call the window.userGuiding.track() function as shown below.

Note: The track function can be used regardless if User Identification is enabled in your account.

//e.g. "Clicked some Button"

window.userGuiding.track("action name");

//Tracking button click action

window.userGuiding.track("button click action", {
button: "home-cta"

//Another action idea

window.userGuiding.track("submit support ticket", {
url: "/support",
article: "installation"

Where can I find the data I sent to create user segments?

Once you have sent user attributes and/or tracked user actions, you will be able to find them on the Users Page while applying filters.

Now you are ready to start creating your user segments!

Did this answer your question?