What is `userId` in usersnap `user` object?

290 Views Asked by At

https://help.usersnap.com/docs/api-for-usersnap-rating-project#setting-default-values-when-initializing-the-widget

I want to send studentId in usersnap feedback, I see that we can pass userId inside user object, but I didn't see it in the account inbox page when feedback submitted, only email is displayed there.

window.onUsersnapCXLoad = function(api) { 
    api.init({
      user: {
        userId: "123",
        email: "[email protected]",
      },
    });
  }

What is the purpose of userId if it's not displayed in the account inbox page? How can I send a studentId?

1

There are 1 best solutions below

0
On

Add this to your onUsersnapCXLoad function right after initialising the api object.

api.on('open', function(event) {
    event.api.setValue('custom', {studentId: '1234'});
});

For a specific project you need to subscribe to the open event to set custom values.

Note: There is a project-specific API and global API for Usersnap projects. see the help page for more information.