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

Import user consent

Get consent decisions from your consent platform into the datamart, by the right route.

Your goal

Make the consent decisions your users have given reach the datamart, so the platform can apply them to the data it collects.

Expected outcome

A UserChoice per user and per processing activity, current enough that enforcing a privacy wall does not start dropping data you were entitled to keep.

What has to exist first

1

The processing activities

A user choice always references a $processing_id. The processing activities have to be declared before any choice can point at them.

2

An identifier you can key the choice on

A choice is attached to a user through an account ID with its compartment, an email hash, or a device identifier - one per record.

3

Your consent management platform on the website, your CRM, a mobile application, or a preference centre. Each implies a different route below.

Choosing a route

Several routes exist, and the right one depends on where the decision is made.

Where consent is captured
Route
Why

On your website, at the moment the user decides

The $set_user_choice event through the tag

Real time, and it travels with the activity.

In a mobile app or any environment without the tag

A $set_user_choice event through the tracking API, or the user choices endpoint

Real time, and no tag required. See Server-side events.

In a CRM, a preference centre, or a historical export

A USER_CHOICE document import

Bulk, and the only practical route for a backlog of existing decisions. See Import user choices.

Loading an existing backlog

This is the typical first task: the platform is new, but your users have already made choices.

1

Export the decisions with their timestamps

$choice_ts matters - a choice without its original timestamp cannot be reasoned about later, and it is mandatory on an upsert.

2

Map each decision to a processing ID

One record per user and per processing activity. A user who accepted two processings has two records.

3

Decide between replace and merge

force_replace: true replaces the stored choice entirely; false merges into it. For a full authoritative export, replace. For an incremental feed covering one processing at a time, merge.

4

Import, and check the result

See Import user choices for the command, and reading the result for what to check.

5

Only then enforce

Attach the processing activities to your channels and compartments once the choices are in place. See Channels and Compartments.

Keeping it current

Consent changes, so the load is not a one-off:

  • New decisions should arrive in real time, through the tag or the API - a nightly batch means up to a day of enforcement based on stale choices.

  • Withdrawals matter more than acceptances: a choice that is not updated keeps the platform collecting data the user no longer accepts.

  • History is available. The change log endpoint returns the history of a choice for a user and a processing, which is what you use to answer a question about a specific person. See Server-side events.

Verify

  • A test user's choice can be read back for the processing ID you referenced.

  • The count of imported choices matches the count of decisions you exported.

  • After enforcement, ingestion volumes for the channel do not collapse - a sharp drop means choices are missing rather than that users refused. See Monitor data ingestion.

Last updated

Was this helpful?