Attach personal details such as name, email, phone, age, and gender to a Pulsate user.
Pulsate collects all data anonymously unless you explicitly decide to pass personal data such as an email address or the first and last name of a customer to Pulsate.
First name is particularly useful because it can be used to dynamically personalize the user's experience. Many Pulsate customers send us their user's first name but not other personal data such as last name or email.
Before you begin
Make sure you are familiar with the Running the Pulsate SDK tutorial. Only send user data after a session has started (see below).
Setting name, email, and phone number
Invoke updateFirstName, updateLastName, updateEmail, or updatePhoneNumber on the PULPulsateManager instance:
import PULPulsate
guard let manager = PULPulsateFactory.getDefaultInstance() else { return }
manager.updateFirstName("John")
manager.updateLastName("Smith")
manager.updateEmail("[email protected]")
manager.updatePhoneNumber("+14085551234")
Phone number format
Phone numbers must be in E.164 format — a leading
+followed by 8 to 15 digits (validated against^(\+)[0-9]{8,15}$). Values that don't match are rejected.
Setting age and gender
manager.updateAge(29)
manager.updateGender(.pulFemale)
updateGender(_:) takes a PULUserGender value — .pulMale or .pulFemale.
When data is sent
The data is stored locally and sent to the Pulsate server the next time synchronization occurs. You can force synchronization by calling forceAttributeSync():
manager.forceAttributeSync()
Send data only after the session has started
Always send user data after a user session has started. Use the startPulsateSession (anonymous) or startPulsateSession(forAlias:) (identified) completion listeners:
// Anonymous session
manager.startPulsateSession { success, error in
guard success else { return }
manager.updateFirstName("John")
manager.updateLastName("Smith")
manager.updateEmail("[email protected]")
manager.updatePhoneNumber("+14085551234")
}
// Identified session (alias)
manager.startPulsateSession(forAlias: "user-alias") { success, error in
guard success else { return }
manager.updateFirstName("John")
manager.updateLastName("Smith")
manager.updateEmail("[email protected]")
manager.updatePhoneNumber("+14085551234")
}

