amplitude / Amplitude-Node

Server-side Node.js SDK for Amplitude
MIT License
67 stars 20 forks source link

Using @amplitude/identify to set boolean user property doesn't work #116

Closed ajin12 closed 3 years ago

ajin12 commented 3 years ago

Expected Behavior

Tried to set a user property to true/false

Current Behavior

Boolean user property didn't get set in Amplitude using @amplitude/identify library. As a workaround, I've been casting to string first before calling amplitudeClient.identify().

Possible Solution

Steps to Reproduce

Tried doing something like:

const identify = new Identify();
identify.set("someProperty", true);
amplitudeClient.identify(userId, deviceId, identify);

to set someProperty user property to true but it didn't get set.

As a workaround, am currently doing:

const identify = new Identify();
identify.set("someProperty", String(true));
amplitudeClient.identify(userId, deviceId, identify);

to get it set.

Environment

yuhao900914 commented 3 years ago

@ajin12 Thanks for pointing that out. The boolean type is not our valid type for Node SDK, but we should include that. Will plan to work on that.

ajin12 commented 3 years ago

@ajin12 Thanks for pointing that out. The boolean type is not our valid type for Node SDK, but we should include that. Will plan to work on that.

Thanks!