🎉  Userflow joins forces with Beamer to create all-in-one growth toolkit

Read more
blog single image
blog single image
Userflow Updates

Userflow.js identify update

blog author
Sebastian Seilund

December 16, 2019

This post is mostly for developers :)

We've simplified how user attributes are sent to Userflow with userflow.identify() and userflow.updateUser(), and added the ability to add/subtract to/from number attributes.

This is in preparation for the release of our public REST API, which will look almost identical (just as JSON over HTTP).

The changes are fully backwards-compatible, so you don't have to change anything in your code.

Simpler attributes

Before, we distinguished between standard attributes (such as name, email and signedUpAt) and custom traits (that were put in a nested traits object). Example of what userflow.identify looked like before:

userflow.identify(user.id, {
name: user.name,
email: user.email,
signedUpAt: user.createdAt,
traits {
role: user.role,
plan: user.plan
}
})

Now there's only one level and all attributes are just... attributes. You send whatever you want - they're all treated the same. The word "trait" is gone. Updated example:

userflow.identify(user.id, {
name: user.name,
email: user.email,
signed_up_at: user.createdAt,
role: user.role,
plan: user.plan
})

Notice how signed_up_at is now snake_cased. We recommend sticking to one naming scheme.

Setting an attribute only once

Say you want to track something a user did, but you only want to track it the first time. Example: We want to know which integration a user set up first. Instead of sending the name of the integration, send an object with a set_once key:

userflow.updateUser({
integration_name: {set_once: 'My integration'}
})

The user's integration_name attribute will get the value My integration, unless, if it's already been set before, in which case we'll leave it alone.

Adding/subtracting to/from number attributes

You can also increment attributes. Say you want to track how many projects a user has created, but you don't want to recount the number of projects on every page load. Just call the following each time a project is created in your app:

userflow.updateUser({
projects_count: {add: 1}
})

You can similarly subtract by using subtract instead of add.

See full updated userflow.identify docs.

2 min 33 sec. read

blog single image
Userflow Updates

Userflow.js identify update

blog author
Sebastian Seilund

December 16, 2019

This post is mostly for developers :)

We've simplified how user attributes are sent to Userflow with userflow.identify() and userflow.updateUser(), and added the ability to add/subtract to/from number attributes.

This is in preparation for the release of our public REST API, which will look almost identical (just as JSON over HTTP).

The changes are fully backwards-compatible, so you don't have to change anything in your code.

Simpler attributes

Before, we distinguished between standard attributes (such as name, email and signedUpAt) and custom traits (that were put in a nested traits object). Example of what userflow.identify looked like before:

userflow.identify(user.id, {
name: user.name,
email: user.email,
signedUpAt: user.createdAt,
traits {
role: user.role,
plan: user.plan
}
})

Now there's only one level and all attributes are just... attributes. You send whatever you want - they're all treated the same. The word "trait" is gone. Updated example:

userflow.identify(user.id, {
name: user.name,
email: user.email,
signed_up_at: user.createdAt,
role: user.role,
plan: user.plan
})

Notice how signed_up_at is now snake_cased. We recommend sticking to one naming scheme.

Setting an attribute only once

Say you want to track something a user did, but you only want to track it the first time. Example: We want to know which integration a user set up first. Instead of sending the name of the integration, send an object with a set_once key:

userflow.updateUser({
integration_name: {set_once: 'My integration'}
})

The user's integration_name attribute will get the value My integration, unless, if it's already been set before, in which case we'll leave it alone.

Adding/subtracting to/from number attributes

You can also increment attributes. Say you want to track how many projects a user has created, but you don't want to recount the number of projects on every page load. Just call the following each time a project is created in your app:

userflow.updateUser({
projects_count: {add: 1}
})

You can similarly subtract by using subtract instead of add.

See full updated userflow.identify docs.

2 min 33 sec. read

This post is mostly for developers :)

We've simplified how user attributes are sent to Userflow with userflow.identify() and userflow.updateUser(), and added the ability to add/subtract to/from number attributes.

This is in preparation for the release of our public REST API, which will look almost identical (just as JSON over HTTP).

The changes are fully backwards-compatible, so you don't have to change anything in your code.

Simpler attributes

Before, we distinguished between standard attributes (such as name, email and signedUpAt) and custom traits (that were put in a nested traits object). Example of what userflow.identify looked like before:

userflow.identify(user.id, {
name: user.name,
email: user.email,
signedUpAt: user.createdAt,
traits {
role: user.role,
plan: user.plan
}
})

Now there's only one level and all attributes are just... attributes. You send whatever you want - they're all treated the same. The word "trait" is gone. Updated example:

userflow.identify(user.id, {
name: user.name,
email: user.email,
signed_up_at: user.createdAt,
role: user.role,
plan: user.plan
})

Notice how signed_up_at is now snake_cased. We recommend sticking to one naming scheme.

Setting an attribute only once

Say you want to track something a user did, but you only want to track it the first time. Example: We want to know which integration a user set up first. Instead of sending the name of the integration, send an object with a set_once key:

userflow.updateUser({
integration_name: {set_once: 'My integration'}
})

The user's integration_name attribute will get the value My integration, unless, if it's already been set before, in which case we'll leave it alone.

Adding/subtracting to/from number attributes

You can also increment attributes. Say you want to track how many projects a user has created, but you don't want to recount the number of projects on every page load. Just call the following each time a project is created in your app:

userflow.updateUser({
projects_count: {add: 1}
})

You can similarly subtract by using subtract instead of add.

See full updated userflow.identify docs.

About the author

Co-Founder of Userflow

Sebastian Seilund is the co-founder and former CEO of Userflow, where he built one of the leading user onboarding platforms for SaaS companies. With experience as a software engineer at Google and having founded multiple successful software companies, including Denmark's first user-friendly accounting software, Sebastian brings deep technical expertise to discussions about product-led growth and user experience.

Effortless Onboarding,
Powerful Results

Try the most-loved user onboarding product on the market.

CASE STUDIES

All case studies
iconicon

Evocalize

a case study

How Evocalize Boosted Product Adoption and Engagement With Userflow 

Learn how
iconicon

Visma Dinero

a case study

How Visma Dinero provides 24/7 onboarding and support with in-app content and AI Assistant.

Learn how
iconicon

Iteratively

a case study

How Iteratively gives users an awesome first-time experience

Learn how
iconicon