setUserIsAnonymous

The setUserIsAnonymous() method marks a visitor as anonymous or non-anonymous. If set to anonymous, the visitor's IP address, location information (only the country is known), user ID and device ID are not collected. Every time the application is started, a new visitor ID is generated for anonymous visitors.

The setUserIsAnonymous(true) is set by default. This means each visitor is anonymous by default.

Syntax

setUserIsAnonymous(isAnonymous)
setUserIsAnonymous(isAnonymous): void
setUserIsAnonymous(isAnonymous): void
setUserIsAnonymous(isAnonymous): void
setUserIsAnonymous(isAnonymous): void
setUserIsAnonymous(isAnonymous): void
setUserIsAnonymous(isAnonymous): void

Parameters

isAnonymous (boolean, required)

Whether a user is anonymous or non-anonymous. True: anonymous. False: non-anonymous.

Examples

To mark a visitor as anonymous:

_paq.push(["setUserIsAnonymous", true]);
UserManagement.setUserIsAnonymous(true);
UserManagement.setUserIsAnonymous(true);
UserManagement.setUserIsAnonymous(true);
UserManagement.setUserIsAnonymous(true);
UserManagement.setUserIsAnonymous(true);
UserManagement.setUserIsAnonymous(true);

Related methods