Import data in batch
Upload files of activities, profiles, segments, identifiers, and consent into your datamart.
Your goal
Load data into the datamart from files rather than event by event - offline purchases, CRM profiles, email lists, identifier associations, suppression requests.
Expected outcome
Imports that run to completion, with a success count you can check and an error file you can act on.
What you can import
Offline activities such as offline purchases and store visits.
User segments such as email lists, cookie lists, user account lists.
User profiles such as CRM data and scoring.
User associations, such as CRM onboarding.
User dissociations.
User suppression requests, such as GDPR suppression requests and opt-out management.
Run a document import
You upload files associated with a document import definition:
Files represent the data.
Document imports represent what the platform should do with the data.
Each line in the uploaded file is a command to execute. Which commands are available depends on the document import type.
Create the document import definition
Tell the platform what you are importing, and where. In the interface, go to Computing Console > Jobs > Import and click New Import: you first choose the Destination type.
Datamart - to bring the data into your CDP.
Collaborative dataset - to bring the data into a Bunker, for your Clean Rooms.
Identifiers in imports
Imports need user identifiers so your data attaches to the right UserPoint.
The document import object
document_type
Enum
USER_ACTIVITY, USER_SEGMENT, USER_PROFILE, USER_CHOICE, USER_IDENTIFIERS_DELETION, or USER_IDENTIFIERS_ASSOCIATION_DECLARATIONS.
mime_type
Enum
APPLICATION_X_NDJSON or TEXT_CSV. It must match the file format. TEXT_CSV can only be chosen for USER_SEGMENT imports.
encoding
String
Encoding of the data, usually utf-8.
name
String
The name of your import.
priority
Enum
LOW, MEDIUM, or HIGH.
use_processing_pipeline
Boolean
Whether the import goes through the processing pipeline - activity analyzers, session aggregation. Default false.
shuffle_lines
Boolean
Shuffles the lines of the file for better performance. Default true.
Create and manage a document import
The listing supports filters as query parameters: keywords matches import names and is case sensitive; mime_type filters on APPLICATION_X_NDJSON or TEXT_CSV; document_types filters on USER_PROFILE, USER_ACTIVITY, or USER_SEGMENT, several separated by commas; and order_by=name sorts by name instead of by ID. The listing is paginated.
Upload a file, and follow the execution
A file upload creates an execution.
The response returns metadata including an id you use to track the execution.
Execution statuses
PENDING
The execution has been created.
RUNNING
The import has started.
SUCCEEDED
The platform has finished processing the file.
Reading the result
The result object of an execution tells you what happened:
total_success
Lines imported successfully.
total_failure
Lines that failed.
error_file_uri
A CSV listing the errors - this is where you go to fix the data.
possible_issue_on_identifiers
Whether the platform suspects a problem with the identifiers used.
top_identifiers
The identifiers seen most often, useful to spot a value repeated where it should be unique.
num_tasks, completed_tasks, erroneous_tasks
Progress and failure counts.
The error object carries the messages, each with an error ID you can pass to your Account Manager.
Cancelling
With the body {"action":"CANCEL"}. Cancellation only works while the execution is PENDING.
File size and performance
To import more than 100 MB, split the file before uploading and call the API several times:
In this section
Last updated
Was this helpful?