When a new user signs up or an existing signs in to use your application you can create them in ProdMetrics by calling the user method.

You can call the user method for both new and existing users. ProdMetrics will create or update the user based on the externalId that you provide.

<script type="text/javascript">
  prodmetrics('user', {
    externalId: user.id,
    email: user.email,
    firstName: user.firstName,
    lastName: user.lastName,
    firstSeenAt: new Date(user.createdAt).toISOString()
  });
</script>

User properties

PropertyDescriptionRequired
externalIdYour unique identifer for the user.Yes
emailUser’s email address.Optional
firstNameUser’s first name.Optional
lastNameUser’s last name.Optional
firstSeenAtThe date/time that your user signed up. Defaults to the current date/time.Optional

You can also provide your own properties using custom properties.

Privacy Mode

If you’d prefer to keep your user’s name and email address private, you can identify your users in Privacy Mode by omitting their name and email address from the user call. You’ll still see your user in your ProdMetrics dashboard, and their survey responses will be linked using the user’s externalId.

<script type="text/javascript">
  prodmetrics('user', {
    externalId: user.id,
  });
</script>