Our CSV uploader supports importing of aggregated historical events data per user: count, first occurrence, last occurrence and value. It uses the setUserAttributes API under the hood. See how to prepare such a file here.
If you also need to import event parameters with those events, the approach is different and requires CSV upload through our API. We will also be using the track API to track each event occurrence (backdated), instead of just import aggregate data for each user.
Example CSV format:
userId,event,time,params,value,currencyCode
user1,Purchase,1588350508,"{prodict:text,id:12345,version:anotherText}",150,EUR
user2,complaint_sent,1588350508,"{email:text@text.com}",,
user2,login,1588350508,,,
user3,login,1588350508,,,
WARNING/NOTE:
|
Start the import:
- Upload your file into your Google Cloud Bucket. If you don't have one, contact support@leanplum.com to have one created.
- Replace the values in CAPITALS and execute the API call in Terminal.
*Obtain your API keys from the Leanplum dashboard (Development > App Settings).
curl --location --request POST 'https://api.leanplum.com/api' \ --header 'Content-Type: application/json' \ --form 'appId="APP_KEY"' \ --form 'clientKey="DEV_KEY"' \ --form 'gcsBucket="BUCKET_NAME"' \ --form 'file="FILE_NAME"' \
--form 'action="multi"' \ --form 'defaultAction="track"'
--form 'apiVersion="1.0.6"' \
--form 'createJob="true"' \ - Monitor the progress with the getMultiResults API call below, replacing the values in CAPITALS. Once completed, it will return a URL to a file, containing the results.
*Obtain your API keys from the Leanplum dashboard (Development > App Settings).
https://api.leanplum.com/api?action=getMultiResults&appId=APP_KEY&clientKey=DEV_KEY&jobId=JOB_ID&apiVersion=1.0.6
Contact support@leanplum.com for assistance or questions regarding this process.