Identifying users

The Nucleus service allows us to identify our users if we need that level of tracking. When working with analytics data, you may want to know the user's or machine's information.

You can do this when you create a new instance of the Nucleus object. Check out the following example:

const Nucleus = require("electron-nucleus")("<App Id>", {
userId: '<unique-identifier>'
});

In the preceding code, <unique-identifier> is any value that you can generate on the first application run, such as the GUID. Alternatively, you can have the user provide it, in which case you'll be provided with something such as a login or email address.

You can also specify the user ID at runtime if you don't know the value beforehand. In this case, we would use the following code:

Nucleus.setUserId('<unique-identifier>')

As you have seen, you have access to a wide range of very useful charts and analysis capabilities. All of this rich visualization may help you make the right decisions regarding how you evolve and maintain your project.

However, there are cases where you will need to allow users to opt out of tracking. Let's take a look at how we can toggle tracking features programmatically.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.141.31.209