This action only affects analytics events that are generated by this particular user object. To mark some (or all) user attributes as private for all users, use the configuration properties PrivateAttributeNames and AllAttributesPrivate.
Not all attributes can be made private: Key(String), SecondaryKey(String), and Anonymous(Boolean) cannot be private. This is enforced by the compiler, since the builder methods for attributes that can be made private are the only ones that return IUserBuilderCanMakeAttributePrivate; therefore, you cannot write an expression like User.Builder("user-key").AsPrivateAttribute() or User.Builder("user-key").SecondaryKey("secondary").AsPrivateAttribute().
var user = User.Builder("user-key") .FirstName("Pierre").AsPrivateAttribute() .LastName("Menard").AsPrivateAttribute() .Country("ES") .Build();