Skip to content

Custom User Data

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.

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("p@pulsatehq.com")
manager.updatePhoneNumber("+14085551234")
manager.updateAge(29)
manager.updateGender(.pulFemale)

updateGender(_:) takes a PULUserGender value — .pulMale or .pulFemale.

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

Section titled “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("p@pulsatehq.com")
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("p@pulsatehq.com")
manager.updatePhoneNumber("+14085551234")
}