Accumulate data across multiple devices¶
This use case keeps a single user's activity together even when they reach your application from more than one device.
A user interacts with the application anonymously on one device, and later does the same on another. Because neither session is signed in, each device starts as its own temporary profile. When the user signs in on each device, the Customer Data Directory associates that device's profile with the authenticated user. Profiles that share the same user_id are then merged automatically into the one permanent profile, so the activity captured across devices is held together.
- The user interacts anonymously on
device A. A temporary profile is created and collects that activity. - The user interacts anonymously on
device B. A separate temporary profile is created. - The user signs in on each device. The temporary profile of that device is linked to the user, through the profile cookie of that device or through the link API. Each temporary profile gains the same
user_id. - Profiles that share a
user_idare merged automatically, and the permanent profile holds the activity from both devices.
Signing in is the deterministic signal that the devices belong to the same person, so no unification rule is required for this scenario.
Configure¶
The activity accumulated are stored in profile attributes. What happens to those values when two profiles merge is governed by each attribute's merge strategy, not by any unification rule.
Add each attribute that should accumulate across devices from the console:
- Go to Customer Data, select Profile Attributes, and click Add Profile Attribute.
- Choose the Scope — for example
Traits, orApplication Datawith the Application set to your application — and set the Attribute name. - Choose the Value type.
- Set the Merge strategy to
Combine. - Select Allow multiple values (required for
Combine). - Click Finish.
For the full field reference, see Manage profile attributes.
Warning
If the merge strategy is overwrite, the value from the most recently merged device replaces the value captured earlier on another device, and the user appears to lose the activity from their other device. Use combine with Allow multiple values selected for any attribute that should accumulate across devices. See Manage profile attributes.
Implement¶
This is the mechanism from the overview applied once per device. Get an access token once, then repeat steps 2–4 on each device the user uses. Every device builds its own temporary profile, and they are reconciled when the user signs in.
1. Get an access token. Exchange your M2M application's credentials for a token. The token carries the iam-cds audience that the Customer Data Directory APIs require.
If your backend links profiles through the link API, also request the internal_cds_profile_link scope.
2. Create a temporary profile on each device. When an anonymous visitor arrives on a device, create a profile for them. The response returns the profile_id and the anonymous_profile_tracker. Store both values in the session of that device on your server. If you use the profile cookie, your backend also sets the cds_profile cookie in that browser. Each device creates its own temporary profile, so device A and device B end up with separate profile_id and anonymous_profile_tracker values.
{
"profile_id": "a551bebd-2d2e-4e57-9f45-b02d7505670d",
"anonymous_profile_tracker": "526d5ef6-2648-48c4-b64d-82d3e0c271bf",
"meta": {
"created_at": "2026-06-05T03:38:04.834627Z",
"updated_at": "2026-06-05T03:38:04.834627Z",
"location": "<your-organization-name>/cds/api/v1/profiles/a551bebd-2d2e-4e57-9f45-b02d7505670d"
}
}
3. Capture activity against that profile. As the visitor acts, write the activity to their profile. Each device writes to its own temporary profile, so your application needs no cross-device coordination.
Where you write the value depends on the attribute's scope, and you must target the same scope the attribute was defined in:
traits— profile-wide data, shared across all your applications. Use this when the activity isn't tied to one application.application_data— data scoped to a single application, keyed by that application's ID. Use this when the value is meaningful only within one application.
4. Link each device's profile to the user. When the user signs in on a device, link the temporary profile of that device to the user. Use one of these methods:
- Profile cookie. On each device, your backend sets the
cds_profilecookie with theanonymous_profile_trackerof that device. When the user signs in on the device, WSO2 Identity Server reads the cookie and links the profile of that device to the user. This method needs the same parent domain for your application and WSO2 Identity Server. For the cookie attributes and the domain setup, see Link with the profile cookie. - Link API. Your backend links the profile after the user signs in on the device. This method has no domain requirement. Send the
profile_idof that device and the user ID. For the scope and the user ID, see Link from your backend.
As the user signs in on each device, every one of their temporary profiles gains the same user_id.
5. Profiles merge automatically. The temporary profiles that now share the same user_id — one from each device — are all merged into the single permanent profile. Because multiple profiles merge into one, attributes defined with the combine merge strategy keep the activity from every device; with overwrite, only the last-merged device's value would survive (see Configure).


