CSV File Reference

To upload new users or user-level attributes, your CSV must include the user ID in the first column, with the user attributes you want to upload in the following columns.

📘

File Size

The maximum CSV file size is 100MB

❗️

Check the file encoding

Check the file's encoding to ensure it doesn't have a Byte Order Mark. To check the encoding, you can open the file in Sublime Text and click File > Save with Encoding > "UTF-8" (not "UTF-8 with BOM").

Data Types

The following user data can be uploaded directly from the dashboard via "Upload User Data" from the Audiences page.

FieldField TypeDescription
userIdStringThe user ID.
createDispositionStringThe policy that determines whether users are created by the API.
newUserIdStringIf supplied, updates the user of the current session with newUserId.
totalSessionsIntegerThe total number of sessions that a user has had in their lifetime.
timeSpentInAppUnix TimestampThe total number of seconds spent in the app in the user's lifetime.
localeStringThe current locale the user is in.
countryStringThe country the user is in, specified by ISO 2-letter code.
regionStringThe region (state) the user is in.
cityStringThe city the user is in.
locationStringThe location (latitude/longitude) of the user.
locationAccuracyTypeStringThe type of location that is provided (IP, CELL, or GPS). Default: IP.
timezoneStringThe timezone abbreviation for the user.
timezoneOffsetSecondsIntegerThe timezone offset from GMT in seconds.
devModeBooleanWhether the user is in Development Mode, i.e. the user associated with the request is a developer and not a user.
createdUnix TimestampUse this to set the date and time the user was created. The value has to be in Unix time.
This will allow you to target users based on "time of first run," etc.
lastActiveUnix TimestampUse this to set the date and time the user was last active. The value has to be in Unix time.
This will allow you to target users based on "last active," etc.

User Attributes

FieldField TypeDescription
userAttributesStringThe name of the user attribute.
Example: userId,userAttributes.facebook_id
user1,123456
We highly recommend validating the data here, for example, if it's an email.
userAttributeValuesToAddStringA map of values to add to existing user attribute sets.
Example:
userId,userAttributesValuesToAdd
user1,"{someAttribute:someValue}"
Where someAttribute is the user attribute holding a list, someValue is a new element added to the list.
userAttributeValuesToRemoveStringA map of values to remove from existing user attribute sets.
userAttributeValuesToIncrementStringA map of values to increment onto existing user attributes.

Example CSV file content:

userId,country,city,userAttributes.age,userAttributes.friends
user1,Germany,Berlin,24,"[Jimmy, Sara, Amy]"

📘

Email User Attribute

You can add users' email addresses as an attribute in the CSV file.
email is the default email user attribute. This can be modified from App Settings > Email > Email User Attribute

Events

FieldField Type
events.eventName.countIntegerNew lifetime count of for the current user.

Always set when doing historical uploads (meaning when users have no recorded occurrences of the event yet in Leanplum)
events.eventName.firstTimeUnix TimestampTime that the event first occurred, in seconds since midnight UTC on January 1, 1970.
events.eventName.lastTimeUnix TimestampTime that the event last occurred, in seconds since midnight UTC on January 1, 1970.
events.eventName.countIncrementIntegerAmount to increment the lifetime count of eventName.
events.eventName.valueNumber (Float)New lifetime value of for the current user.
events.eventName.valueIncrementNumber (Float)Amount to increment the lifetime value of eventName.

Email

Field TypeDescription
unsubscribeChannelsToAddStringSet to "Email" to unsubscribe users from all marketing emails.
unsubscribeChannelsToRemoveStringSet to "Email" to resubscribe users from all marketing emails.
unsubscribeCategoriesToAddString/ListSet to the IDs of the categories you wish to unsubscribe users from.
unsubscribeCategoriesToRemoveString/ListSet to the IDs of the categories you wish to subscribe users to