For the complete documentation index, see llms.txt. This page is also available as Markdown.

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.

If you need to track users in real time, use Collect data in real time instead.

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.

1

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.

2

Upload files against it

Each uploaded file creates a new document import execution.

The rest of this page covers imports into a datamart. To import into a collaborative dataset, see Manage your datasets in the Collaboration section.

Identifiers in imports

Imports need user identifiers so your data attaches to the right UserPoint.

The document import object

Field
Type
Description

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.

use_processing_pipeline is the setting people miss. By default an imported activity does not pass through activity analyzers or session aggregation, so it must already be correctly formatted. Set it to true when you want imported activities treated like tracked ones.

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

Status
Meaning

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:

Field
What it tells you

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

For maximum performance:

  • Keep each file to a maximum size of 100 MB.

  • Use a document import for multiple records when there will be more than 1,000 records per file.

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?